mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Use BootInfoFrameAllocator to create a 0xdeadbeaf000 mapping
This commit is contained in:
@@ -22,10 +22,10 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
|
||||
x86_64::instructions::interrupts::enable();
|
||||
|
||||
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
|
||||
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);
|
||||
|
||||
// write the string `New!` to the screen through the new mapping
|
||||
|
||||
Reference in New Issue
Block a user