My LBA->CHS function seems to be broken. It works when I've values that stay on track 0, but anything above fails.
It's the regular generic LBA->CHS:
Code: Select all
lba_to_chs:
push bx
xor dx, dx
div word [SPT]
mov cx, dx
inc cx
xor dx, dx
div word [heads]
mov ch, al
mov dh, dl
pop bx
ret
However, when I check the bochs memory dump, it spits out zeros.
Does anything seem wrong with it? I've checked it with values < 18, and it does read them.
Hopefully this is coherent, I was up til 3 yesterday trying to fix this problem with no luck.
Thanks,
Alboin