move page map setup to arch_paging_init()

This commit is contained in:
Steffen Vogel 2013-12-03 15:52:16 +01:00
parent 443ffdf012
commit fff2708c5a
2 changed files with 3 additions and 4 deletions

View file

@ -319,10 +319,6 @@ init_paging:
mov DWORD [edi], boot_pdpt
or DWORD [edi], 0x07 ; set present, user and writable flags
add edi, (PAGE_MAP_ENTRIES-1)*8 ; setup recursive paging
mov DWORD [edi], boot_pml4 ; boot_pml4[511] -> boot_pml4
or DWORD [edi], 0x03 ; set present and writable flags
mov edi, boot_pdpt
mov DWORD [edi], boot_pgd
or DWORD [edi], 0x03 ; set present and writable flags

View file

@ -524,6 +524,9 @@ int arch_paging_init(void)
irq_uninstall_handler(14);
irq_install_handler(14, pagefault_handler);
// setup recursive paging
boot_pml4.entries[PAGE_MAP_ENTRIES-1] = (size_t) &boot_pml4 | KERN_TABLE;
/*
* In longmode the kernel is already maped into the kernel space (see entry64.asm)
* this includes .data, .bss, .text, VGA, the multiboot & multiprocessing (APIC) structures