Here's my PMode code, GDT, & GDTR:
Code: Select all
bits 16
;; stuff
cli
lgdt [FBGDTR]
mov eax, CR0
or al, 1
mov CR0, eax
jmp 0x08:pMode
;; 16 bit routines
bits 32
pMode:
;; Stuff that's never reached
FBGDT:
.gdtnull:
dd 0
dd 0
.gdtcs:
dw 0FFFFh
dw 0
db 0
db 10011010b
db 11001111b
db 0
.gdtds:
dw 0FFFFh
dw 0
db 0
db 10010010b
db 11001111b
db 0
FBGDTEND:
FBGDTR:
dw FBGDTEND - FBGDT - 1
dd FBGDT
Code: Select all
00023582386i[BIOS ] Booting from 0000:7c00
00023598390e[CPU0 ] fetch_raw_descriptor: GDT: index (f)1 > limit (0)
00023598390i[CPU0 ] CPU is in protected mode (active)
00023598390i[CPU0 ] CS.d_b = 16 bit
00023598390i[CPU0 ] SS.d_b = 16 bit
00023598390i[CPU0 ] EFER = 0x00000000
00023598390i[CPU0 ] | RAX=0000000060000011 RBX=0000000000000200
00023598390i[CPU0 ] | RCX=0000000000000838 RDX=0000000000000180
00023598390i[CPU0 ] | RSP=0000000000007fe6 RBP=0000000000008000
00023598390i[CPU0 ] | RSI=0000000000007a00 RDI=0000000000080400
00023598390i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00023598390i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00023598390i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00023598390i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00023598390i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf zf af PF cf
00023598390i[CPU0 ] | SEG selector base limit G D
00023598390i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00023598390i[CPU0 ] | CS:0000( 0004| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00023598390i[CPU0 ] | MSR_FS_BASE:0000000000000000
00023598390i[CPU0 ] | MSR_GS_BASE:0000000000000000
00023598390i[CPU0 ] | RIP=0000000000008082 (0000000000008082)
00023598390i[CPU0 ] | CR0=0x60000011 CR1=0x0 CR2=0x0000000000000000
00023598390i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00023598390i[CPU0 ] >> jmp far 0008:81a7 : EAA7810800
00023598390e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00023598390i[SYS ] bx_pc_system_c::Reset(SOFTWARE) called
00023598390i[CPU0 ] cpu software reset