VMM: Add a few memsets

This seems to fix exec() making weird page tables!!
This commit is contained in:
apio 2022-10-19 07:56:08 +02:00
parent 671f2a2de3
commit 755242719c
2 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ AddressSpace AddressSpace::create()
{ {
AddressSpace result; AddressSpace result;
result.m_pml4 = (PageTable*)PMM::request_page(); result.m_pml4 = (PageTable*)PMM::request_page();
memset(result.m_pml4, 0, PAGE_SIZE);
VMM::install_kernel_page_directory_into_address_space(result); VMM::install_kernel_page_directory_into_address_space(result);
return move(result); return move(result);
} }

View File

@ -281,7 +281,8 @@ void VMM::install_kernel_page_directory_into_address_space(AddressSpace& space)
if (!space_last_pdp_pde.present) if (!space_last_pdp_pde.present)
{ {
space_last_pdp = (PageTable*)PMM::request_page(); space_last_pdp = (PageTable*)PMM::request_page(); // FIXME: Add out-of-memory checks.
memset(space_last_pdp, 0, PAGE_SIZE);
space_last_pdp_pde.present = true; space_last_pdp_pde.present = true;
space_last_pdp_pde.read_write = true; space_last_pdp_pde.read_write = true;