From a56e22b6fc51c5f39d7467833dc166615b628be2 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 28 Jan 2019 11:30:27 +0100 Subject: [PATCH] Use BootInfoFrameAllocator instead of EmptyFrameAllocator --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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!");