diff --git a/sys/amd64/include/trap.h b/sys/amd64/include/trap.h index e523ba8..6e409e2 100644 --- a/sys/amd64/include/trap.h +++ b/sys/amd64/include/trap.h @@ -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 */ diff --git a/sys/amd64/trap.c b/sys/amd64/trap.c index a273649..ea70440 100644 --- a/sys/amd64/trap.c +++ b/sys/amd64/trap.c @@ -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) {