summaryrefslogtreecommitdiff
path: root/kernel/kernel.c
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-07-12 12:42:31 -0500
committerNathan Lee <me@nwlee.tech>2026-07-12 12:45:05 -0500
commit24fdac29fb8a1c7766869b05e7a17b2c4cc98ce1 (patch)
tree6fddf53527e7ab52e089b620bcdbcba5fa67daa3 /kernel/kernel.c
parent5d9942d70ca61af4d12cd2a531a190c98052c9c4 (diff)
create elf.h
The ELF parser needs more work, there are more structs to be added. memcpy was refactored from mem.h into common.h endianness conversions were standardized in types.h
Diffstat (limited to 'kernel/kernel.c')
-rw-r--r--kernel/kernel.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index 3952f8f..da44428 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -1,18 +1,6 @@
#include <types.h>
#include <dtb.h>
#include <bump.h>
-#define UART_BASE 0x10000000 // Example UART address
-
-static inline void putchar(char c) {
- volatile char *uart = (volatile char *)UART_BASE;
- *uart = c;
-}
-
-static void print_string(const char *str) {
- while (*str) {
- putchar(*str++);
- }
-}
void kernel_main(size_t hart, void *fdt) {
(void)hart;
@@ -21,11 +9,11 @@ void kernel_main(size_t hart, void *fdt) {
struct mem_info *info = km_find_memory(head);
if (!info) {
- print_string("failed to get memory!\n");
while (1);
}
km_init(info);
+
while(1);
}