Skip to main content

Module paging

Module paging 

Source
Expand description

Virtual Memory Management (Paging) for Strat9-OS

Uses the x86_64 crate’s OffsetPageTable which is designed for the HHDM (Higher Half Direct Map) pattern : exactly what Limine provides.

Provides map/unmap/translate operations on the active page table.

Structs§

BuddyFrameAllocator
Wrapper around the buddy allocator implementing the x86_64 crate’s FrameAllocator trait.

Functions§

active_page_table
Read the current CR3 value (physical address of the active level-4 page table).
ensure_identity_map
Ensure a physical address is identity-mapped in the HHDM region.
ensure_identity_map_range
Ensure a physical range is mapped in the HHDM region.
init
Initialize the paging subsystem.
is_hhdm_range_mapped_now
Returns whether the current page tables map the HHDM view of the whole range.
is_initialized
Returns whether initialized.
kernel_l4_phys
Return the physical address of the kernel’s level-4 page table.
map_all_ram
Map all RAM regions from the memory map into the HHDM.
map_page
Map a virtual page to a physical frame with the given flags.
map_page_kernel
Map a page into the kernel’s canonical page tables (not the active CR3).
translate
Translate a virtual address to its mapped physical address.
unmap_page
Unmap a page from the active CR3, returning the physical frame.
unmap_page_kernel
Unmap a page from the kernel’s canonical page tables.