summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/interrupts
diff options
context:
space:
mode:
authordzwdz2021-07-19 17:23:20 +0200
committerdzwdz2021-07-19 17:23:20 +0200
commitc9ad4bfbf875b0d23e1f7bf7d5aff2d149ba4fd7 (patch)
treeb54fd00dabe804cd69db73037620dbdda2900cca /src/kernel/arch/i386/interrupts
parenta31794504d911d584265ac0427dfbba9a4d9ef72 (diff)
add a page fault handler
Diffstat (limited to 'src/kernel/arch/i386/interrupts')
-rw-r--r--src/kernel/arch/i386/interrupts/idt.c1
-rw-r--r--src/kernel/arch/i386/interrupts/isr.c6
-rw-r--r--src/kernel/arch/i386/interrupts/isr.h3
3 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/arch/i386/interrupts/idt.c b/src/kernel/arch/i386/interrupts/idt.c
index 5573928..bbaf610 100644
--- a/src/kernel/arch/i386/interrupts/idt.c
+++ b/src/kernel/arch/i386/interrupts/idt.c
@@ -54,6 +54,7 @@ static void idt_prepare() {
idt_add(0x08, false, isr_double_fault);
idt_add(0x0d, false, isr_general_protection_fault);
+ idt_add(0x0e, false, isr_page_fault);
idt_add(0x34, false, isr_test_interrupt);
}
diff --git a/src/kernel/arch/i386/interrupts/isr.c b/src/kernel/arch/i386/interrupts/isr.c
index 35796fa..9da06fb 100644
--- a/src/kernel/arch/i386/interrupts/isr.c
+++ b/src/kernel/arch/i386/interrupts/isr.c
@@ -21,6 +21,12 @@ void isr_general_protection_fault(UNUSED struct interrupt_frame *frame) {
}
__attribute__((interrupt))
+void isr_page_fault(UNUSED struct interrupt_frame *frame) {
+ log_const("#PF");
+ panic();
+}
+
+__attribute__((interrupt))
void isr_test_interrupt(UNUSED struct interrupt_frame *frame) {
isr_test_interrupt_called = true;
}
diff --git a/src/kernel/arch/i386/interrupts/isr.h b/src/kernel/arch/i386/interrupts/isr.h
index 150fc46..c3585dc 100644
--- a/src/kernel/arch/i386/interrupts/isr.h
+++ b/src/kernel/arch/i386/interrupts/isr.h
@@ -12,4 +12,7 @@ __attribute__((interrupt))
void isr_general_protection_fault(struct interrupt_frame *frame);
__attribute__((interrupt))
+void isr_page_fault(struct interrupt_frame *frame);
+
+__attribute__((interrupt))
void isr_test_interrupt(struct interrupt_frame *frame);