Initial Commit

This commit is contained in:
Liam Kerr 2026-02-08 21:23:47 +00:00
commit 7f943be8f0
7 changed files with 114 additions and 0 deletions

14
src/boot/entry.S Normal file
View file

@ -0,0 +1,14 @@
.section .text
.global _start
_start:
la sp, stack_top # Set up the stack pointer
call kmain # Jump to our C code
loop:
wfi # Wait for Interrupt (saves CPU)
j loop # Infinite loop if C returns
.section .bss
.align 16
stack_low:
.skip 4096 # 4KB of stack space
stack_top:

11
src/kernel/kernel.c Normal file
View file

@ -0,0 +1,11 @@
#include <stdint.h>
#include <stddef.h>
void kmain() {
char *uart = (char *)0x10000000;
char *msg = "Hello, OS World!\n";
for (int i = 0; msg[i] != '\0'; i++) {
*uart = msg[i]; // Write each character to the UART
}
}