ReviewOS

home-lang/home-os

build.sh: a real `rpi5` pipeline (Home compile → assemble boot → link `linker-rpi5.ld` → objcopy → `kernel_2712.img`) and removal of the fake `all`/`unified` steps

#54
Open chris opened this 8 days ago ·
8 days ago

Epic: #113 · Milestone: MC1 — Toolchain: aarch64

Why

scripts/build.sh rpi5 (cmd_rpi5, L477–568) assembles boot.s from the compiler repo, then hits an unconditional exit 1 ("no entry point yet"); the objcopy/firmware staging after it is unreachable. cmd_all's compile_module() is printf 'OK (pending compiler)' and its "Linking Kernel" step links nothing; unified arm64 copies boot.s and prints "configured". The Pi CI workflow calls these and swallows the failures with || true. Also: the staging expects start4.elf/fixup4.dat, which are Pi 4 files — the Pi 5 bootloader lives in EEPROM and loads the kernel image directly; only the DTB (bcm2712-rpi-5-b.dtb, plus the bcm2712d0 variant) and config.txt are needed.

Tasks

  • cmd_rpi5: compile the Pi entry (kernel/src/arch/arm64/boot.home chain, see #57) with "$HOME_COMPILER" build --kernel --target=aarch64-freestanding for every file in a new scripts/pi5-file-set.txt; assemble kernel/src/arch/arm64/boot.s with zig cc -target aarch64-freestanding; link with kernel/linker-rpi5.ld (load address 0x80000, .text.boot first); zig objcopy -O binary → build/rpi5/boot/kernel_2712.img.
  • Stage config.txt (from #57's corrected version), DTBs fetched by scripts/pi/fetch-firmware-dtb.sh (pinned firmware tag, checksum), and an overlays/ dir if needed.
  • --profile=tv selects the media-center file set and initramfs contents; --profile=serial builds the bring-up kernel.
  • Delete the theatre: remove compile_module fakery in cmd_all, make unified arm64 call cmd_rpi5, and make every failure exit nonzero naming the blocker (S1 discipline).
  • Toolchain check: prefer zig for assembler/linker/objcopy (already the x86 pattern) so no aarch64-linux-gnu-* binutils are required; document brew install zig qemu.

Acceptance

./scripts/build.sh rpi5 --profile=serial produces build/rpi5/boot/{kernel_2712.img,config.txt,bcm2712-rpi-5-b.dtb} from a clean checkout on macOS and on the x86 CI runner; build.sh all no longer prints success without compiling.

Size: M · Depends on: #52 · Blocks: #55, #63

Sign in to comment on this issue.