x86: Set interrupt handler for Double Fault exception
This patch sets an interrupt handler for Double Fault exception during CPU initialization. In case such exception is raised, we halt the system. This way, we avoid the system to triple fault (due to an unhandled interrupt for instance), leaving no trace about what cause the triple fault.
This commit is contained in:
parent
e28f400e0c
commit
604538ed62
1 changed files with 13 additions and 0 deletions
|
@ -30,10 +30,23 @@
|
|||
|
||||
#include "gdt.h"
|
||||
#include "idt.h"
|
||||
#include "interrupt.h"
|
||||
#include "helpers.h"
|
||||
|
||||
static void
|
||||
double_fault_handler(struct interrupt_context context)
|
||||
{
|
||||
halt();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cpu_init(void)
|
||||
{
|
||||
gdt_init();
|
||||
idt_init();
|
||||
|
||||
/* Set an interrupt handler for Double Fault exception. This way, we avoid
|
||||
* the system to triple fault, leaving no trace about what happened.
|
||||
*/
|
||||
SET_INTERRUPT_HANDLER(8, 1, double_fault_handler);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue