feat: make kernel architecture-agnostic; primitive work on arm port

This commit is contained in:
daniel committed 2026-10-24 21:25:18 +02:00
1 parent dab7d5427b
commit 1bae77ec84
164 files changed
+3664 -1641

No files matched your search

+10 -4
View File
@@ -70,10 +70,16 @@ sudo apt install build-essential nasm git curl xorriso mtools gdisk qemu-system-
### Cross-Architecture Builds
To build for a different architecture, pass `ARCH=`:
The kernel is split into architecture-neutral code and per-architecture
ports under `kernel/src/Arch/` (see [porting.md](porting.md)). x86_64 is the
only complete port. `aarch64` is a skeleton: the whole kernel compiles and
links for it, but paging, exception vectors, the GIC and the timer are not
written yet, so it does not boot. Userspace is x86_64-only.
Non-x86 kernels are built with LLVM (`clang`, plus `ld.lld` for the link):
```bash
make ARCH=aarch64
make ARCH=riscv64
make ARCH=loongarch64
make kernel ARCH=aarch64 # kernel/bin-aarch64/kernel
make kernel ARCH=aarch64 KERNEL_LD=/path/to/ld.lld
./scripts/check-arch-neutral.sh # boundary check + aarch64 compile
```