diff --git a/interrupts.c b/interrupts.c index 5a7eb6f..d5a3712 100644 --- a/interrupts.c +++ b/interrupts.c @@ -123,6 +123,18 @@ void init_irq_handler(u32 irq, void (*handler)(struct cpu_reg_state* cpu)) { } void irq_handler(struct cpu_reg_state* cpu) { + void (*handler)(struct cpu_reg_state* cpu); + // Dispatcher for irq's + handler = irq_handlers[cpu->int_no]; + if(handler) { + handler(cpu); + } + // pretend like nothing happend for now + if(cpu->int_no >= 40) { + serialport_write_byte(0xa0, 0x20); + } + // notify master pic controller that we're done handling the interrupt + serialport_write_byte(0x20, 0x20); } void init_idt() { diff --git a/kernel.c b/kernel.c index ff452ff..a8e7c79 100644 --- a/kernel.c +++ b/kernel.c @@ -29,8 +29,9 @@ void kprints(const char* s) { void kmain() { kinit(); - __asm__("xchg bx, bx"); - __asm__("xor eax, eax"); - __asm__("div al"); + //__asm__("xchg bx, bx"); + //__asm__("xor eax, eax"); + //__asm__("div al"); + kprints("i guess we're good now?"); for(;;); // the most amazing loop }