You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
; We need to read 256 words at a time
mov ecx, 256
mov dx, 0x1F0
rep insw
pop ecx
loop .next_sector
; End of reading sectors into memory
ret
Since ES is zero, instruction rep insw relies on a ES segment that points to the NULL entry of the GDT table, this shouldn't work or could throw an exception, but works on qemu, maybe it's a bug of qemu or an undefined behaviour of the cpu.
To fix it, at label start32 that begins on line 85 we can set the ES register to the data segment in GDT table:
In boot.asm:
ES
segment register is set to zero on line 41,At the end of procedure
ata_lba_read
on line 145Since
ES
is zero, instructionrep insw
relies on aES
segment that points to theNULL
entry of the GDT table, this shouldn't work or could throw an exception, but works on qemu, maybe it's a bug of qemu or an undefined behaviour of the cpu.To fix it, at label
start32
that begins on line 85 we can set theES
register to the data segment in GDT table:So :
Can be changed to something like this:
The text was updated successfully, but these errors were encountered: