summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/idt.c1
-rw-r--r--kernel/isr.c6
-rw-r--r--kernel/isr.h3
3 files changed, 10 insertions, 0 deletions
diff --git a/kernel/idt.c b/kernel/idt.c
index 96d6d15..65f511f 100644
--- a/kernel/idt.c
+++ b/kernel/idt.c
@@ -53,6 +53,7 @@ static void idt_prepare() {
IDT[i].present = 0;
idt_add(0x08, false, isr_double_fault);
+ idt_add(0x0d, false, isr_general_protection_fault);
idt_add(0x34, false, isr_test_interrupt);
}
diff --git a/kernel/isr.c b/kernel/isr.c
index e6a9871..b715de0 100644
--- a/kernel/isr.c
+++ b/kernel/isr.c
@@ -13,6 +13,12 @@ void isr_double_fault(struct interrupt_frame *frame) {
}
__attribute__((interrupt))
+void isr_general_protection_fault(struct interrupt_frame *frame) {
+ tty_const("#GP");
+ panic();
+}
+
+__attribute__((interrupt))
void isr_test_interrupt(struct interrupt_frame *frame) {
isr_test_interrupt_called = true;
}
diff --git a/kernel/isr.h b/kernel/isr.h
index 624e9ad..150fc46 100644
--- a/kernel/isr.h
+++ b/kernel/isr.h
@@ -9,4 +9,7 @@ __attribute__((interrupt))
void isr_double_fault(struct interrupt_frame *frame);
__attribute__((interrupt))
+void isr_general_protection_fault(struct interrupt_frame *frame);
+
+__attribute__((interrupt))
void isr_test_interrupt(struct interrupt_frame *frame);