MultiDrive – free backup, clone & wipe disk utility from Atola Technology

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ATA commands programming on Windows & Linux
PostPosted: September 3rd, 2009, 0:33 
Offline

Joined: August 19th, 2009, 2:24
Posts: 7
Location: India
Hey guys,

I am willing to write a code in win32 on windows or in gcc on Linux. Actually i am novice in this HDD ATA thing and thought will gain knowledge by programming some ATA stuff. :)

Now, my problems are,
1.How to by pass Windows HAL to get direct access to HDD SA
2.Which win32 API's should be used to read/write on SA
( I have tried DeviceIOControl & ioctl but havnt got much out of that :shock: )
3.In order to read/write using ATA command set what kind of programming mechanism should be used ?
(Is there any recommended way)
4.Can any one share some sample code to read/write HDD with ATA commands? (please)


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 3rd, 2009, 16:21 
Offline

Joined: October 23rd, 2006, 8:56
Posts: 1336
It would be best to use Assembler. If you want you can always use your High level language of choice to make things look pretty. Also do a search here on the forum and u will find more information. You can also find some links to some ATA sample code. SA requires proprietary information, so that's a totally different story.

Best of Luck


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 3rd, 2009, 21:20 
Offline

Joined: October 3rd, 2005, 0:40
Posts: 4753
Location: Hungary
The main question here is how to access IO ports...
In windows it is pretty tricky, either u have to build a driver that runs on ring0, or use some prog that opens access to a specified range of IO ports.
IOCTL calls might be another choice, but it sometimes doesn't work as it should

pepe

_________________
Adatmentés - Data recovery


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 3rd, 2009, 22:05 
Offline

Joined: June 9th, 2008, 12:06
Posts: 213
What about Tx/Rx the ATA commands directly from your program to a microcontroller (you program controller in assembler of course) via serial port (RS232 /usb). This way you interface with drive in a manner similarly to other hardware DR tools?

_________________
http://pcrecoveryllc.com


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 3rd, 2009, 22:51 
Offline

Joined: October 23rd, 2006, 8:56
Posts: 1336
When sending commands via Tx /Rx are you not limited to terminal communication?
What would be the benefit of doing this rather then sending the commands in asm to the registers passing through the IDE/SATA interface?


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 4th, 2009, 7:56 
Offline

Joined: June 9th, 2008, 12:06
Posts: 213
I was thinking of a simple, quick PCB with serial port or usb (using max232 or other), microcontroller, and IDE connector. This project might start out very simply, but you could add power controls later if you like. I was not talking about serial port to HDD but rather serial/usb -> ide. Not original at all, done a million times, but good to learn and develop i think. Only need a few cheap ICs and programmer to make it...

_________________
http://pcrecoveryllc.com


Top
 Profile  
 
 Post subject: Re: ATA commands programming on Windows & Linux
PostPosted: September 4th, 2009, 9:22 
Offline

Joined: October 23rd, 2006, 8:56
Posts: 1336
Ok, Got it, i miss understood because of the Tx /Rx.
Sounds like a fun project :D


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 14 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group