create all page tables for the kernel space
This commit is contained in:
parent
08b0207dc9
commit
08dd1852b6
1 changed files with 11 additions and 1 deletions
|
@ -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; i<KERNEL_SPACE/(1024*PAGE_SIZE)-1; i++) {
|
||||
size_t phyaddr = get_page();
|
||||
|
||||
if (!phyaddr)
|
||||
continue;
|
||||
memset((void*) phyaddr, 0, PAGE_SIZE);
|
||||
pgt->entries[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.
|
||||
|
|
Loading…
Add table
Reference in a new issue