Use BootInfoFrameAllocator to create a 0xdeadbeaf000 mapping

This commit is contained in:
Philipp Oppermann
2019-03-13 14:42:47 +01:00
parent a1bf5651fc
commit 9bf4ea7341

View File

@@ -22,10 +22,10 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
x86_64::instructions::interrupts::enable(); x86_64::instructions::interrupts::enable();
let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) }; let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) };
let mut frame_allocator = memory::EmptyFrameAllocator; let mut frame_allocator = memory::init_frame_allocator(&boot_info.memory_map);
// map a previously unmapped page // map a previously unmapped page
let page = Page::containing_address(VirtAddr::new(0x1000)); let page = Page::containing_address(VirtAddr::new(0xdeadbeaf000));
memory::create_example_mapping(page, &mut mapper, &mut frame_allocator); memory::create_example_mapping(page, &mut mapper, &mut frame_allocator);
// write the string `New!` to the screen through the new mapping // write the string `New!` to the screen through the new mapping