aboutsummaryrefslogtreecommitdiff
path: root/src/proc.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 07:00:43 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-07 07:00:43 +0300
commit122374c362ba8bb9082385da3c82e264ab594f15 (patch)
tree0123fad5464aaf64f522d48f5069b35b90207aae /src/proc.c
parent03e12129927b0deba537a11bb5575bef93c57d0f (diff)
downloadkmi-122374c362ba8bb9082385da3c82e264ab594f15.tar.gz
kmi-122374c362ba8bb9082385da3c82e264ab594f15.zip
smp now seems to work
+ Had some minor issues with a wraparound of size_t that effectively meant that some regions were allocated twice. Also, booting should be a bit more reliable now, turned out that the previous iteration of the booting was just accidentally working due to the kernel being placed 'close enough' in RAM to where it was linked to. Fixed by allocating a vmem of O1 that maps the kernel to a 2MiB boundary at boot, pretty nifty.
Diffstat (limited to 'src/proc.c')
-rw-r--r--src/proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/proc.c b/src/proc.c
index eff962a..93e3aa5 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -59,17 +59,22 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd)
/* allocate stacks etc after ELF file to make sure nothing of importance
* clashes */
prepare_proc(t, get_init_base(fdt), 0);
+
+ /** In the init process, can the entry be the callback? Is that too
+ * unergonomic? */
+ t->callback = t->exec;
+
/** \todo start one thread per core, with special handling for init in
* that each thread starts at the entry point of init? */
*proc_fdt = map_fixed_uvmem(t,
(pm_t)fdt, fdt_totalsize(fdt),
- VM_V | VM_R | VM_U);
+ MR_SHARED | VM_V | VM_R | VM_U);
pm_t initrd = (pm_t)__va(get_initrdbase(fdt));
*proc_initrd = map_fixed_uvmem(t,
initrd, get_initrdsize(fdt),
- VM_V | VM_R | VM_U);
+ MR_SHARED | VM_V | VM_R | VM_U);
info("mapped fdt at %lx\n", *proc_fdt);
info("mapped initrd at %lx\n", *proc_initrd);