diff --git a/src/main.rs b/src/main.rs index d7edbde3..a6493875 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ entry_point!(kernel_main); #[cfg(not(test))] fn kernel_main(boot_info: &'static BootInfo) -> ! { use blog_os::interrupts::PICS; - use blog_os::memory::{self, create_example_mapping, EmptyFrameAllocator}; + use blog_os::memory::{self, create_example_mapping}; println!("Hello World{}", "!"); @@ -21,8 +21,9 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! { x86_64::instructions::interrupts::enable(); let mut recursive_page_table = unsafe { memory::init(boot_info.p4_table_addr as usize) }; + let mut frame_allocator = memory::init_frame_allocator(&boot_info.memory_map); - create_example_mapping(&mut recursive_page_table, &mut EmptyFrameAllocator); + create_example_mapping(&mut recursive_page_table, &mut frame_allocator); unsafe { (0xdeadbeaf900 as *mut u64).write_volatile(0xf021f077f065f04e) }; println!("It did not crash!");