added irq dispatch handler
rn it just makes sure that execution continues
This commit is contained in:
parent
d1866c5e93
commit
0dfd0e9fe2
12
interrupts.c
12
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() {
|
||||
|
7
kernel.c
7
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user