kernel: Run the init function in a separate block to free everything before kernel_exit is called
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-08-08 10:44:18 +02:00
parent 826be882a9
commit 917203ef11
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -32,6 +32,7 @@ void reap_thread()
}
[[noreturn]] void init()
{
{
kinfoln("Starting Moon %s %s", MOON_VERSION, MOON_RELEASE);
@ -50,8 +51,8 @@ void reap_thread()
auto init =
mark_critical(VFS::resolve_path("/bin/preinit", Credentials {}), "Can't find init in the initial ramfs!");
auto init_thread =
mark_critical(Scheduler::new_userspace_thread(init, "/bin/preinit"), "Failed to create PID 1 process for init");
auto init_thread = mark_critical(Scheduler::new_userspace_thread(init, "/bin/preinit"),
"Failed to create PID 1 process for init");
auto reap = mark_critical(Scheduler::new_kernel_thread(reap_thread, "[reap]"),
"Failed to create the process reaper kernel thread");
@ -65,6 +66,7 @@ void reap_thread()
setup_log(log_debug_enabled(), log_serial_enabled(), false);
init_thread->wake_up();
}
kernel_exit();
}