summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-10-04 10:49:41 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-10-04 10:49:41 -0400
commit8d48bbd9746228b63bafa5f92b621998d7d8f3d3 (patch)
treefbaba69059c2e28d5098da4c9be357c38e406626 /sys
parent465cba0c00bfc5d89bf10ce353b0adf40bdc098d (diff)
downloadjove-kernel-8d48bbd9746228b63bafa5f92b621998d7d8f3d3.tar.gz
jove-kernel-8d48bbd9746228b63bafa5f92b621998d7d8f3d3.tar.bz2
jove-kernel-8d48bbd9746228b63bafa5f92b621998d7d8f3d3.zip
move init fully to proc. remove init pages prealloc. prepare for scheduling
Diffstat (limited to 'sys')
-rw-r--r--sys/syscall.c8
-rw-r--r--sys/syscall.h1
-rw-r--r--sys/syscall_pcb.c26
3 files changed, 31 insertions, 4 deletions
diff --git a/sys/syscall.c b/sys/syscall.c
index 7207708..54d5468 100644
--- a/sys/syscall.c
+++ b/sys/syscall.c
@@ -38,7 +38,7 @@ static const syscall_handle_t s_syscall_handles[128] = {
[JOVE_OBJ_PAGEDIR] = _syscall_handle_pagedir,
[JOVE_OBJ_PROCESSOR] = _syscall_handle_generic,
[JOVE_OBJ_SHMEMORY] = _syscall_handle_generic,
- [JOVE_OBJ_PCB] = _syscall_handle_generic,
+ [JOVE_OBJ_PCB] = _syscall_handle_pcb,
[JOVE_OBJ_INT_HANDLE] = _syscall_handle_generic,
[JOVE_OBJ_INITRD_FILE] = _syscall_handle_initrd_file,
[JOVE_OBJ_FRAMEBUFFER] = _syscall_handle_generic,
@@ -86,7 +86,7 @@ syscall_handler(uintmax_t message_path_raw, uint16_t message_pathlen)
ctx.pcb = process_current();
pcb_t *pcb = obj_deref(ctx.pcb);
- ctx.objdir = lockstack_push(&ctx.lockstack, obj_take(pcb_rootdir(pcb)));
+ ctx.objdir = lockstack_push(&ctx.lockstack, obj_take(pcb_getrootdir(pcb)));
ctx.message = link_try_traverse_objdir(
ctx.objdir, &ctx.lockstack, message_pathlen, message_path);
@@ -113,7 +113,7 @@ syscall_handler(uintmax_t message_path_raw, uint16_t message_pathlen)
}
uintptr_t message_vptr = message_unmap(ctx.message.obj,
- (jove_owned_obj_t*)pcb_pagedir(pcb));
+ (jove_owned_obj_t*)pcb_getpagedir(pcb));
size_t messagelen = 0x1000;
void *messagedata = (void*)message_getdata(ctx.message.obj);
@@ -154,7 +154,7 @@ syscall_handler(uintmax_t message_path_raw, uint16_t message_pathlen)
}
remap_return:
- message_remap(ctx.message.obj, (jove_owned_obj_t*)pcb_pagedir(pcb), message_vptr);
+ message_remap(ctx.message.obj, (jove_owned_obj_t*)pcb_getpagedir(pcb), message_vptr);
release_return:
lockstack_popall(&ctx.lockstack);
diff --git a/sys/syscall.h b/sys/syscall.h
index 461b104..082fe29 100644
--- a/sys/syscall.h
+++ b/sys/syscall.h
@@ -57,6 +57,7 @@ int _syscall_handle_vtt(syscall_context_t *ctx);
int _syscall_handle_objdir(syscall_context_t *ctx);
int _syscall_handle_untyped(syscall_context_t *ctx);
int _syscall_handle_pagedir(syscall_context_t *ctx);
+int _syscall_handle_pcb(syscall_context_t *ctx);
int _syscall_handle_initrd_file(syscall_context_t *ctx);
int _syscall_handle_message(syscall_context_t *ctx);
diff --git a/sys/syscall_pcb.c b/sys/syscall_pcb.c
new file mode 100644
index 0000000..b77be95
--- /dev/null
+++ b/sys/syscall_pcb.c
@@ -0,0 +1,26 @@
+#include "api/error.h"
+#include "lib/printf.h"
+#include "syscall.h"
+
+int
+s_syscall_pcb_yield(jove_owned_obj_t *pcb_obj,
+ size_t bytes_left,
+ void *payload_data)
+{
+ kprintf("%s: Stub!\n", __func__);
+ return 0;
+}
+
+int
+_syscall_handle_pcb(syscall_context_t *ctx)
+{
+ switch(ctx->header->callid) {
+ case SYSCALL_PCB_YIELD:
+ if(ctx->target.permissions & SYSCALL_PERM_PCB_YIELD)
+ return s_syscall_pcb_yield(ctx->target.obj, ctx->bytes_left, ctx->payload);
+ return -EPERM;
+
+ default:
+ return -EBADCALL;
+ }
+}