Info tab shows strange pages with PAE
Posted: Sun Feb 27, 2011 9:59 am
Anyone has any idea of why the following basic PAE code:
which basically identity maps the first 2 Mb using PAE paging and then setups CR0/3/4 to enable PAE, produces the following output on the bochs debugger?
Edit: I cut out much of the ouput...
Code: Select all
; Multiboot Header Definitions
; We want modules to be page-aligned and memory informations in the info block
MB_MAGIC EQU 0x1BADB002
MB_MODALIGN EQU 1 << 0
MB_MEMINFO EQU 1 << 1
MB_FLAGS EQU (MB_MEMINFO | MB_MODALIGN)
MB_CHECKSUM EQU -(MB_MAGIC + MB_FLAGS)
[BITS 32]
[SECTION .header]
mbhdr:
dd MB_MAGIC
dd MB_FLAGS
dd MB_CHECKSUM
[SECTION .text]
[GLOBAL _loader]
; Do not use the stack until Paged is called.
; Preserve the content of ebx, which contains a pointer to grub informations
; We have to load a gdt asap, as grub will not give us a valid one.
_loader:
mov eax, gdtr
lgdt [eax]
jmp 0x08:postGdt
postGdt:
; Load segment registers
mov eax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, Pd
or eax, 1
mov edi, Pdpt
mov [edi], eax
mov edi, Pd
mov [edi], DWORD 0x83
; Load page directory in cr3
mov eax, Pdpt
mov cr3, eax
; Enable PAE
mov eax, cr4
or eax, 0x00000030
mov cr4, eax
; Enable paging
mov eax, cr0
or eax, 0xC0000000
mov cr0, eax
jmp $
[SECTION .data]
ALIGN 4096
Pdpt:
times (0x1000) DB 0
ALIGN 4096
Pd:
times (0x1000) DB 0
; Temporary GDT set at boot
gdt:
dd 0, 0
code:
dw 0xFFFF
dw 0x0000
db 0x00
db 0x9A
db 0xCF
db 0x00
data:
dw 0xFFFF
dw 0x0000
db 0x00
db 0x92
db 0xCF
db 0x00
gdtr:
DW 0x17
DD gdt
Code: Select all
info tab
cr3: 0x0000000000101000
0x00000000-0x001fffff -> 0x0000000000000000-0x00000000001fffff <-- The only correct one...
0x54a20000-0x54a20fff -> 0x0000003df000e000-0x0000003df000efff
0x54a3c000-0x54a3cfff -> 0x00000000f000f000-0x00000000f000ffff
0x54a8c000-0x54a8cfff -> 0x00000003d4000000-0x00000003d4000fff
0x54a91000-0x54a91fff -> 0x0000000000085000-0x0000000000085fff
0x54a95000-0x54a95fff -> 0x00000000c0003000-0x00000000c0003fff
0x54aa5000-0x54aa5fff -> 0x0000000000000000-0x0000000000000fff
0x54aa8000-0x54aa8fff -> 0x0000000000000000-0x0000000000000fff
0x54aab000-0x54aabfff -> 0x0000000000000000-0x0000000000000fff
0x54aae000-0x54aaefff -> 0x0000000000000000-0x0000000000000fff
0x54ab1000-0x54ab1fff -> 0x0000000000000000-0x0000000000000fff
0x54ae5000-0x54ae5fff -> 0x0000000007cbf000-0x0000000007cbffff
0x54aea000-0x54aeafff -> 0x0000000000000000-0x0000000000000fff
[...]
0x5d4b1000-0x5d4b1fff -> 0x0000000000000000-0x0000000000000fff
0x5d4e5000-0x5d4e5fff -> 0x0000000007cbf000-0x0000000007cbffff
0x5d4ea000-0x5d4eafff -> 0x0000000000000000-0x0000000000000fff
0x94a20000-0x94a20fff -> 0x0000003df000e000-0x0000003df000efff
0x94a3c000-0x94a3cfff -> 0x00000000f000f000-0x00000000f000ffff
0x94a8c000-0x94a8cfff -> 0x00000003d4000000-0x00000003d4000fff
0x94a91000-0x94a91fff -> 0x0000000000085000-0x0000000000085fff
0x94a95000-0x94a95fff -> 0x00000000c0003000-0x00000000c0003fff
0x94aa5000-0x94aa5fff -> 0x0000000000000000-0x0000000000000fff
0x94aa8000-0x94aa8fff -> 0x0000000000000000-0x0000000000000fff
0x94aab000-0x94aabfff -> 0x0000000000000000-0x0000000000000fff
0x94aae000-0x94aaefff -> 0x0000000000000000-0x0000000000000fff
0x94ab1000-0x94ab1fff -> 0x0000000000000000-0x0000000000000fff
0x94ae5000-0x94ae5fff -> 0x0000000007cbf000-0x0000000007cbffff
[...]
0x9d4b1000-0x9d4b1fff -> 0x0000000000000000-0x0000000000000fff
0x9d4e5000-0x9d4e5fff -> 0x0000000007cbf000-0x0000000007cbffff
0x9d4ea000-0x9d4eafff -> 0x0000000000000000-0x0000000000000fff
0xd4a20000-0xd4a20fff -> 0x0000003df000e000-0x0000003df000efff
0xd4a3c000-0xd4a3cfff -> 0x00000000f000f000-0x00000000f000ffff
0xd4a8c000-0xd4a8cfff -> 0x00000003d4000000-0x00000003d4000fff
0xd4a91000-0xd4a91fff -> 0x0000000000085000-0x0000000000085fff
0xd4a95000-0xd4a95fff -> 0x00000000c0003000-0x00000000c0003fff
0xd4aa5000-0xd4aa5fff -> 0x0000000000000000-0x0000000000000fff
0xd4aa8000-0xd4aa8fff -> 0x0000000000000000-0x0000000000000fff
0xd4aab000-0xd4aabfff -> 0x0000000000000000-0x0000000000000fff
[...]
0xdd4e5000-0xdd4e5fff -> 0x0000000007cbf000-0x0000000007cbffff
0xdd4ea000-0xdd4eafff -> 0x0000000000000000-0x0000000000000fff