feat: major memory managment & PMactor
This commit is contained in:
@@ -1,16 +1,34 @@
|
||||
pub mod pmm;
|
||||
pub mod address;
|
||||
pub mod paging;
|
||||
pub mod allocator;
|
||||
//! `src/mem/mod.rs` — memory subsystem root
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn init(memmap: &limine::response::MemoryMapResponse, hhdm_offset: u64) {
|
||||
unsafe {
|
||||
pmm::BitmapPMM::init(memmap, hhdm_offset);
|
||||
}
|
||||
pub mod address;
|
||||
pub mod allocator;
|
||||
pub mod buddy; // ← new: per-actor buddy allocator
|
||||
pub mod paging;
|
||||
pub mod pm_manages;
|
||||
pub mod pmm;
|
||||
pub mod vmm;
|
||||
|
||||
/// Initialise the physical memory manager.
|
||||
///
|
||||
/// Must be called before any heap allocation or VMM operation.
|
||||
pub fn init_pmm(memmap: &limine::response::MemoryMapResponse, hhdm_offset: u64) {
|
||||
unsafe { pmm::BitmapPMM::init(memmap, hhdm_offset); }
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
/// Initialise CPU features required by the VMM (INVPCID detection).
|
||||
///
|
||||
/// Must be called before `init_vmm` and any `AddressSpace::activate()`.
|
||||
pub fn init_cpu_features() {
|
||||
vmm::init_cpu_features();
|
||||
}
|
||||
|
||||
/// Initialise the kernel address space record (after PMM, heap, and the
|
||||
/// initial P4 page table have been set up in `kmain`).
|
||||
pub fn init_vmm(pml4_phys: address::PhysAddr, hhdm_offset: u64) {
|
||||
vmm::init_kernel_space(pml4_phys, hhdm_offset);
|
||||
}
|
||||
|
||||
/// Physical memory statistics: `(used_pages, total_pages)`.
|
||||
pub fn get_stats() -> (usize, usize) {
|
||||
pmm::get_stats()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user