aboutsummaryrefslogtreecommitdiff
path: root/src/proc.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 18:14:04 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 18:14:04 +0300
commit76517486919657ecadda9867125dc6730f29a5b7 (patch)
tree02d975db2b911ec7b92c4b1be7c5a2510b418ae1 /src/proc.c
parent608f44306a6f0d5692f5c81bcbfe7a621ec254ba (diff)
downloadkmi-76517486919657ecadda9867125dc6730f29a5b7.tar.gz
kmi-76517486919657ecadda9867125dc6730f29a5b7.zip
pretty massive virtual memory rewrite
+ The system is now a bit simpler and hopefully easier to understand, while also extending the shared memory to be 1:N, where there is one owner who may become a zombie while waiting for the N to die.
Diffstat (limited to 'src/proc.c')
-rw-r--r--src/proc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/proc.c b/src/proc.c
index 61dd125..eff962a 100644
--- a/src/proc.c
+++ b/src/proc.c
@@ -49,7 +49,8 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd)
/* init process has all capabilities */
set_caps(t->caps, 0,
- CAP_CAPS | CAP_PROC | CAP_SIGNAL | CAP_POWER | CAP_NOTIFY);
+ CAP_CAPS | CAP_PROC | CAP_SIGNAL | CAP_POWER | CAP_NOTIFY |
+ CAP_SHARED);
/* we shall try to map the fdt and initrd into the new address space, so
* save them here before we switch */
@@ -61,14 +62,14 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd)
/** \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_mem(t,
- (pm_t)fdt, fdt_totalsize(fdt),
- VM_V | VM_R | VM_U);
+ *proc_fdt = map_fixed_uvmem(t,
+ (pm_t)fdt, fdt_totalsize(fdt),
+ VM_V | VM_R | VM_U);
pm_t initrd = (pm_t)__va(get_initrdbase(fdt));
- *proc_initrd = map_fixed_mem(t,
- initrd, get_initrdsize(fdt),
- VM_V | VM_R | VM_U);
+ *proc_initrd = map_fixed_uvmem(t,
+ initrd, get_initrdsize(fdt),
+ VM_V | VM_R | VM_U);
info("mapped fdt at %lx\n", *proc_fdt);
info("mapped initrd at %lx\n", *proc_initrd);