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:
parent
35985d9199
commit
80a4e7069a
11
interrupts.c
11
interrupts.c
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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*);
|
||||
|
Loading…
Reference in New Issue
Block a user