mm: fix copy_page_dir

This commit is contained in:
2025-07-07 20:37:48 +03:00
parent e793e45854
commit 7f861a8b92
+1 -6
View File
@@ -241,16 +241,11 @@ uint32_t* copy_page_dir(uint32_t* page_dir_virt)
map_page(orig_phys_page, scratch_src, PAGE_PRESENT | PAGE_RW); map_page(orig_phys_page, scratch_src, PAGE_PRESENT | PAGE_RW);
map_page(new_phys_page, scratch_dst, PAGE_PRESENT | PAGE_RW); map_page(new_phys_page, scratch_dst, PAGE_PRESENT | PAGE_RW);
//debug_log("copying %X to %X...", orig_phys_page, new_phys_page);
//memcpy(new_phys_page, orig_phys_page, PAGE_SIZE);
//memcpy(new_virt_page, orig_virt_page, PAGE_SIZE);
memcpy(scratch_dst, scratch_src, PAGE_SIZE); memcpy(scratch_dst, scratch_src, PAGE_SIZE);
unmap_page(scratch_dst); unmap_page(scratch_dst);
unmap_page(scratch_src); unmap_page(scratch_src);
//debug_log("done\n");
new_page_table_virt[j] = (uint32_t)new_phys_page | (pte & 0xFFF); new_page_table_virt[j] = (uint32_t)new_phys_page | (pte & 0xFFF);
} }
else else
@@ -261,7 +256,7 @@ uint32_t* copy_page_dir(uint32_t* page_dir_virt)
// Set the new PDE in the child's page directory // Set the new PDE in the child's page directory
new_pagedir[i] = (uint32_t)virt_to_phys(new_page_table) | (pde & 0xFFF); new_pagedir[i] = (uint32_t)new_page_table | (pde & 0xFFF);
} }
else else
{ {