All times are UTC - 5 hours [ DST ]


Switch to mobile style


Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 5th, 2010, 1:38 
Offline

Joined: May 4th, 2010, 23:25
Posts: 4
Location: singapore
Hi,

I have a project of creating a GUI pogram using C++ or C# to send ATA commands to HDD for read/write disk sector. Can someone help me out with it? So far what i can find online is using IOCTL_ATA_PASS_Through, but i am not sure how to use it. Please help me. Thank you.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 5th, 2010, 17:58 
Offline

Joined: November 11th, 2007, 22:44
Posts: 168
Have a look at winio.dll. It Is what I use.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 5th, 2010, 20:43 
Offline

Joined: May 4th, 2010, 23:25
Posts: 4
Location: singapore
phishin_ca wrote:
Have a look at winio.dll. It Is what I use.


Hi, thank you. I've just download the winio file. Can you show me how to perform read and write to disk sector by sending ATA commands to HDD? Thank you alot.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 6th, 2010, 14:45 
Offline

Joined: November 11th, 2007, 22:44
Posts: 168
There are only 3 methods you need to know. init, getportval, and setportval. The rest you will have to use google on those terms to find info. It is really easy if you understand how it works. That is something I would not be able to explain.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 24th, 2010, 3:41 
Offline

Joined: May 4th, 2010, 23:25
Posts: 4
Location: singapore
Hi phishin_ca, Thanks for the replied. I've readed up on the winio. I know that init, getportval and setportval. But there is still something i don't know. Like which hard disk is the initializewinIo reading from, as I attach a extra hard disk drive using USB to SATA/IDE adapter. I want to send ATA commands and read from there. Do you have any example to show me? Thank you alot.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 25th, 2010, 15:53 
Offline

Joined: May 6th, 2008, 22:53
Posts: 2138
Location: England
nicholasamh wrote:
[...] which hard disk is the initializewinIo reading from, as I attach a extra hard disk drive using USB to SATA/IDE adapter. I want to send ATA commands and read from there.


At the beginning, you didn't mention that you were using a USB-attached disk :(

I have only used winio for sending commands to direct-attached ATA disks (or SATA disks via an adapter which pretends to be ATA). Personally, I don't see how it is possible to use winio to control a USB-attached disk (unless you know exactly how to program the registers of your USB Host Controller), and therefore you probably need to investigate using a different OS API for a USB-attached disk (or else use a direct-attached disk instead, if you want to use winio).


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 28th, 2010, 21:00 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 14945
Location: Australia
nicholasamh wrote:
... I attach a extra hard disk drive using USB to SATA/IDE adapter. I want to send ATA commands and read from there.

I know of at least two open source programs, smartmontools (Linux / Windows) and CrystalDiskMark/CrystalDiskInfo (Windows).

I believe both can access USB hard drives.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: May 29th, 2010, 10:02 
Offline

Joined: November 11th, 2007, 22:44
Posts: 168
The only concern would be what types of commands do you want to send. A lot of the USB adapters only support a small subset.


Top
 Profile  
 
 Post subject: Re: Enquiry on ATA commands using OS instead of Dos
PostPosted: June 1st, 2010, 5:02 
Offline

Joined: May 4th, 2010, 23:25
Posts: 4
Location: singapore
Okay. I only want to identify HDD, select disk sector, Read and write data into HDD. Can you help me out with me as i have no idea how to start. Thank you alot.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group