diff options
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index 3dbf0d1..568d8a3 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,5 +1,6 @@ #include <types.h> -#include <wdt.h> +#include <dtb.h> +#include <bump.h> #define UART_BASE 0x10000000 // Example UART address static inline void putchar(char c) { @@ -13,19 +14,17 @@ static void print_string(const char *str) { } } -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"); +void kernel_main(size_t hart, void *fdt) { + (void)hart; + + struct dt_node *head = dt_parse(fdt); + struct mem_info *info = km_find_memory(head); + + if (info) { + print_string("found memory!\n"); + } else { + print_string("could not find memory!\n"); } + while(1); } |
