mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2025-05-15 09:01:27 -07:00
20 lines
416 B
C
20 lines
416 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 volatile ("cli; hlt");
|
|
}
|
|
}
|