Paging: Difference between revisions

m
[unchecked revision][unchecked revision]
(Added section for 64-bit paging)
Line 180:
 
== Page Faults ==
A [[Exceptions#Page_Fault|page fault]] exception is caused when a process is seeking to access an area of virtual memory that is not mapped to any physical memory, when a write is attempted on a read-only page, when accessing a PTE or PDE with the reserved bit or when permissions are inadequate. A [[Exceptions#Page_Fault|page fault]] can either be pure, which occurs when the faulting process has permission to access the page, or invalid, which is due to a protection violation. Pure [[Exceptions#Page_Fault|page faults]] aren't errors, but are resolved through the page fault handler by performing the appropriate map operation and/or page swap.
 
=== Handling ===
The CPU pushes an error code on the stack before firing a [[Exceptions#Page_Fault|page fault exception]]. The error code must be analyzed by the exception handler to determine how to handle the exception. The following bits are the only ones used, all others are reserved.
Bit 0 (P) is the Present flag.
Bit 1 (R/W) is the Read/Write flag.
Anonymous user