From c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 13 Jul 2021 19:46:13 +0200 Subject: Final fixes --- src/loader/interrupt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/loader/interrupt.c') 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 #include -#include #include +#include /** * 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"); -- cgit v1.2.3