From 11993b7e1547d1db489f384664df04329f546db5 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2017 12:28:59 +0200 Subject: [PATCH] Also identity map the multiboot info structure --- src/memory/paging/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/memory/paging/mod.rs b/src/memory/paging/mod.rs index fd97a4c..1aa8b08 100644 --- a/src/memory/paging/mod.rs +++ b/src/memory/paging/mod.rs @@ -185,6 +185,13 @@ pub fn remap_the_kernel(allocator: &mut A, boot_info: &BootInformation) // identity map the VGA text buffer let vga_buffer_frame = Frame::containing_address(0xb8000); mapper.identity_map(vga_buffer_frame, WRITABLE, allocator); + + // identity map the multiboot info structure + let multiboot_start = Frame::containing_address(boot_info.start_address()); + let multiboot_end = Frame::containing_address(boot_info.end_address() - 1); + for frame in Frame::range_inclusive(multiboot_start, multiboot_end) { + mapper.identity_map(frame, PRESENT, allocator); + } }); let old_table = active_table.switch(new_table);