NMI now triggers the debugger

This commit is contained in:
Ali Mashtizadeh 2023-09-05 17:47:52 -04:00
parent 1c88ad598c
commit 09f3e260ff
2 changed files with 12 additions and 4 deletions

View File

@ -41,7 +41,7 @@
#define T_SYSCALL 60 /* System Call */
#define T_CROSSCALL 61 /* Cross Call (IPI) */
#define T_DEBUGIPI 62 /* Kernel Debugger Halt (IPI */
#define T_DEBUGIPI 62 /* Kernel Debugger Halt (IPI) */
#define T_UNKNOWN 63 /* Unknown Trap */

View File

@ -148,10 +148,12 @@ trap_entry(TrapFrame *tf)
// XXX: USE ATOMIC!
intStats[tf->vector]++;
// Debug NMI (should be T_DEBUGIPI)
// Debug NMI
if (tf->vector == T_NMI) {
Debug_HaltIPI(tf);
LAPIC_SendEOI();
Critical_Enter();
kprintf("Kernel Fault: Vector %d\n", tf->vector);
Trap_Dump(tf);
Debug_Breakpoint(tf);
return;
}
@ -233,6 +235,12 @@ trap_entry(TrapFrame *tf)
return;
}
// Debug IPI
if (tf->vector == T_DEBUGIPI) {
Debug_HaltIPI(tf);
LAPIC_SendEOI();
}
// Cross calls
if (tf->vector == T_CROSSCALL)
{