From 2f82430b488878d321276e6efb10c61042ca2930 Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 1 Nov 2022 21:18:17 +0200 Subject: Enable interrupts after enabling the PIC --- i686/lidt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'i686/lidt.c') diff --git a/i686/lidt.c b/i686/lidt.c index aa6185b..5cb66b6 100644 --- a/i686/lidt.c +++ b/i686/lidt.c @@ -39,16 +39,15 @@ idt_install() { // exceptions 0x00~0x13 for (int i = 0; i <= 0x13; ++i) Gate(&interrupt_table[i], &abort_handler, 0x10); + // irq 0x20~0x2f - // for (int i = 0; i < 16; ++i) irq_table[i] = NULL; - for (int i = 0x20; i <= 0x2f; ++i) Gate(&interrupt_table[i], &abort_handler, 0x10); Gate(&interrupt_table[0x20], &irq0x00, 0x10); Gate(&interrupt_table[0x21], &irq0x01, 0x10); + for (int i = 0x22; i <= 0x2f; ++i) Gate(&interrupt_table[i], &abort_handler, 0x10); + // syscall 0x80 Gate(&interrupt_table[0x80], &abort_handler, 0x10); const struct Pointer ptr = {.limit = sizeof(interrupt_table) - 1, .base = (unsigned)&interrupt_table}; asm volatile("lidt (%0)" : : "a"(&ptr)); - - asm volatile("sti"); } -- cgit v1.2.1