I am following the series on OSdev by Brokenthorn (probably like many people here), and I've ran into some trouble. When I try to install the GDT and switch to protected mode as explained in the 8th installment, Bochs keeps restarting, so I suppose I've ran into a triple fault.
After a bit of trying and rewriting my code I was tired, so I tried to assemble and run Brokenthorn's example code. It turns out Bochs behaves exactly the same way when I compile the provided example code! I have no idea what to do now. Could there be a fault in my stage 1 bootloader (seems unlikely), is it because I have a newer version of Bochs? How does the provided example code run for you guys? I could upload the floppy image or the flat binary somewhere if anyone thinks it will help.
BTW, I run win XP and have Bochs 2.6.2. The last lines of the Bochs logfile are:
- 00014919114i[BIOS ] Booting from 0000:7c00
00015991904e[CPU0 ] fetch_raw_descriptor: GDT: index (f) 1 > limit (0)
00015991904e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00015991904e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00015991904i[CPU0 ] CPU is in protected mode (active)
00015991904i[CPU0 ] CS.mode = 16 bit
00015991904i[CPU0 ] SS.mode = 16 bit
00015991904i[CPU0 ] EFER = 0x00000000
00015991904i[CPU0 ] | EAX=60000011 EBX=0000000f ECX=0009000f EDX=00000000
00015991904i[CPU0 ] | ESP=0000ffff EBP=00000000 ESI=000e0538 EDI=000000c0
00015991904i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00015991904i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00015991904i[CPU0 ] | CS:3000( 0004| 0| 0) 00030000 0000ffff 0 0
00015991904i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015991904i[CPU0 ] | SS:9000( 0005| 0| 0) 00090000 0000ffff 0 0
00015991904i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015991904i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015991904i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00015991904i[CPU0 ] | EIP=00000084 (00000084)
00015991904i[CPU0 ] | CR0=0x60000011 CR2=0x00000000
00015991904i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00015991904i[CPU0 ] 0x0000000000000084>> jmp far 0008:0589 : EA89050800
00015991904e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00015991904i[SYS ] bx_pc_system_c::Reset(HARDWARE) called
BTW: Now reading this topic on this forum. Someone suggests that a IDT should be loaded. In the Brokenthorn tutorial, this is not yet done. It is not explicitly mentioned, but I suppose that the provided example code should assemble and run without errors.