Create and load new page directories

This commit is contained in:
thomas committed 2018-03-29 19:36:32 +02:00
1 parent d483d8f39e
commit 2d0f539e23
6 files changed
+22 -1

No files matched your search

+7
View File
@@ -14,6 +14,13 @@
#define P2E PT(P3E)[P2_OFFSET(addr)]
#define P1E PT(P2E)[P1_OFFSET(addr)]
uint64_t new_P4()
{
uint64_t p4 = pmm_alloc();
memcpy(P2V(p4), (void *)kernel_P4, PAGE_SIZE);
return p4;
}
static int page_exists(uint64_t P4, uint64_t addr)
{
if(P4 && PRESENT(P4E) && PRESENT(P3E) && PRESENT(P2E))
+7 -1
View File
@@ -3,7 +3,13 @@
#include <memory.h>
#undef P2V
#define P2V(p) (p)
#define P2V(p) ((void *)(p))
uint64_t kernel_P4;
uint64_t pmm_alloc()
{
return 0;
}
#include "vmm.c"