Unmap the old P4 page to create a basic guard page for the kernel stack

This commit is contained in:
Philipp Oppermann
2015-12-31 18:25:13 +01:00
parent e2b99ac8c1
commit db928db0b5

View File

@@ -223,4 +223,8 @@ pub fn remap_the_kernel<A>(allocator: &mut A, boot_info: &BootInformation)
let old_table = active_table.switch(new_table); let old_table = active_table.switch(new_table);
println!("NEW TABLE!!!"); println!("NEW TABLE!!!");
let old_p4_page = Page::containing_address(old_table.p4_frame.start_address());
active_table.unmap(old_p4_page, allocator);
println!("guard page at {:#x}", old_p4_page.start_address());
} }