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

Module demand_paging

Module demand_paging 

Source
Expand description

Demand Paging and Copy-on-Write (COW) Manager

Provides infrastructure for lazy page allocation and COW fork support.

§Demand Paging

Pages can be registered as “lazy” mappings via register_lazy. When a page fault hits a lazy-mapped address, the manager allocates a physical frame and returns it (along with the appropriate flags) so the caller can install the mapping in the page table.

§Copy-on-Write

CowTable tracks shared physical frames with reference counts. When a COW page is written, the fault handler calls DemandPagingManager::handle_cow_fault to allocate a private copy and decrement the shared reference count.

Structs§

CowEntry
A single COW-shared physical frame.
CowTable
Table of COW-shared frames keyed by virtual page address.
DemandPagingManager
Manages lazy mappings and COW state.
LazyMapping
A region of virtual address space registered for demand paging.

Enums§

BackingType
How a lazy page is backed when finally faulted in.

Functions§

handle_page_fault
Try to resolve a page fault via demand paging.
init
Initialize the global demand paging manager.
register_lazy
Register a lazy mapping via the global manager.
with_manager_mut
Access the global demand paging manager (mutable).