ATA PIO Mode: Difference between revisions

m
Fixed some grammar errors.
[unchecked revision][unchecked revision]
(Added notes on forum article and conformancy.)
m (Fixed some grammar errors.)
Line 99:
All by all, it seems that a lot of ATA drives handle operations differently, as ~, one of our members, found out (see [http://forum.osdev.org/viewtopic.php?f=1&t=20690&hilit=ATA+Detection the forums]). The floating bus 0xFF value, for example, isn't always the value you would expect it to be. Different hard drives may also report different values for the Cylinder Low and Cylinder High values which you usually check when an error was returned in status byte after attempting to execute the IDENTIFY (0xEC) command.
 
One could also try to ignore whether the ATA IDENTIFY command returns an error or not, and simply immediately contiunecontinue towith reading the Cylinder Low and High values. As said above, they should be both be 0x00 for standard PATA devices. Sadly, it seems that some hardware (and sometimes Bochs) can return different values for these registers. Sometimes it may help to try and 'flush' a couple of registers, e.g.:
 
<source lang="c">
// 'base' is e.g. 0x01F0.
outb(base + 2, 0x00); // Sector count
outb(base + 3, 0x00); // Sector number
outb(base + 4, 0x00); // Cylinder low
outb(base + 5, 0x00); // Cylinder high
</source>
 
252

edits