Use PHYS_OFFSET instead of KERNEL_OFFSET to refer to the physmap

This commit is contained in:
Jeremy Soller
2021-04-13 20:38:54 -06:00
parent afca4da382
commit f90033e0e1
8 changed files with 29 additions and 14 deletions
+9
View File
@@ -369,6 +369,15 @@ pub fn clone(flags: CloneFlags, stack_base: usize) -> Result<ContextId> {
});
}
// Copy physmap mapping
{
let frame = active_table.p4()[crate::PHYS_PML4].pointed_frame().expect("physmap not mapped");
let flags = active_table.p4()[crate::PHYS_PML4].flags();
active_table.with(&mut new_table, &mut temporary_page, |mapper| {
mapper.p4_mut()[crate::PHYS_PML4].set(frame, flags);
});
}
if let Some(fx) = kfx_opt.take() {
context.arch.set_fx(fx.as_ptr() as usize);
context.kfx = Some(fx);