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
@ -33,6 +33,7 @@ void reap_thread()
|
|||||||
|
|
||||||
[[noreturn]] void init()
|
[[noreturn]] void init()
|
||||||
{
|
{
|
||||||
|
{
|
||||||
kinfoln("Starting Moon %s %s", MOON_VERSION, MOON_RELEASE);
|
kinfoln("Starting Moon %s %s", MOON_VERSION, MOON_RELEASE);
|
||||||
|
|
||||||
// Default hostname if nobody from userspace changes it
|
// Default hostname if nobody from userspace changes it
|
||||||
@ -50,8 +51,8 @@ void reap_thread()
|
|||||||
|
|
||||||
auto init =
|
auto init =
|
||||||
mark_critical(VFS::resolve_path("/bin/preinit", Credentials {}), "Can't find init in the initial ramfs!");
|
mark_critical(VFS::resolve_path("/bin/preinit", Credentials {}), "Can't find init in the initial ramfs!");
|
||||||
auto init_thread =
|
auto init_thread = mark_critical(Scheduler::new_userspace_thread(init, "/bin/preinit"),
|
||||||
mark_critical(Scheduler::new_userspace_thread(init, "/bin/preinit"), "Failed to create PID 1 process for init");
|
"Failed to create PID 1 process for init");
|
||||||
|
|
||||||
auto reap = mark_critical(Scheduler::new_kernel_thread(reap_thread, "[reap]"),
|
auto reap = mark_critical(Scheduler::new_kernel_thread(reap_thread, "[reap]"),
|
||||||
"Failed to create the process reaper kernel thread");
|
"Failed to create the process reaper kernel thread");
|
||||||
@ -65,6 +66,7 @@ void reap_thread()
|
|||||||
setup_log(log_debug_enabled(), log_serial_enabled(), false);
|
setup_log(log_debug_enabled(), log_serial_enabled(), false);
|
||||||
|
|
||||||
init_thread->wake_up();
|
init_thread->wake_up();
|
||||||
|
}
|
||||||
|
|
||||||
kernel_exit();
|
kernel_exit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user