From 96d9de76b084eafa21fc82ffa40ae7afd70c923a Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 15 Sep 2019 10:47:47 +0200 Subject: [PATCH] Fix: memory::init expects a VirtAddr --- tests/heap_allocation.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/heap_allocation.rs b/tests/heap_allocation.rs index c803ba77..a8a4b8f4 100644 --- a/tests/heap_allocation.rs +++ b/tests/heap_allocation.rs @@ -16,9 +16,11 @@ entry_point!(main); fn main(boot_info: &'static BootInfo) -> ! { use blog_os::allocator; use blog_os::memory::{self, BootInfoFrameAllocator}; + use x86_64::VirtAddr; blog_os::init(); - let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) }; + let phys_mem_offset = VirtAddr::new(boot_info.physical_memory_offset); + let mut mapper = unsafe { memory::init(phys_mem_offset) }; let mut frame_allocator = unsafe { BootInfoFrameAllocator::init(&boot_info.memory_map) }; allocator::init_heap(&mut mapper, &mut frame_allocator).expect("heap initialization failed");