My OS wasn't working on my computer, even though it worked on every emulator I've tested it (many). Now I've managed to narrow the problem down to
any call to interrupt 13h.
I've put a jump instruction to the protected mode loader right before the interrupt call:
Code:
[...]
cmp dl, [DriveNumber]
je drive_number_ok
mov [DriveNumber], dl
mov ah, 8
jmp ent_pmode ; SKIP LOADING KERNEL
int 0x13
[...]
And it works just fine, I can load into protected mode and print some debug strings. Now, if I put it just after my call to the interrupt, like this:
Code:
[...]
cmp dl, [DriveNumber]
je drive_number_ok
mov [DriveNumber], dl
mov ah, 8
int 0x13
jmp ent_pmode
[...]
It suddenly doesn't work anymore, my computer reboots. I've tried everything, set up EVERY general register and segment register to their EXACT values before the interrupt call, and nothing.
I've also tried to skip this interrupt call, by setting my disk variables manually, but then in my next interrupt call (INT13/2, to actually read information from the disk) the same problem occurs.
I can't make any sense out of this, especially because INT13/8 shouldn't change anything else except a few registers that have no influence whatsoever on the protected mode code/jump.
If it changes anything, I have a Gigabyte G31M-ES2L motherboard with an Intel Core 2 Duo E7500 processor.
Thanks.