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
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
826be882a9
commit
917203ef11
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user