From 548506392b789f58b1556a6ffca917441e1d89fd Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Tue, 13 Oct 2026 22:31:43 -0400 Subject: ipc functions. work on process spawning --- arch/x86_64/proc/init.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'arch/x86_64/proc/init.c') diff --git a/arch/x86_64/proc/init.c b/arch/x86_64/proc/init.c index 155cff6..8003a6d 100644 --- a/arch/x86_64/proc/init.c +++ b/arch/x86_64/proc/init.c @@ -5,6 +5,7 @@ #include "jove.h" #include "hal/obj.h" #include "lib/string.h" +#include "sys/message.h" #include "sys/objdir.h" #include "panic/panic.h" #include "lib/printf.h" @@ -126,20 +127,19 @@ init_setup(void) //Map the syscall message. last_base = (last_base + 0xFFF) & ~0xFFF; jove_owned_obj_t message_frame = init_pop_alloc(); - pagedir_map_frame(pml4, obj_getvalue(&message_frame), last_base, - PAGE_WRITEABLE | PAGE_USER | PAGE_XD); + jove_owned_obj_t *message_obj = objdir_getlocal(_rootdir_obj, INIT_ROOTDIR_MESSAGE_I); + + message_new(&message_frame); + objdir_swapobj(message_obj, &message_frame); + message_map(message_obj, init_pagedir, last_base); + + obj_release(init_pagedir); - extern struct init_payload _init_payload; _init_payload.brk = last_base + 0x1000; + //Copy init payload into syscall message. + extern struct init_payload _init_payload; memcpy((void*)last_base, &_init_payload, sizeof(struct init_payload)); - - jove_owned_obj_t *message_obj = objdir_getlocal(_rootdir_obj, INIT_ROOTDIR_MESSAGE_I); - obj_settype(message_obj, JOVE_OBJ_MESSAGE); - obj_setvalue(message_obj, last_base | 1); - obj_release(message_obj); - - obj_release(init_pagedir); //Enable syscalls extern void _syscall_entry(void); -- cgit v1.2.3