Paging: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
m (→‎Page Table: grammar)
No edit summary
Line 68:
 
== Enabling ==
Enabling paging is actually very simple. All that is needed is to load CR3 with the address of the page directory and to set the paging bit(PG) and protection (PE) bits of CR0. Note: setting the paging flag when the protection flag is clear causes a general-protection exception.
 
<source lang="asm">
Line 75:
mov eax, cr0
or eax, 0x800000000x80000001
mov cr0, eax
</source>
 
If you want to set pages as read-only for both userspace and supervisor, replace 0x800000000x80000001 above with 0x800100000x80010001, which also sets the WP bit.
 
To enable PSE (4 MiB pages) the following code is required.
Anonymous user