summaryrefslogtreecommitdiff
path: root/kernel/lib.c
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-06-02 00:26:57 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-06-02 00:26:57 +0200
commit45f420a338ea02225bb8a98c9aca5eed8d6a23ae (patch)
tree97fdb1c8e81ba79b101b928158e5e37fa938c8f3 /kernel/lib.c
Initial commit
Diffstat (limited to 'kernel/lib.c')
-rw-r--r--kernel/lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/lib.c b/kernel/lib.c
new file mode 100644
index 0000000..fff4c15
--- /dev/null
+++ b/kernel/lib.c
@@ -0,0 +1,12 @@
+#include "kernel/lib.h"
+#include "kernel/riscv.h"
+
+__attribute__((noreturn)) void panic(const char* s)
+{
+ // @Todo Refactor UART
+
+ volatile char* kUartBase = (volatile char*)0x1000'0000;
+ while (*s) *kUartBase = *s++;
+
+ hart_halt();
+}