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§
- Memory
Region - Memory region from bootloader/firmware
- Memory
Stats - Memory statistics structure
- Page
Flags - Page flags
- Virtual
Address - Virtual memory address
Enums§
- Page
Size - 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§
- Page
Permissions - Placeholder types for IPC integration
- Physical
Page