fix irq
This commit is contained in:
parent
eaf74564fe
commit
417bcb30ef
1 changed files with 8 additions and 8 deletions
16
src/idt.c
16
src/idt.c
|
|
@ -49,26 +49,26 @@ void idt_init(void) {
|
||||||
idt_load();
|
idt_load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void isr_handler(struct registers regs) {
|
void isr_handler(struct registers *regs) {
|
||||||
kprint_serial("Exception: ");
|
kprint_serial("Exception: ");
|
||||||
kprint_serial_dec(regs.int_no);
|
kprint_serial_dec(regs->int_no);
|
||||||
kprint_serial("\nSystem Halted.\n");
|
kprint_serial("\nSystem Halted.\n");
|
||||||
while(1) asm("hlt");
|
while(1) asm("hlt");
|
||||||
}
|
}
|
||||||
|
|
||||||
void irq_handler(struct registers regs) {
|
void irq_handler(struct registers *regs) {
|
||||||
if (regs.int_no == 32) {
|
if (regs->int_no == 32) {
|
||||||
timer_handler();
|
timer_handler();
|
||||||
} else if (regs.int_no == 33) {
|
} else if (regs->int_no == 33) {
|
||||||
keyboard_handler();
|
keyboard_handler();
|
||||||
} else if (regs.int_no == 44) {
|
} else if (regs->int_no == 44) {
|
||||||
mouse_handler();
|
mouse_handler();
|
||||||
} else {
|
} else {
|
||||||
kprint_serial("Unknown IRQ: ");
|
kprint_serial("Unknown IRQ: ");
|
||||||
kprint_serial_dec(regs.int_no);
|
kprint_serial_dec(regs->int_no);
|
||||||
kprint_serial("\n");
|
kprint_serial("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regs.int_no >= 40) outb(0xA0, 0x20); // Slave
|
if (regs->int_no >= 40) outb(0xA0, 0x20); // Slave
|
||||||
outb(0x20, 0x20); // Master
|
outb(0x20, 0x20); // Master
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue