summaryrefslogtreecommitdiff
path: root/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel.c')
-rw-r--r--kernel/kernel.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 753f4a5..3dbf0d1 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -1,3 +1,5 @@
+#include <types.h>
+#include <wdt.h>
#define UART_BASE 0x10000000 // Example UART address
static inline void putchar(char c) {
@@ -11,10 +13,19 @@ static void print_string(const char *str) {
}
}
-void kernel_main(void) {
- print_string("Hello from RISC-V kernel!\n");
-
- while (1) {
- // Wait
+void kernel_main(void *wdt) {
+ struct wdt_root *root = wdt;
+ print_string("deserialized all!\n");
+ uint32_t count = root->count;
+ for (uint32_t i = 0; i < count; i++) {
+ print_string("deserializing wdt node!\n");
+ print_string("device type: ");
+ if (root->devices[i].type == 0) {
+ print_string("mem");
+ } else {
+ print_string("unknown");
+ }
+ print_string("\n");
}
+ while(1);
}