Kernel: Show init's exit status before restarting
This commit is contained in:
parent
b63a9f5ba9
commit
9ab3ab7c40
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user