Page 1 of 1

hdd access

Posted: Sun Jul 24, 2005 4:08 am
by Memo
How can I access hdd using i/o ports. I mean I want to read and write sectors to hdd without using dma. Is there a good tutorial or example about this subject??

Re:hdd access

Posted: Sun Jul 24, 2005 4:41 am
by Kim
PIO mode?

Re:hdd access

Posted: Sun Jul 24, 2005 6:21 am
by CloudNine
Well, I've got a tutorial in progress about ATA hard-drives at my site, but currently it only talks about identifying hard-drives (and I've started a reading and writing tutorial). Maybe if more people read it and leave comments I'll be more motivated to carry on with writing it :)

Re:hdd access

Posted: Mon Jul 25, 2005 4:27 am
by Pype.Clicker
i do have some document based on my own experience. dunno if it will help much.

http://clicker.sourceforge.net/docs/tea ... mming.html

Re:hdd access

Posted: Mon Jul 25, 2005 5:16 am
by durand
Some of the best "reference" source code is the code available from: http://www.ata-atapi.com

I downloaded that code, converted it to protected mode and used the PIO (no dma) source to imlement my own driver. My driver's source is a C++ class which provides read() and write() operations.

But I reckon it will be easy enough for you to literally copy the files, cut out the junk you don't like and have it work. Oh, provided you have all the relevant C functions implemented. If you don't want to do that, you could always read the code and see what it does - and use it as a working reference until yours works. ( http://www.djm.co.za/spoon/ )