Use BootInfoFrameAllocator instead of EmptyFrameAllocator

This commit is contained in:
Philipp Oppermann
2019-01-28 11:30:27 +01:00
parent 67f536d7c6
commit a56e22b6fc

View File

@@ -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!");