Fix CHS sector-by-sector read loop
This commit is contained in:
@@ -121,7 +121,7 @@ VerifyBiosParameterBlock:
|
|||||||
ja FsError
|
ja FsError
|
||||||
|
|
||||||
ReadExtraCode:
|
ReadExtraCode:
|
||||||
/* Read second VBR sector with extra boot code */
|
/* Read second VBR sector with extra boot code (1 sector starting from sector 2) */
|
||||||
movl HiddenSectors - Start(%bp), %eax
|
movl HiddenSectors - Start(%bp), %eax
|
||||||
addl $0x02, %eax
|
addl $0x02, %eax
|
||||||
movw $0x01, %cx
|
movw $0x01, %cx
|
||||||
@@ -151,6 +151,10 @@ ReadSectors:
|
|||||||
|
|
||||||
ReadCHS:
|
ReadCHS:
|
||||||
/* Read sectors using CHS */
|
/* Read sectors using CHS */
|
||||||
|
popal
|
||||||
|
|
||||||
|
CHSLoop:
|
||||||
|
/* Read sector by sector using CHS */
|
||||||
pushw %cx
|
pushw %cx
|
||||||
pushal
|
pushal
|
||||||
xorl %edx, %edx
|
xorl %edx, %edx
|
||||||
@@ -176,7 +180,7 @@ ReadCHS:
|
|||||||
movw %es, %dx
|
movw %es, %dx
|
||||||
addw $0x20, %dx
|
addw $0x20, %dx
|
||||||
movw %dx, %es
|
movw %dx, %es
|
||||||
loop ReadCHS
|
loop CHSLoop
|
||||||
popw %es
|
popw %es
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user