fix: irqs are handled correctly with regs->int_no (and the keyboard handler works)
This commit is contained in:
parent
4fb51d4356
commit
e5d7b80ed5
@ -1,8 +1,6 @@
|
|||||||
#include "interrupts.h"
|
#include "interrupts.h"
|
||||||
#include "kprintf.h"
|
|
||||||
|
|
||||||
void clock_handler(struct registers *regs)
|
void clock_handler(struct registers *regs)
|
||||||
{
|
{
|
||||||
(void)regs;
|
(void)regs;
|
||||||
kprintf("test\n");
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
void load_drivers(void)
|
void load_drivers(void)
|
||||||
{
|
{
|
||||||
register_interrupt_handler(1, keyboard_handler);
|
|
||||||
register_interrupt_handler(0, clock_handler);
|
register_interrupt_handler(0, clock_handler);
|
||||||
|
register_interrupt_handler(1, keyboard_handler);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ void register_interrupt_handler(int i, isr_t handler)
|
|||||||
void irq_handler(struct registers *regs)
|
void irq_handler(struct registers *regs)
|
||||||
{
|
{
|
||||||
if (regs->int_no != 0) {
|
if (regs->int_no != 0) {
|
||||||
isr_t handler = interrupt_handlers[regs->int_no];
|
isr_t handler = interrupt_handlers[regs->int_no - 32];
|
||||||
handler(regs);
|
handler(regs);
|
||||||
}
|
}
|
||||||
pic_send_eoi(regs->int_no);
|
pic_send_eoi(regs->int_no);
|
||||||
|
@ -28,8 +28,8 @@ void kernel_main(void)
|
|||||||
init_gdt();
|
init_gdt();
|
||||||
init_idt();
|
init_idt();
|
||||||
init_memory();
|
init_memory();
|
||||||
/* load_drivers(); */
|
load_drivers();
|
||||||
/* while (42) */
|
while (42)
|
||||||
/* ; */
|
;
|
||||||
shell_init();
|
/* shell_init(); */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user