fix: no more looping on some weird input
This commit is contained in:
parent
f3db3060af
commit
1640b2e125
@ -53,9 +53,12 @@ void irq_handler(void)
|
|||||||
int8_t index = -1;
|
int8_t index = -1;
|
||||||
__asm__ volatile("movb %%bl, %0" ::"m"(index));
|
__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;
|
return;
|
||||||
}
|
}
|
||||||
|
if (index == 0)
|
||||||
|
return;
|
||||||
kpanic("%d\n", index);
|
kpanic("%d\n", index);
|
||||||
}
|
}
|
||||||
|
@ -45,5 +45,5 @@ void init_idt(void)
|
|||||||
for (uint8_t j = 0; j < 16; j++)
|
for (uint8_t j = 0; j < 16; j++)
|
||||||
idt_set_descriptor(i + j, irq_stub_table[j], 0x8E);
|
idt_set_descriptor(i + j, irq_stub_table[j], 0x8E);
|
||||||
load_idt(&idtr);
|
load_idt(&idtr);
|
||||||
asm volatile("sti");
|
__asm__ volatile("sti");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user