This commit is contained in:
parent
c0607ecca8
commit
3749f99d24
|
@ -943,7 +943,7 @@ load-first-sector-from-primary-bus-secondary-drive: # out: (addr stream byte)
|
|||
(ata-lba 0 0 0) # lower 24 bits of LBA, all 0
|
||||
(ata-command 0x20) # read sectors with retries
|
||||
# poll for results
|
||||
(poll-ata-primary-bus-primary-drive-regular-status-word)
|
||||
(poll-ata-regular-status-word)
|
||||
# emit results
|
||||
ba/copy-to-edx 0x1f0/imm32
|
||||
b9/copy-to-ecx 0x200/imm32 # 512 bytes per sector
|
||||
|
@ -1173,19 +1173,20 @@ $ata-command:end:
|
|||
5d/pop-to-ebp
|
||||
c3/return
|
||||
|
||||
poll-ata-primary-bus-primary-drive-regular-status-word:
|
||||
poll-ata-regular-status-word:
|
||||
# . save registers
|
||||
50/push-eax
|
||||
52/push-edx
|
||||
#
|
||||
ba/copy-to-edx 0x1f7/imm32
|
||||
{
|
||||
ba/copy-to-edx 0x1f7/imm32
|
||||
ec/read-port-dx-into-al
|
||||
a8/test-bits-in-al 0x80/imm8/bsy # set zf if bit 7 (most significant) is not set
|
||||
75/jump-if-zf-not-set-and-bit-7-set loop/disp8
|
||||
a8/test-bits-in-al 8/imm8/drq # set zf if bit 3 is not set
|
||||
74/jump-if-zf-set-and-bit-3-not-set loop/disp8
|
||||
}
|
||||
$poll-ata-primary-bus-primary-drive-regular-status-word:end:
|
||||
$poll-ata-regular-status-word:end:
|
||||
# . restore registers
|
||||
5a/pop-to-edx
|
||||
58/pop-to-eax
|
||||
|
|
Loading…
Reference in New Issue