WIP: Add fork() #13

Closed
apio wants to merge 8 commits from fork into main
2 changed files with 11 additions and 6 deletions
Showing only changes of commit 08eb18307b - Show all commits

View File

@ -142,6 +142,5 @@ AddressSpace AddressSpace::clone() // FIXME: Add out-of-memory checks to this fu
}
}
}
VMM::install_kernel_page_directory_into_address_space(result);
return result;
}

View File

@ -275,13 +275,19 @@ void VMM::install_kernel_page_directory_into_address_space(AddressSpace& space)
PageTable* kernel_last_pdp = (PageTable*)kernel_pml4->entries[511].get_address();
PageTable* kernel_last_pd = (PageTable*)kernel_last_pdp->entries[511].get_address();
PageTable* space_last_pdp = (PageTable*)PMM::request_page();
PageDirectoryEntry& space_last_pdp_pde = space_pml4->entries[511];
space_last_pdp_pde.present = true;
space_last_pdp_pde.read_write = true;
space_last_pdp_pde.set_address((uint64_t)space_last_pdp);
PageTable* space_last_pdp;
if (!space_last_pdp_pde.present)
{
space_last_pdp = (PageTable*)PMM::request_page();
space_last_pdp_pde.present = true;
space_last_pdp_pde.read_write = true;
space_last_pdp_pde.set_address((uint64_t)space_last_pdp);
}
else { space_last_pdp = (PageTable*)space_last_pdp_pde.get_address(); }
PageDirectoryEntry& space_last_pd_pde = space_last_pdp->entries[511];