summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/hal/paging.c
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-10-09 10:24:41 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-10-09 10:24:41 -0400
commitcc23ea5a4b38807e79aceb23e6f43e965926618f (patch)
tree90142bb44186f4dad7bbd82d3d53655b835c822b /arch/x86_64/hal/paging.c
parent434ddcd907832b1febc7d70e4faa52109c7eb3bd (diff)
downloadjove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.tar.gz
jove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.tar.bz2
jove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.zip
add basic scheduler logic. rename init rootdir indexes
Diffstat (limited to 'arch/x86_64/hal/paging.c')
-rw-r--r--arch/x86_64/hal/paging.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86_64/hal/paging.c b/arch/x86_64/hal/paging.c
index 1587c62..535d5b2 100644
--- a/arch/x86_64/hal/paging.c
+++ b/arch/x86_64/hal/paging.c
@@ -114,6 +114,18 @@ s_pagedir_get_pml1(page_t *pml4, uintptr_t vptr)
return PML_TBL(pml2, pml2i);
}
+int
+pagedir_new(jove_owned_obj_t *untyped_obj)
+{
+ jove_untyped_t *untyped = obj_deref(untyped_obj);
+ if((uintptr_t)untyped & 0xFFF) return -EALIGN;
+ if(untyped->limit != 0x1000) return -EBADSIZE;
+
+ obj_settype(untyped_obj, JOVE_OBJ_PAGEDIR);
+ memcpy(untyped, _kernel_pml4, 0x1000);
+ return 0;
+}
+
uintptr_t *pagedir_get_mapping(jove_owned_obj_t *pagedir, uintptr_t vptr)
{
page_t *pml4 = obj_deref(pagedir);
@@ -440,7 +452,7 @@ paging_pml4_init(void)
paging_pml4_switch(kernel_pml4_pptr);
{
- jove_owned_obj_t *pgdir_o = objdir_getlocal(_rootdir_obj, ROOTDIR_PAGEDIR_I);
+ jove_owned_obj_t *pgdir_o = objdir_getlocal(_rootdir_obj, INIT_ROOTDIR_PAGEDIR_I);
obj_settype(pgdir_o, JOVE_OBJ_PAGEDIR);
obj_setvalue(pgdir_o, kernel_pml4_pptr);
obj_release(pgdir_o);