From 51665a04b73bb68b69f88c3bceef12e973e64742 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 19 Oct 2022 20:33:41 +0200 Subject: [PATCH] Kernel: Restart if init exits --- kernel/src/thread/Scheduler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index 502d1ce3..2dd05353 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -7,6 +7,7 @@ #include "memory/PMM.h" #include "memory/VMM.h" #include "misc/hang.h" +#include "misc/reboot.h" #include "misc/utils.h" #include "panic/Panic.h" #include "std/assert.h" @@ -280,6 +281,7 @@ void Scheduler::task_exit(Context* context, int64_t status) return true; }); } + else { reboot(); } task_yield(context); } @@ -298,6 +300,7 @@ void Scheduler::task_misbehave(Context* context, int64_t status) return true; }); } + else { reboot(); } task_yield(context); }