Message board for the users of flat assembler.
> OS Construction > PAE question
I have some problem with setting PAE.
As I see it these steps should do the work in case my code is in the first MB:
Create PDE (one 2Mb page with 1:1 mapping)
Set control registers W/O cr0
Set CR0 with paging bit
Here is something that resembles my code
; Here I start in PM with a basic flat model mov edi, PDPE_BASE mov cr3, edi mov eax, cr4 or eax, PAE_BIT mov cr4, eax mov eax, APP_PDE mov ebx, eax shr eax, 20 shl ebx, 12 or ebx, P_BIT stosd mov eax, ebx stosd mov ecx, 6 xor eax, eax rep stosd mov edi, APP_PDE xor eax, eax or eax, P_BIT + PS_BIT stosd xor eax, eax stosd mov ecx, 511*2 xor eax, eax rep stosd mov eax, cr0 or eax, PAGING_BIT mov cr0, eax ; Do something
While "Do something" could probably be a far jump
or anything else that executes with paging mechanism
running (thats why 1:1 mapping), but anyway, with
this code it never reached.
Once paging bit is set everything goes to hell and crashes...
I do realize that I can set all those pages from RM,
and only then enable paging, without the need of 1:1
mapping, because paging wouldn't be really enabled untill
some far jump.
However, this should work also. Doesn't it?
|19 Sep 2006, 21:50||
Problem solved (all PDPEs have to be peresent), topic closed...
|20 Sep 2006, 13:27||
That particular problem seems to be Bochs related...
Intel,Page118: The present flag (bit 0) in the page-directory-pointer-table entries can be set to 0 or 1.
If the present flag is clear, the remaining bits in the PDPTE entry are available to the operating system.
|27 Sep 2006, 15:15||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.