summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/kernel/panic.h6
-rw-r--r--kernel/panic.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/include/kernel/panic.h b/include/kernel/panic.h
new file mode 100644
index 0000000..529702b
--- /dev/null
+++ b/include/kernel/panic.h
@@ -0,0 +1,6 @@
+#ifndef KERNEL_PANIC_H
+#define KERNEL_PANIC_H
+
+void panic(const char *str);
+
+#endif
diff --git a/kernel/panic.c b/kernel/panic.c
new file mode 100644
index 0000000..c75fafb
--- /dev/null
+++ b/kernel/panic.c
@@ -0,0 +1,8 @@
+#include <kernel/panic.h>
+#include <kernel/io.h>
+
+void panic(const char *str) {
+ kprintf("KERNEL PANIC\n");
+ kprintf("ERROR: %s\n", str);
+ while (1);
+}