Handle ISR with panic call

This commit is contained in:
lucic71 2022-06-28 19:40:51 +03:00
parent cea94e4017
commit 6c8de51b44
2 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,7 @@
#include "i386/context.h"
#include "kernel/serial.h"
#include "kernel/log.h"
#include <stdio.h>
#include <string.h>
@ -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]);
}

View File

@ -4,7 +4,7 @@
void panic(char *panic_str) {
printf("Panic: %s\n", panic_str);
printf("\nPanic: %s\n", panic_str);
while (1);
}