Bogus int 13h error 0xc in qemu?
-
- Member
- Posts: 70
- Joined: Tue Jul 14, 2020 4:01 am
- Libera.chat IRC: clementttttttttt
Bogus int 13h error 0xc in qemu?
For some reasons, int 13h is still setting the carry flag and complaining about "media type not found" in qemu, even though I can prove that the sectors are correctly loaded.
-
- Member
- Posts: 5568
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Bogus int 13h error 0xc in qemu?
It's hard to say what's wrong without seeing your code.
-
- Member
- Posts: 70
- Joined: Tue Jul 14, 2020 4:01 am
- Libera.chat IRC: clementttttttttt
Re: Bogus int 13h error 0xc in qemu?
code is attached as file.
- Attachments
-
- horizonboot.asm
- (1.92 KiB) Downloaded 36 times
-
- Member
- Posts: 34
- Joined: Sat Sep 07, 2019 5:17 pm
- Libera.chat IRC: Superleaf1995
Re: Bogus int 13h error 0xc in qemu?
You're not clearing flags before calling INT 0x13. This is a big nono. INT 0x13 calls are known to assume that the carry flag is clear when it is not. They also love to destroy BP.clementttttttttt wrote:code is attached as file.
:-)
-
- Member
- Posts: 5568
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Bogus int 13h error 0xc in qemu?
Code: Select all
.nsectors dw 16
Code: Select all
mov sp,0x4000
xor ax,ax
mov ss,ax
Code: Select all
lgdt [gdtinfo]
pop ds
mov ah,0x41
mov bx,0x55aa
mov dl,0x80
int 13h
You make BIOS calls between loading the GDTR and switching to protected mode. BIOS calls may modify the GDTR.
Code: Select all
int 13h
cli
cmp ah,0xc
je skip
jc error
Code: Select all
lodsb
Code: Select all
mov ax,0x4f02
mov bx,0x4113
int 10h
Code: Select all
and al,0xfe
mov cr0,eax
jmp $