972
edits
[unchecked revision] | [unchecked revision] |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
|||
Line 5:
==Read in CHS mode==
Accessing disk using CHS (cylinder,head,sector) indexes seem to be kinda old type but is the base for LBA access. The following NASM long-mode subroutine reads CH sectors to memory address indicated by RDI register.
<
;=============================================================================
; ATA read sectors (CHS mode)
Line 77:
popfq
ret
</syntaxhighlight>
==Read in LBA mode==
{{stub}}
<
;=============================================================================
; ATA read sectors (LBA mode)
Line 149:
popfq
ret
</syntaxhighlight>
=ATA write sectors=
Line 155:
A write is mostly equivalent to performing a read operation. The only changes needed are a change in command (0x30 for chs write), and the direction of the data, which is written (rep outsw from *SI) to the data port rather than read (rep insw to *DI).
<
;=============================================================================
; ATA write sectors (LBA mode)
Line 225:
popfq
ret
</syntaxhighlight>
=See also=
|