Kernel - Caught infinite kernel panics
[tpg/acess2.git] / KernelLand / Kernel / debug.c
index f0d21fa..c9a2964 100644 (file)
@@ -113,9 +113,16 @@ void Debug_FmtS(int bUseKTerm, const char *format, ...)
 
 void Debug_KernelPanic(void)
 {
-       #if LOCK_DEBUG_OUTPUT
-       SHORTREL(&glDebug_Lock);
-       #endif
+       if( !gbDebug_IsKPanic )
+       {
+               #if LOCK_DEBUG_OUTPUT
+               SHORTREL(&glDebug_Lock);
+               #endif
+               VT_SetTerminal(7);
+       }
+       // 5 nested panics? Fuck it
+       if( gbDebug_IsKPanic > 5 )
+               for(;;);
        gbDebug_IsKPanic ++;
        KernelPanic_SetMode();
 }

UCC git Repository :: git.ucc.asn.au