Setting Up Paging With PAE: Difference between revisions

Jump to navigation Jump to search
no edit summary
[unchecked revision][unchecked revision]
No edit summary
No edit summary
Line 52:
PAE-Paging should now be enabled.
 
===Mapping the PD to itself===
In Legacy-Paging this is quite easy. Just map the PD to the last entry of itself.
In PAE-Paging we have 4 entries and the PDPT, so how does it work?
Depending on where you want to set it you just map all 4 directories into one of those!
Example (PD's at end of virtual memory)
<pre>
uint64_t * page_dir = (uint64_t*)page_dir_ptr_tab[3]; // get the page table (you should 'and' the flags away)
page_dir[511] = (uint64_t)page_dir; // map pd to itself
page_dir[510] = page_dir_ptr_tab[2]; // map pd3 to it
page_dir[509] = page_dir_ptr_tab[1]; // map pd2 to it
page_dir[508] = page_dir_ptr_tab[0]; // map pd1 to it
page_dir[507] = (uint64_t)&page_dir_ptr_tab; /* map the PDPT to the directory
</pre>
Now you can access all structures in virtual memory. Mapping the PDPT into the directory wastes quite much virtual memory as only 64bytes are used, but if you allocate most/all PDPT's into one page then you can access ALL of them, which can be quite useful.
[[Category:X86 CPU]]
[[Category:Tutorials]]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu