diff --git a/arch/x86/mm/page.c b/arch/x86/mm/page.c index 4548d2d7..68c9e6b7 100644 --- a/arch/x86/mm/page.c +++ b/arch/x86/mm/page.c @@ -556,7 +556,7 @@ int arch_paging_init(void) irq_install_handler(14, pagefault_handler); // Create a page table to reference to the other page tables - pgt = (page_table_t*) get_pages(1); + pgt = (page_table_t*) get_page(); if (!pgt) { kputs("arch_paging_init: Not enough memory!\n"); return -ENOMEM; @@ -572,6 +572,16 @@ int arch_paging_init(void) per_core(current_task)->pgd->entries[index1] = (((size_t) pgt) & 0xFFFFF000)|KERN_TABLE; pgt->entries[index2] = ((size_t) pgt & 0xFFFFF000)|KERN_PAGE; + // create the other PGTs for the kernel space + for(i=0; ientries[i] = (phyaddr & 0xFFFFF000)|KERN_PAGE; + } + /* * Set the page table and page directory entries for the kernel. We map the kernel's physical address * to the same virtual address.