HDD GURU FORUMS
http://forum.hddguru.com/

Enquiry on ATA commands using OS instead of Dos
http://forum.hddguru.com/viewtopic.php?f=7&t=15672
Page 1 of 1

Author:  nicholasamh [ May 5th, 2010, 1:38 ]
Post subject:  Enquiry on ATA commands using OS instead of Dos

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.

Author:  phishin_ca [ May 5th, 2010, 17:58 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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

Author:  nicholasamh [ May 5th, 2010, 20:43 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Author:  phishin_ca [ May 6th, 2010, 14:45 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Author:  nicholasamh [ May 24th, 2010, 3:41 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Author:  Vulcan [ May 25th, 2010, 15:53 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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

Author:  fzabkar [ May 28th, 2010, 21:00 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Author:  phishin_ca [ May 29th, 2010, 10:02 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Author:  nicholasamh [ June 1st, 2010, 5:02 ]
Post subject:  Re: Enquiry on ATA commands using OS instead of Dos

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.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/