Page Fault

From OSDev Wiki
Jump to: navigation, search

A page fault occurs when interrupt 14 (0x0E) fires. After you've installed the ISRs, you can use the exception error code to determine what went wrong:

31                4                             0
+-----+-...-+-----+-----+-----+-----+-----+-----+
|     Reserved    | I/D | RSVD| U/S | W/R |  P  |
+-----+-...-+-----+-----+-----+-----+-----+-----+
  • P: When set, the fault was caused by a protection violation.
    When not set, it was caused by a non-present page.
  • W/R: When set, write access caused the fault; otherwise read access.
  • U/S: When set, the fault occurred in user mode; otherwise in supervisor mode.
  • RSVD: When set, one or more page directory entries contain reserved bits which are set to 1.
    This only applies when the PSE or PAE flags in CR4 are set to 1.
  • I/D: When set, the fault was caused by an instruction fetch.
    This only applies when the No-Execute bit is supported and enabled.

The CR2 register contains the 32-bit linear address that caused the fault.

Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox