ATA PIO Mode: Difference between revisions

Added code tags.
[unchecked revision][unchecked revision]
(→‎400ns delays: minor rewording)
(Added code tags.)
Line 288:
===Detecting device types===
(Using a Software Reset -- adapted from PypeClicker)
 
<pre>
<source lang="c">
/* on Primary bus: ctrl->base =0x1F0, ctrl->dev_ctl =0x3F6. REG_CYL_LO=4, REG_CYL_HI=5, REG_DEVSEL=6 */
int detect_devtype (int slavebit, struct DEVICE *ctrl)
Line 308 ⟶ 309:
return ATADEV_UNKNOWN;
}
</presource>
 
 
===ATA Driver===
Line 315:
(Note: the following routines should all include some form of OS-specific timeout.)
 
<source lang="asm">
<pre>
; do a singletasking PIO ATA read
; inputs: ebx = # of sectors to read, edi -> dest buffer, esi -> driverdata struct, ebp = 4b LBA
Line 592:
pop eax
ret
</presource>
 
 
==Comments==
 
ATA Execute Drive Diagnostic command (0x90) may not work right in Bochs.
 
252

edits