From 9ab3ab7c4087567cb9a17785c44f88b3980ba236 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 5 Nov 2022 11:56:16 +0100 Subject: [PATCH] Kernel: Show init's exit status before restarting --- kernel/src/thread/Scheduler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index f8dc8fde..6f5bc0ae 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -196,7 +196,8 @@ long Scheduler::load_user_task(const char* filename) new_task->regs.rip = image->entry; new_task->image = image; new_task->allocated_stack = (uint64_t)MemoryManager::get_pages_at( - 0x100000, TASK_PAGES_IN_STACK, MAP_READ_WRITE | MAP_USER | MAP_AS_OWNED_BY_TASK); // 16 KB is enough for everyone, right? + 0x100000, TASK_PAGES_IN_STACK, + MAP_READ_WRITE | MAP_USER | MAP_AS_OWNED_BY_TASK); // 16 KB is enough for everyone, right? if (!new_task->allocated_stack) { new_task->address_space.destroy(); @@ -291,6 +292,7 @@ void sched_common_exit(Context* context, int64_t status) } else { + kinfoln("PID 1 exited with code %ld", status); #ifndef RUN_TEST_AS_INIT reboot(); #else