How can I replace INT instruction ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
raz0r
Posts: 19
Joined: Sat Apr 30, 2011 6:02 pm

Re: How can I replace INT instruction ?

Post by raz0r »

gerryg400 wrote:data_readBuffer must be a char [512]. Not a char.
In that code im trying to check if in the var data_readBuffer are the 256 bytes information of the harddisk.
Comments like this make me think that you are not really reading the documentation. There are 256 x 16-bit words to read. Not 256 bytes. Not even 512 bytes.

Also my personal opinion is that the code in the ATA/IDE tutorial should not be used if you want a reliable, maintainable driver. The ATA PIO mode article is better. You also need the real ATA specs.
Yes, data_readBuffer must be a char*, sorry.
I understood bad the documentation, thanks for the clarification.

Do you have any idea about what changes should I make in my code for put the information in data_readBuffer ?
I sent all ports that I need, I think that this step should not be very difficult.

Maybe Im not reading complete sectors... but how to.. :/
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: How can I replace INT instruction ?

Post by gerryg400 »

Yes, data_readBuffer must be a char*, sorry.
Not

Code: Select all

char *
It must be an array big enough to hold a sector.
If a trainstation is where trains stop, what is a workstation ?
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: How can I replace INT instruction ?

Post by gerryg400 »

Reading data from a hard-drive is not as simple as just reading from a port. It may work on some computers but not others, depending on the initial state of the device. That's why, in general, you need to write a complete driver to do it. You need to be able to reset the drive, wait for its status to change, optionally handle interrupts, check for and recover from errors, and more.

To see a basic working driver that is reasonably easy to understand, have a look at the public domain mmurtl IDE driver.

http://www.ipdatacorp.com/mmpd.html
If a trainstation is where trains stop, what is a workstation ?
Post Reply