mm: fix page fault on process exit
This commit is contained in:
+3
-4
@@ -26,7 +26,7 @@ uint32_t setup_tmp_pgdir(uint32_t magic, uint32_t info)
|
||||
}
|
||||
|
||||
/* Address is PAGE_OFFSET plus memory size minus 4KB */
|
||||
pagedir_address = PAGE_OFFSET + (memksize * 1024) - 4096;
|
||||
pagedir_address = PAGE_OFFSET + (memksize * 1024) - memksize;
|
||||
pagedir_address = PAGE_ALIGN(pagedir_address);
|
||||
|
||||
kpage_dir = (uint32_t *)pagedir_address;
|
||||
@@ -40,9 +40,8 @@ uint32_t setup_tmp_pgdir(uint32_t magic, uint32_t info)
|
||||
page_table[n] = (n << PAGE_SHIFT) | PAGE_PRESENT | PAGE_RW;
|
||||
if(!(n % 1024)) {
|
||||
pd = n / 1024;
|
||||
uint32_t pt_phys = (uint32_t)page_table - PAGE_OFFSET + (PAGE_SIZE * pd);
|
||||
kpage_dir[pd] = pt_phys | PAGE_PRESENT | PAGE_RW;//TODO: fix, I don't think pd should have DPL3
|
||||
kpage_dir[GET_PGDIR(PAGE_OFFSET) + pd] = pt_phys | PAGE_PRESENT | PAGE_RW;//TODO: fix, I don't think pd should have DPL3
|
||||
kpage_dir[pd] = (unsigned int)(pagedir_address + (PAGE_SIZE * pd) + GDT_BASE) | PAGE_PRESENT | PAGE_RW;
|
||||
kpage_dir[GET_PGDIR(PAGE_OFFSET) + pd] = (unsigned int)(pagedir_address + (PAGE_SIZE * pd) + GDT_BASE) | PAGE_PRESENT | PAGE_RW;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user