diff --git a/src/interrupt/handler.c b/src/interrupt/handler.c index 87c8e9c..1f17e9c 100644 --- a/src/interrupt/handler.c +++ b/src/interrupt/handler.c @@ -53,9 +53,12 @@ void irq_handler(void) int8_t index = -1; __asm__ volatile("movb %%bl, %0" ::"m"(index)); - if (index == 0) { - pic_send_eoi(index); + pic_send_eoi(index); + if (index == -1) { + kprintf(KERN_ERR "interrupt triggered without a code\n"); return; } + if (index == 0) + return; kpanic("%d\n", index); } diff --git a/src/interrupt/idt.c b/src/interrupt/idt.c index e8c6f74..f34954a 100644 --- a/src/interrupt/idt.c +++ b/src/interrupt/idt.c @@ -45,5 +45,5 @@ void init_idt(void) for (uint8_t j = 0; j < 16; j++) idt_set_descriptor(i + j, irq_stub_table[j], 0x8E); load_idt(&idtr); - asm volatile("sti"); + __asm__ volatile("sti"); }