Implemented project structure

This commit is contained in:
Fabio Scotto di Santolo
2025-11-29 18:39:57 +01:00
commit c59b4004e5
6024 changed files with 1100108 additions and 0 deletions

26
Makefile Normal file
View File

@@ -0,0 +1,26 @@
CC = ./xpack-riscv-none-elf-gcc-13.4.0-1/bin/riscv-none-elf-gcc
CFLAGS = -nostdlib -O2 -g3 -Wall -Wextra -fno-stack-protector -ffreestanding
LD_SCRIPT = kernel.ld
LDFLAGS = -T$(LD_SCRIPT) -Wl,-Map=kernel.map
SRC = kernel.c
OUT = kernel.elf
.PHONY: all clean run
all: $(OUT)
$(OUT): $(SRC) $(LD_SCRIPT)
$(CC) $(LDFLAGS) $(CFLAGS) $(SRC) -o $@
clean:
rm -f $(OUT) kernel.map
run: $(OUT)
distrobox enter archlinux -- qemu-system-riscv32 \
-machine virt \
-bios default \
-nographic \
-serial mon:stdio \
-no-reboot \
-kernel $(OUT)