feat: add pmm, add vmm, add allocator, create memory management foundation

This commit is contained in:
Faynot
2026-03-29 19:07:41 +03:00
parent 83117c0a65
commit 7860db3814
9 changed files with 578 additions and 66 deletions

19
kernel/src/mem/mod.rs Normal file
View File

@@ -0,0 +1,19 @@
pub mod pmm;
pub mod address;
pub mod paging;
pub mod allocator;
#[allow(dead_code)]
pub fn init(memmap: &limine::response::MemoryMapResponse, hhdm_offset: u64) {
unsafe {
pmm::BitmapPMM::init(memmap, hhdm_offset);
}
}
#[allow(dead_code)]
pub fn get_stats() -> (usize, usize) {
unsafe {
let pmm = pmm::get_pmm_unchecked();
(pmm.used_pages(), pmm.total_pages())
}
}