aboutsummaryrefslogtreecommitdiff
path: root/src/kapi/system.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2025-12-12 14:26:16 +0100
committerFelix Morgner <felix.morgner@ost.ch>2025-12-12 14:26:16 +0100
commit4bf9eded3a5d6b007ba79a5716143fa8b3a5aaf6 (patch)
tree5ffcfb9b12afd58627a52498f232c798b273a351 /src/kapi/system.cpp
parent5f695cd3519d8a09a53485c08971f49ed92969ff (diff)
downloadteachos-4bf9eded3a5d6b007ba79a5716143fa8b3a5aaf6.tar.xz
teachos-4bf9eded3a5d6b007ba79a5716143fa8b3a5aaf6.zip
kapi: move platform independent implementation
Diffstat (limited to 'src/kapi/system.cpp')
-rw-r--r--src/kapi/system.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kapi/system.cpp b/src/kapi/system.cpp
new file mode 100644
index 0000000..3ae3f29
--- /dev/null
+++ b/src/kapi/system.cpp
@@ -0,0 +1,20 @@
+#include "kapi/system.hpp"
+
+#include "kapi/cio.hpp"
+#include "kapi/cpu.hpp"
+
+namespace teachos::system
+{
+
+ [[gnu::weak]]
+ auto panic(std::string_view message, std::source_location location) -> void
+ {
+ cio::println_error("!!!Kernel Panic!!! ");
+ cio::println_error(message);
+ cio::println_error(location.file_name());
+ cio::println_error(location.function_name());
+
+ cpu::halt();
+ }
+
+} // namespace teachos::system