From 08dd1852b6dddd5ee2bb8c1e553c55adbb31b96c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 4 Mar 2011 21:34:04 +0100 Subject: [PATCH] create all page tables for the kernel space --- arch/x86/mm/page.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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.