diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-06-02 00:26:57 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-06-02 00:26:57 +0200 |
commit | 45f420a338ea02225bb8a98c9aca5eed8d6a23ae (patch) | |
tree | 97fdb1c8e81ba79b101b928158e5e37fa938c8f3 /kernel/lib.c |
Initial commit
Diffstat (limited to 'kernel/lib.c')
-rw-r--r-- | kernel/lib.c | 12 |
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();
+}
|