feat: add pmm, add vmm, add allocator, create memory management foundation
This commit is contained in:
19
kernel/src/mem/mod.rs
Normal file
19
kernel/src/mem/mod.rs
Normal 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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user