From 4af62bb53676b7f721b46cabee78cac3a557e924 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 5 Aug 2020 18:28:26 +0200 Subject: Some proc things --- src/drivers/interrupts.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'src/drivers/interrupts.c') diff --git a/src/drivers/interrupts.c b/src/drivers/interrupts.c index 08f4c15..9ad2529 100644 --- a/src/drivers/interrupts.c +++ b/src/drivers/interrupts.c @@ -118,6 +118,42 @@ void irq_install() void (*isr_routines[256])(struct regs *) = { 0 }; +const char *isr_exceptions[32] = { "Division By Zero", + "Debug", + "Non Maskable Interrupt", + "Breakpoint", + "Into Detected Overflow", + "Out of Bounds", + "Invalid Opcode", + "No Coprocessor", + + "Double Fault", + "Coprocessor Segment Overrun", + "Bad TSS", + "Segment Not Present", + "Stack Fault", + "General Protection Fault", + "Page Fault", + "Unknown Interrupt", + + "Coprocessor Fault", + "Alignment Check", + "Machine Check", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved", + "Reserved" }; + void isr_install_handler(int isr, void (*handler)(struct regs *r)) { isr_routines[isr] = handler; @@ -137,9 +173,9 @@ void isr_handler(struct regs *r) if (handler) { handler(r); } else if (r->int_no <= 32) { - printf("\n#%d Exception, halting!\n", r->int_no); - printf("Error code: %d\n", r->err_code); __asm__("cli"); + printf("\n%s Exception, halting!\n", isr_exceptions[r->int_no]); + printf("Error code: %d\n", r->err_code); while (1) { }; } -- cgit v1.2.3