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

Module mm

Module mm 

Source
Expand description

Memory management subsystem

This module handles physical and virtual memory management, including page tables, allocators, and memory protection.

Re-exports§

pub use frame_allocator::FrameAllocatorError;
pub use frame_allocator::FrameNumber;
pub use frame_allocator::PhysicalAddress;
pub use frame_allocator::PhysicalFrame;
pub use frame_allocator::FRAME_SIZE;
pub use heap::init as init_heap;
pub use user_validation::is_user_addr_valid;
pub use user_validation::translate_address as translate_user_address;
pub use vas::VirtualAddressSpace;

Modules§

bootloader
Bootloader memory map integration
cache_aligned
Cache Line Alignment Utilities
cache_topology
Cache topology detection and cache-aware memory allocation
demand_paging
Demand Paging and Copy-on-Write (COW) Manager
frame_allocator
Physical frame allocator for VeridianOS
heap
Kernel heap allocator
ksm
Kernel Same-page Merging (KSM)
page_fault
Page Fault Handler Framework
page_table
Page table management for virtual memory
user_validation
User space memory validation utilities
vas
Virtual Address Space management
vmm
Virtual Memory Manager

Structs§

MemoryRegion
Memory region from bootloader/firmware
MemoryStats
Memory statistics structure
PageFlags
Page flags
VirtualAddress
Virtual memory address

Enums§

PageSize
Page size options

Constants§

PAGE_SIZE
Page size constant (4KB)

Functions§

allocate_pages
Allocate physical pages
free_frame
Free a physical frame
free_pages
Free physical pages
get_kernel_page_table
Get kernel page table base address
get_memory_stats
Get memory statistics
init
Initialize the memory management subsystem
init_default
Initialize with default memory map for testing
page_cache_add
Increment the page cache frame count when a page is added to the cache.
page_cache_remove
Decrement the page cache frame count when a page is evicted from the cache.
phys_to_virt_addr
Convert a physical address to a virtual pointer.
reserve_boot_page_table_frames
Walk the boot page tables (CR3) and mark all intermediate table frames as reserved in the frame allocator. This prevents the allocator from handing out frames that the bootloader used for page tables, which would corrupt kernel address space mappings when those frames are overwritten.
set_phys_mem_offset
Set the physical memory offset (called once during early boot).
translate_address
Translate virtual address to physical address

Type Aliases§

PagePermissions
Placeholder types for IPC integration
PhysicalPage