Hang if we GPF in ring 0.

This commit is contained in:
Andreas Kling 2018-10-18 00:12:52 +02:00
parent 56c1f9db8e
commit 1a801e5737
Notes: sideshowbarker 2024-07-19 18:46:38 +09:00
2 changed files with 7 additions and 0 deletions

View file

@ -37,6 +37,8 @@ public:
Ring3 = 3,
};
bool isRing0() const { return m_ring == Ring0; }
static Task* fromPID(pid_t);
static Task* fromIPCHandle(IPC::Handle);
static Task* kernelTask();

View file

@ -79,6 +79,11 @@ void exception_13_handler()
kprintf("eax=%x ebx=%x ecx=%x edx=%x\n", regs.eax, regs.ebx, regs.ecx, regs.edx);
kprintf("ebp=%x esp=%x esi=%x edi=%x\n", regs.ebp, regs.esp, regs.esi, regs.edi);
if (current->isRing0()) {
kprintf("Oh shit, we've crashed in ring 0 :(\n");
HANG;
}
current->setState(Task::Crashing);
if (!scheduleNewTask()) {
kprintf("Failed to schedule a new task :(\n");