A 32-bit Linear address is divided as follows:
Physical address is then computed (in hardware) as:
Page directories (page tables) are page aligned so the lower 12 bits
are used to store useful information about the page table (page) pointed
to by the entry.
Format for Page directory and Page table entries:
The corresponding definitions for Linux are in <#2175#> ;SPM_lt;linux/mm.h;SPM_gt;<#2175#>.
When a page is swapped, bits 1--31 of the page table entry are used to
mark where a page is stored in swap (bit 0 must be 0).
Paging is enabled by setting the highest bit in CR0. <#2176#> [in
head.S?]<#2176#> At each stage of the address translation access permissions
are verified and pages not present in memory and protection violations
result in page faults. The fault handler (in memory.c) then either
brings in a new page or write-enables a page or does whatever needs
to be done.