From 63446779fe7108e5afe0c483e5e36623ac717d4d Mon Sep 17 00:00:00 2001 From: Erin Date: Mon, 5 Jun 2017 11:16:15 -0500 Subject: [PATCH] remap_kernel: Identity map the Multiboot info structure --- src/arch/x86_64/memory/paging/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/arch/x86_64/memory/paging/mod.rs b/src/arch/x86_64/memory/paging/mod.rs index ccd410a..d8a99ae 100644 --- a/src/arch/x86_64/memory/paging/mod.rs +++ b/src/arch/x86_64/memory/paging/mod.rs @@ -188,8 +188,16 @@ pub fn remap_kernel(allocator: &mut A, boot_info: &BootInformation) } } + // -- Identity map the VGA console buffer (it's only one frame long) 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 | WRITABLE, allocator); + } }); let old_table = active_table.switch(new_table);