⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

handle_page_fault

Function handle_page_fault 

Source
pub fn handle_page_fault(info: PageFaultInfo) -> Result<(), KernelError>
Expand description

Main page fault handler.

Dispatches the fault to the appropriate sub-handler:

  1. Demand paging – the address is within a valid VAS mapping but the physical page has not been allocated yet.
  2. Copy-on-Write – the page is marked read-only for CoW; allocate a private copy and remap as writable.
  3. Stack growth – the faulting address is just below the current stack mapping; extend the stack downward.
  4. If none of the above apply, deliver SIGSEGV / return an error.