diff --git a/kernel/arch/i386/isr/isr.c b/kernel/arch/i386/isr/isr.c index b594afc..668ebd9 100644 --- a/kernel/arch/i386/isr/isr.c +++ b/kernel/arch/i386/isr/isr.c @@ -4,6 +4,7 @@ #include "i386/context.h" #include "kernel/serial.h" +#include "kernel/log.h" #include #include @@ -131,8 +132,7 @@ char *exception_messages[] = { }; /* isr_handler: - * Handles an incomming request by calling the appropiate handler or printing - * an exception message. + * Handles an incomming request by calling the appropiate handler or panicking. * * @param context - the context of the caller * @@ -140,9 +140,7 @@ char *exception_messages[] = { void isr_handler(context_t context) { - serial_write(COM1, "Unhandled exception: ", strlen("Unhandled exception: ")); - serial_write(COM1, exception_messages[context.int_no], strlen(exception_messages[context.int_no])); - serial_write(COM1, "\n", 1); + panic(exception_messages[context.int_no]); } diff --git a/kernel/log/src/panic.c b/kernel/log/src/panic.c index 171fb5f..4a93763 100644 --- a/kernel/log/src/panic.c +++ b/kernel/log/src/panic.c @@ -4,7 +4,7 @@ void panic(char *panic_str) { - printf("Panic: %s\n", panic_str); + printf("\nPanic: %s\n", panic_str); while (1); }