diff options
author | Marvin Borner | 2021-07-13 19:46:13 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-13 19:46:13 +0200 |
commit | c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b (patch) | |
tree | 871dd1de7378f22f69c7009e44c7ac7e88f5d8ea /src/loader/interrupt.c | |
parent | 08cd951ea8410bc87e316e6c11d34a118437ba8b (diff) |
Diffstat (limited to 'src/loader/interrupt.c')
-rw-r--r-- | src/loader/interrupt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/loader/interrupt.c b/src/loader/interrupt.c index e05b4e0..d750832 100644 --- a/src/loader/interrupt.c +++ b/src/loader/interrupt.c @@ -2,8 +2,8 @@ #include <interrupt.h> #include <log.h> -#include <pic.h> #include <panic.h> +#include <pic.h> /** * IDT @@ -11,10 +11,12 @@ extern u32 interrupt_table[]; static struct idt_entry idt_entries[256] = { 0 }; -REAL static struct idt_ptr idt = { .size = sizeof(idt_entries) - 1, .base = idt_entries }; +static struct idt_ptr idt = { .size = sizeof(idt_entries) - 1, .base = idt_entries }; void idt_install(void) { + // Initialize IDT using handler offset, segment and type + for (u8 i = 0; i < 3; i++) idt_entries[i] = IDT_ENTRY(interrupt_table[i], 0x18, INTERRUPT_GATE); @@ -82,8 +84,8 @@ static void interrupt_trap_handler(struct interrupt_frame *frame) __asm__ volatile("cli\nhlt"); } - log("%s Exception (code %x) at 0x%x!\n", interrupt_trap_names[frame->interrupt_no], frame->err_code, - frame->eip); + log("%s Exception (code %x) at 0x%x!\n", interrupt_trap_names[frame->interrupt_no], + frame->err_code, frame->eip); while (1) __asm__ volatile("cli\nhlt"); |