From 80a4e7069a78bbacba0069f850a3250d678371b4 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 30 Oct 2019 23:18:49 -0700 Subject: [PATCH] changing main interrupt_handler to take a pointer also moving some logic around to help reson what's happening in recent errors --- interrupts.c | 11 ++++------- interrupts.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/interrupts.c b/interrupts.c index 8a97a0f..813cbaf 100644 --- a/interrupts.c +++ b/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; } diff --git a/interrupts.h b/interrupts.h index 7e9c082..686dd96 100644 --- a/interrupts.h +++ b/interrupts.h @@ -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*);