summaryrefslogtreecommitdiff
path: root/Kernel/i386.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-18 00:12:52 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-18 00:13:06 +0200
commit1a801e5737fa8851a367040d67267c53ba01c82c (patch)
tree1a9c7206880041d32751a3d95eacdce8c4e58bc8 /Kernel/i386.cpp
parent56c1f9db8e5e1f289858632acd3e84f419d6b267 (diff)
downloadserenity-1a801e5737fa8851a367040d67267c53ba01c82c.zip
Hang if we GPF in ring 0.
Diffstat (limited to 'Kernel/i386.cpp')
-rw-r--r--Kernel/i386.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/i386.cpp b/Kernel/i386.cpp
index 47f156772a..6e7368fab0 100644
--- a/Kernel/i386.cpp
+++ b/Kernel/i386.cpp
@@ -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");