Kernel: Show init's exit status before restarting

This commit is contained in:
apio 2022-11-05 11:56:16 +01:00
parent b63a9f5ba9
commit 9ab3ab7c40

View File

@ -196,7 +196,8 @@ long Scheduler::load_user_task(const char* filename)
new_task->regs.rip = image->entry; new_task->regs.rip = image->entry;
new_task->image = image; new_task->image = image;
new_task->allocated_stack = (uint64_t)MemoryManager::get_pages_at( 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) if (!new_task->allocated_stack)
{ {
new_task->address_space.destroy(); new_task->address_space.destroy();
@ -291,6 +292,7 @@ void sched_common_exit(Context* context, int64_t status)
} }
else else
{ {
kinfoln("PID 1 exited with code %ld", status);
#ifndef RUN_TEST_AS_INIT #ifndef RUN_TEST_AS_INIT
reboot(); reboot();
#else #else