Switch to full style
Tools for hard drive diagnostics, repair, and data recovery
Post a reply

Enquiry on ATA commands using OS instead of Dos

May 5th, 2010, 1:38

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.

Re: Enquiry on ATA commands using OS instead of Dos

May 5th, 2010, 17:58

Have a look at winio.dll. It Is what I use.

Re: Enquiry on ATA commands using OS instead of Dos

May 5th, 2010, 20:43

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.

Re: Enquiry on ATA commands using OS instead of Dos

May 6th, 2010, 14:45

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.

Re: Enquiry on ATA commands using OS instead of Dos

May 24th, 2010, 3:41

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.

Re: Enquiry on ATA commands using OS instead of Dos

May 25th, 2010, 15:53

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).

Re: Enquiry on ATA commands using OS instead of Dos

May 28th, 2010, 21:00

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.

Re: Enquiry on ATA commands using OS instead of Dos

May 29th, 2010, 10:02

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.

Re: Enquiry on ATA commands using OS instead of Dos

June 1st, 2010, 5:02

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.
Post a reply