changing main interrupt_handler to take a pointer

also moving some logic around to help reson what's happening in recent errors
This commit is contained in:
shockrahwow 2019-10-30 23:18:49 -07:00
parent 35985d9199
commit 80a4e7069a
2 changed files with 5 additions and 8 deletions

View File

@ -84,20 +84,17 @@ void int_keyboard(struct cpu_reg_state* cpu) {
if((u8)code < 0x80 || (u8)code > 0x1f) {
putch(code);
}
serial_pic_ack(cpu->int_no);
}
// Generic interrupt handler to be used later on
void interrupt_handler(struct cpu_reg_state cpu) {
void interrupt_handler(struct cpu_reg_state* cpu) {
// treating things on the stack like it were a cpu_reg_state
// NOTE: dummy stuff to stop gcc from complaining atm
printf("handled exception\n");
if(cpu.int_no < 32) {
printf("handled exception\n");
}
else {
printf("Unimplemented exception");
if(cpu->int_no < 32) {
printf(err_msg[cpu->int_no]);
}
serial_pic_ack(cpu->int_no);
return;
}

View File

@ -44,4 +44,4 @@ struct IDT_PTR idt_ptr;
void init_idt();
void setup_idt_entry(u32 t_idx, u32 base, u16 sel, u8 type_attrs);
void int_keyboard(struct cpu_reg_state*);
void interrupt_handler(struct cpu_reg_state);
void interrupt_handler(struct cpu_reg_state*);