mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
FrameAllocator is an unsafe trait now
Make `BootInfoFrameAllocator` unsafe because the caller must guarantee that the given memory map is valid.
This commit is contained in:
@@ -18,7 +18,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
|
||||
blog_os::init();
|
||||
|
||||
let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) };
|
||||
let mut frame_allocator = BootInfoFrameAllocator::init(&boot_info.memory_map);
|
||||
let mut frame_allocator = unsafe { BootInfoFrameAllocator::init(&boot_info.memory_map) };
|
||||
|
||||
// map a previously unmapped page
|
||||
let page = Page::containing_address(VirtAddr::new(0xdeadbeaf000));
|
||||
|
||||
Reference in New Issue
Block a user