diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-09-04 02:19:32 -0500 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-09-04 02:19:32 -0500 |
commit | cbee8b7dde708164081fdb979e2b96740ba516a6 (patch) | |
tree | f18bcf8da431d85fb09c4f3884de85a739edc860 /crates/kernel/src/lib.rs | |
parent | c27e5ca6bf2b4040abd628ef59f8a3bc9326749c (diff) |
Enables paging.
Diffstat (limited to 'crates/kernel/src/lib.rs')
-rw-r--r-- | crates/kernel/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/kernel/src/lib.rs b/crates/kernel/src/lib.rs index c0da3bf..517ace9 100644 --- a/crates/kernel/src/lib.rs +++ b/crates/kernel/src/lib.rs @@ -3,15 +3,15 @@ use crate::arch::{sleep_forever, PAGE_SIZE, PAGE_SIZE_BITS}; use core::ptr::NonNull; -use log::{debug, info, warn}; +use log::{debug, info}; use vernos_alloc_buddy::BuddyAllocator; use vernos_alloc_physmem_free_list::FreeListAllocator; use vernos_device_tree::FlattenedDeviceTree; -use vernos_utils::dbg; #[cfg(target_os = "none")] mod panic; +pub mod alloc; pub mod arch; pub mod logger; @@ -48,7 +48,6 @@ pub unsafe extern "C" fn hart0_early_boot(device_tree: *const u8) -> ! { let mut physical_memory_region_count = 0; flattened_device_tree .for_each_memory_range::<_, PAGE_SIZE>(|addrs| { - dbg!(&addrs); let len_bytes = addrs.end - addrs.start; assert!(addrs.start.trailing_zeros() as usize >= PAGE_SIZE_BITS); assert!(len_bytes.trailing_zeros() as usize >= PAGE_SIZE_BITS); @@ -82,10 +81,11 @@ pub unsafe extern "C" fn hart0_early_boot(device_tree: *const u8) -> ! { } // Initialize the buddy allocator. - let alloc_buddy = - BuddyAllocator::<PAGE_SIZE, PAGE_SIZE_BITS, 19>::new(physical_memory_free_list) - .expect("failed to configure the buddy allocator"); - dbg!(alloc_buddy.debug_free_lists()); + let alloc_buddy = BuddyAllocator::new(physical_memory_free_list) + .expect("failed to configure the buddy allocator"); + + // Set up the allocators. + alloc::init(alloc_buddy); todo!() } |