From 94e2b7c35114b37ab0a3c6503863a71c0b04c3c9 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 15 Sep 2019 10:48:52 +0200 Subject: [PATCH] Fix heap allocation test: memory::init expects a VirtAddr now --- blog/content/second-edition/posts/10-heap-allocation/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blog/content/second-edition/posts/10-heap-allocation/index.md b/blog/content/second-edition/posts/10-heap-allocation/index.md index cfebc7ae..924642eb 100644 --- a/blog/content/second-edition/posts/10-heap-allocation/index.md +++ b/blog/content/second-edition/posts/10-heap-allocation/index.md @@ -678,9 +678,11 @@ The implementation of the `main` function looks like this: 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) };