mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-10-26 02:15:06 -07:00
20 lines
410 B
C
20 lines
410 B
C
#include "panic.h"
|
|
#include "terminal.h"
|
|
#include "serial.h"
|
|
#include <stdbool.h>
|
|
|
|
void panic(const char *message) {
|
|
terminal_write("KERNEL PANIC: ");
|
|
terminal_write(message);
|
|
terminal_write("\nSystem halted.\n");
|
|
|
|
serial_write("KERNEL PANIC: ");
|
|
serial_write(message);
|
|
serial_write("\nSystem halted.\n");
|
|
|
|
// Halt the system
|
|
while (true) {
|
|
__asm__("cli; hlt");
|
|
}
|
|
}
|