diff options
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();
+}
|