summaryrefslogtreecommitdiff
path: root/crates/kernel/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/kernel/src/lib.rs')
-rw-r--r--crates/kernel/src/lib.rs14
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!()
}