Ok, what's wrong?
Posted: Sun May 20, 2012 2:01 pm
This is the code to enter pmode:
the relevant parts of bochs' log:
the list file:
I am following these instructions. Why is it triple faulting?
Code: Select all
org 0x7c00
...
bits 32
contA:
cli
lgdt [endGDT] ; I have tried this here and after "mov cr0, eax"
mov eax, cr0
or eax, 1
mov cr0, eax
xor eax, eax ; I have tried with and without these four lines.
xor ebx, ebx
xor edx, edx
xor ecx, ecx
jmp 0x8:pmode ; I have used memory dumps, log files, hlt instructions, etc. and determined that this line throws an error.
...
pmode:
hlt
Code: Select all
00017825015i[BIOS ] Booting from 0000:7c00
00018000000i[WGUI ] dimension update x=640 y=400 fontheight=0 fontwidth=0 bpp=8
00045097126e[CPU0 ] jump_protected: gate type 0 unsupported
00045097126e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00045097126e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00045097126i[CPU0 ] CPU is in protected mode (active)
00045097126i[CPU0 ] CS.d_b = 16 bit
00045097126i[CPU0 ] SS.d_b = 16 bit
00045097126i[CPU0 ] EFER = 0x00000000
00045097126i[CPU0 ] | RAX=0000000060000000 RBX=0000000000000000
00045097126i[CPU0 ] | RCX=0000000000000000 RDX=0000000000000000
00045097126i[CPU0 ] | RSP=000000000000ffff RBP=000000000000ffff
00045097126i[CPU0 ] | RSI=00000000000e0000 RDI=000000000000ffac
00045097126i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00045097126i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00045097126i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00045097126i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00045097126i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00045097126i[CPU0 ] | SEG selector base limit G D
00045097126i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00045097126i[CPU0 ] | CS:0000( 0004| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | ES:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0
00045097126i[CPU0 ] | MSR_FS_BASE:0000000000000000
00045097126i[CPU0 ] | MSR_GS_BASE:0000000000000000
00045097126i[CPU0 ] | RIP=0000000000007cf3 (0000000000007cf3)
00045097126i[CPU0 ] | CR0=0x60000011 CR2=0x0000000000000000
00045097126i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00045097126i[CPU0 ] 0x0000000000007cf3>> jmp far 0008:7d53 : EA537D0800
Code: Select all
1 org 0x7c00
...
111 bits 32
112 contA:
113 000000D8 FA cli
114 000000D9 0F0115[A8020000] lgdt [endGDT]
115 000000E0 0F20C0 mov eax, cr0
116 000000E3 0D01000000 or eax, 1
117 000000E8 0F22C0 mov cr0, eax
118 000000EB 31C0 xor eax, eax
119 000000ED 31DB xor ebx, ebx
120 000000EF 31D2 xor edx, edx
121 000000F1 31C9 xor ecx, ecx
122 000000F3 EA537D00000800 jmp 0x8:pmode
...
162 pmode:
163 00000153 F4 hlt