kernel/x86_64: Terminate page faults in a waitpid-friendly way

This commit is contained in:
apio 2023-03-24 00:52:17 +01:00
parent e2eb9a92cb
commit d63c8abbfd
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -71,7 +71,10 @@ void decode_page_fault_error_code(u64 code)
{
// FIXME: Kill this process with SIGSEGV once we have signals and all that.
kerrorln("Current task %zu was terminated because of a page fault", Scheduler::current()->id);
kernel_exit();
Scheduler::current()->state = ThreadState::Exited;
Scheduler::current()->status = 127;
kernel_yield();
unreachable();
}
CPU::print_stack_trace_at(regs);