feat(boards): both systems on every board image, chosen at boot -- system=v3 or system=v4

boards/BRINGUP.md A6, FABRIC-3 SXLIII (ruled: one image, switch at boot).
A STARFORTH_V4 kernel carries v3 too; system= in the boot arguments
chooses, else the build's default (V4_DEFAULT: 1 for plain STARFORTH_V4
builds as before, 0 for board images).  make boot_image builds both and
always writes starforth.cfg / cmdline.txt with system=v3 first, and cleans
its ISA's objects first -- that clean was removing build/<arch>/SER5, not
the kernel's objects, until fixed here.

Each ISA: v3 by default (hash unchanged), v4 with system=v4 (538/538).
The SER5 image under OVMF: v3 as built, v4 after a one-word edit on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-14 15:11:47 -04:00
co-authored by Claude Opus 5.5
parent e729c64ba3
commit 1a4b163861
32 changed files with 74479 additions and 17 deletions
+15 -7
View File
@@ -620,8 +620,13 @@ endif
# ISA this kernel boots on has (DECOMPOSITION.md D-5), so the image is the
# same file for all three.
# ------------------------------------------------------------------------------
# V4_DEFAULT: with v4 built in, whether it runs when the boot arguments
# name no system (A6, 2026-10-14). 1 for a plain STARFORTH_V4=1 build, as
# before; board images build with both and V4_DEFAULT=0 -- v3 unless
# `system=v4` (root Makefile, boot_image).
V4_DEFAULT ?= 1
ifeq ($(STARFORTH_V4),1)
V4_DEFS := -DSTARFORTH_V4=1 -Iv4/include \
V4_DEFS := -DSTARFORTH_V4=1 -DSK_V4_DEFAULT=$(V4_DEFAULT) -Iv4/include \
-DV4_CELL_BITS=64 -DV4_NODE_WORDS=16384 -DV4_DATA_RING=30 -DV4_RET_RING=31
KERNEL_CFLAGS += $(V4_DEFS)
LOADER_CFLAGS += $(V4_DEFS)
@@ -1283,13 +1288,15 @@ else ifeq ($(BOARD_BOOT),uefi-esp)
boot_image: all
@mkdir -p $(BOARD_OUT)
@printf 'FS0:\\EFI\\BOOT\\%s\r\n' "$(EFI_BOOTNAME)" > $(BOARD_OUT)/startup.nsh
@rm -f $(BOARD_OUT)/starforth.cfg
$(if $(KERNEL_ARGS),@printf '%s\n' '$(KERNEL_ARGS)' > $(BOARD_OUT)/starforth.cfg)
@# The boot arguments, always written: system=v3 first, so that which
@# system runs is one word to change on the stick (A6); KERNEL_ARGS
@# after it, and a later system= wins.
@printf '%s\n' 'system=v3 $(KERNEL_ARGS)' > $(BOARD_OUT)/starforth.cfg
@bash scripts/mkdiskimage.sh --out $(BOARD_OUT)/$(BOARD_IMAGE) --table gpt \
--size-mib $(BOOT_IMAGE_SIZE_MIB) --label LITHOS \
$(LOADER_EFI):/EFI/BOOT/$(EFI_BOOTNAME) \
$(BOARD_OUT)/startup.nsh:/startup.nsh \
$(if $(KERNEL_ARGS),$(BOARD_OUT)/starforth.cfg:/starforth.cfg)
$(BOARD_OUT)/starforth.cfg:/starforth.cfg
@echo "$(BOARD_DESC)"
@echo "Write with: dd if=$(BOARD_OUT)/$(BOARD_IMAGE) of=/dev/sdX bs=4M conv=fsync status=progress"
else ifeq ($(BOARD_BOOT),rpi-native)
@@ -1303,14 +1310,15 @@ $(RPI5_DTB):
boot_image: v3/include/version.h $(RPI5_NATIVE_IMG) $(RPI5_DTB)
@mkdir -p $(BOARD_OUT)
@rm -f $(BOARD_OUT)/cmdline.txt
$(if $(KERNEL_ARGS),@printf '%s\n' '$(KERNEL_ARGS)' > $(BOARD_OUT)/cmdline.txt)
@# cmdline.txt, always: the firmware hands it to the kernel as the
@# devicetree's bootargs. system=v3 first, one word to change (A6).
@printf '%s\n' 'system=v3 $(KERNEL_ARGS)' > $(BOARD_OUT)/cmdline.txt
@bash scripts/mkdiskimage.sh --out $(BOARD_OUT)/$(BOARD_IMAGE) --table mbr \
--size-mib $(BOOT_IMAGE_SIZE_MIB) --label LITHOS \
boards/$(BOARD)/config.txt:/config.txt \
$(RPI5_NATIVE_IMG):/kernel_2712.img \
$(RPI5_DTB):/bcm2712-rpi-5-b.dtb \
$(if $(KERNEL_ARGS),$(BOARD_OUT)/cmdline.txt:/cmdline.txt)
$(BOARD_OUT)/cmdline.txt:/cmdline.txt
@echo "$(BOARD_DESC)"
@echo "Write with: dd if=$(BOARD_OUT)/$(BOARD_IMAGE) of=/dev/mmcblkX bs=4M conv=fsync status=progress"
else