added irq dispatch handler

rn it just makes sure that execution continues
This commit is contained in:
shockrah 2019-11-09 17:37:20 -08:00
parent d1866c5e93
commit 0dfd0e9fe2
2 changed files with 16 additions and 3 deletions

View File

@ -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() {

View File

@ -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
}