Paging: Difference between revisions

152 bytes removed ,  15 years ago
m
Reverted edits by Uzytkownik (Talk); changed back to last version by Tantrikwizard
[unchecked revision][unchecked revision]
(Change the or instruction to explicit bts)
m (Reverted edits by Uzytkownik (Talk); changed back to last version by Tantrikwizard)
Line 22:
The page table address field represents the physical address of the page table that managers the four megabytes at that point. Please note that it is very important that this address be 4 KiB aligned. This is needed, due to the fact that the last bits of the dword are overwritten by access bits and such.
 
* S, or 'Page '''S'''ize' stores the page size for that specific entry. If the bit is set, then pages are 4 MiB in size. Otherwise, they are 4 KiB. Please note that for 4 MiB pages PSE have to be enabled.
* A, or ''''A'''ccessed' is used to discover whether a page has been read or written to. If it has, then the bit is set, otherwise, it is not. Note that, this bit will not be cleared by the CPU, so that burden falls on the OS (if it needs this bit at all).
* D, is the 'Cache '''D'''isable' bit. If the bit is set, the page will not be cached. Otherwise, it will be.
Line 69:
mov eax, cr0
btsor eax, 310x80000000
mov cr0, eax
 
To enable PSE (4 MiB pages) the following code is required.
 
mov eax, cr4
bts eax, 4
mov cr4, eax
 
==Usage==
1,490

edits