I am developing a 32 bit operating system. I have just implemented paging but came across a problem. My GDT was getting overwritten. That problem was fixed in a previous question. To fix it, I had to load my kernel at 0x8000 instead of 0x1000. But when I try to do that, bochs give me this error:
set_diskette_current_cyl(): drive > 1
But when I look at my code, I see that dl
is being set to 0 right before int 0x13
. Can someone please explain why this happens?
Full code on GitHub
Full bochs log:
00014693525i[BIOS ] Booting from 0000:7c00
00015876408i[FLOPPY] partial read() on floppy image returns 7/512
00015920854i[FLOPPY] read() on floppy image returns 0
00015965299i[FLOPPY] read() on floppy image returns 0
00016009745i[FLOPPY] read() on floppy image returns 0
00016054189i[FLOPPY] read() on floppy image returns 0
00016098634i[FLOPPY] read() on floppy image returns 0
00016166924p[BIOS ] >>PANIC<< set_diskette_current_cyl(): drive > 1
00016166924i[CPU0 ] CPU is in real mode (active)
00016166924i[CPU0 ] CS.mode = 16 bit
00016166924i[CPU0 ] SS.mode = 16 bit
00016166924i[CPU0 ] EFER = 0x00000000
00016166924i[CPU0 ] | EAX=0000040a EBX=0000cd4b ECX=00090200 EDX=00000402
00016166924i[CPU0 ] | ESP=00008f70 EBP=00008f74 ESI=000e0000 EDI=0000ffac
00016166924i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
00016166924i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00016166924i[CPU0 ] | CS:f000( 0004| 0| 0) 000f0000 0000ffff 0 0
00016166924i[CPU0 ] | DS:f000( 0005| 0| 0) 000f0000 0000ffff 0 0
00016166924i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00016166924i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00016166924i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00016166924i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00016166924i[CPU0 ] | EIP=0000054b (0000054a)
00016166924i[CPU0 ] | CR0=0x60000010 CR2=0x00000000
00016166924i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00016166924i[CPU0 ] 0x000000000000054a>> out dx, al : EE
00016166924i[CMOS ] Last time is 1684823363 (Tue May 23 11:59:23 2023)
00016166924i[ ] restoring default signal behavior
========================================================================
Bochs is exiting with the following message:
[BIOS ] set_diskette_current_cyl(): drive > 1
========================================================================
00016166924i[SIM ] quit_sim called with exit code 1