From 45f420a338ea02225bb8a98c9aca5eed8d6a23ae Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 2 Jun 2024 00:26:57 +0200 Subject: Initial commit --- kernel/lib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 kernel/lib.c (limited to 'kernel/lib.c') 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(); +} -- cgit