mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 13:48:21 +00:00
kernel: initial vmm implementation
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <kernel/term.h>
|
||||
#include <kernel/pmm.h>
|
||||
#include <arch/mmu.h>
|
||||
#include <kernel/vmm.h>
|
||||
|
||||
static cpu_t bsp_cpu;
|
||||
|
||||
@@ -19,5 +20,6 @@ void kernel_entry() {
|
||||
term_init();
|
||||
logging_sethook(term_putchar);
|
||||
arch_mmu_init();
|
||||
vmm_init();
|
||||
__assert(!"kernel entry end");
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ static bool add_page(pagetableptr_t top, void *vaddr, uint64_t entry, int depth)
|
||||
pdpt = pmm_alloc(1, PMM_SECTION_DEFAULT);
|
||||
if (pdpt == NULL)
|
||||
return false;
|
||||
pml4[pml4offset] = (uint64_t)FROM_HHDM(pdpt) | INTERMEDIATE_FLAGS;
|
||||
pml4[pml4offset] = (uint64_t)pdpt | INTERMEDIATE_FLAGS;
|
||||
pdpt = MAKE_HHDM(pdpt);
|
||||
memset(pdpt, 0, PAGE_SIZE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user