From 018624dd5b1692b88f7b2e85652ea7b898043b6d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 24 May 2022 23:28:37 +0300 Subject: make process loading more generic --- common/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'common/main.c') diff --git a/common/main.c b/common/main.c index 9585f3d..a608266 100644 --- a/common/main.c +++ b/common/main.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,7 @@ void __main main(void *fdt) setup_arch(fdt); init_pmem(fdt); + /* setup temporary virtual memory */ struct vmem *b = init_vmem(fdt); /* start up debugging in kernel IO */ @@ -30,5 +32,11 @@ void __main main(void *fdt) init_irq(fdt); init_timer(fdt); - init_proc(fdt, b); + init_proc(fdt); + /* free temporary virtual memory now that we're in the init process + * space */ + destroy_vmem(b); + + /* start running init program */ + run_init(cur_tcb(), fdt); } -- cgit v1.3