HELP ! Paging problems switching to long mode
Posted: Sat Feb 18, 2006 11:32 am
Greetings all,
I am writting a small boot loader to enable long mode and jump to some 64 bit code.
However I've hit a problem when enabling paging, I am getting the following messages from bochs:
00119797160i[CPU0 ] compatibility mode
00119797160i[CPU0 ] CS.d_b = 32 bit
00119797160i[CPU0 ] SS.d_b = 32 bit
00119797160i[CPU0 ] EFER = 0x00000500
00119797160i[CPU0 ] | RAX=0000000080000011 RBX=0000000000000000
00119797160i[CPU0 ] | RCX=00000000c0000080 RDX=0000000000000000
00119797160i[CPU0 ] | RSP=0000000000067ed4 RBP=0000000000067ee4
00119797160i[CPU0 ] | RSI=000000000002cb3f RDI=000000000002cb40
00119797160i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00119797160i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00119797160i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00119797160i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00119797160i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00119797160i[CPU0 ] | SEG selector base limit G D
00119797160i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00119797160i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | MSR_FS_BASE:0000000000000000
00119797160i[CPU0 ] | MSR_GS_BASE:0000000000000000
00119797160i[CPU0 ] | RIP=00000000001000b8 (00000000001000b8)
00119797160i[CPU0 ] | CR0=0x80000011 CR1=0x0 CR2=0x0000000000000080
00119797160i[CPU0 ] | CR3=0x0000000000101010 CR4=0x00000020
00119797160i[CPU0 ] (instruction unavailable) page not present
I have attached my bootloader code. I suspect the page table setup I doing in loader_pae.c is wrong, but I've tried quite a few things
I am writting a small boot loader to enable long mode and jump to some 64 bit code.
However I've hit a problem when enabling paging, I am getting the following messages from bochs:
00119797160i[CPU0 ] compatibility mode
00119797160i[CPU0 ] CS.d_b = 32 bit
00119797160i[CPU0 ] SS.d_b = 32 bit
00119797160i[CPU0 ] EFER = 0x00000500
00119797160i[CPU0 ] | RAX=0000000080000011 RBX=0000000000000000
00119797160i[CPU0 ] | RCX=00000000c0000080 RDX=0000000000000000
00119797160i[CPU0 ] | RSP=0000000000067ed4 RBP=0000000000067ee4
00119797160i[CPU0 ] | RSI=000000000002cb3f RDI=000000000002cb40
00119797160i[CPU0 ] | R8=0000000000000000 R9=0000000000000000
00119797160i[CPU0 ] | R10=0000000000000000 R11=0000000000000000
00119797160i[CPU0 ] | R12=0000000000000000 R13=0000000000000000
00119797160i[CPU0 ] | R14=0000000000000000 R15=0000000000000000
00119797160i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00119797160i[CPU0 ] | SEG selector base limit G D
00119797160i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00119797160i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | FS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | GS:0010( 0002| 0| 0) 00000000 000fffff 1 1
00119797160i[CPU0 ] | MSR_FS_BASE:0000000000000000
00119797160i[CPU0 ] | MSR_GS_BASE:0000000000000000
00119797160i[CPU0 ] | RIP=00000000001000b8 (00000000001000b8)
00119797160i[CPU0 ] | CR0=0x80000011 CR1=0x0 CR2=0x0000000000000080
00119797160i[CPU0 ] | CR3=0x0000000000101010 CR4=0x00000020
00119797160i[CPU0 ] (instruction unavailable) page not present
I have attached my bootloader code. I suspect the page table setup I doing in loader_pae.c is wrong, but I've tried quite a few things