feat(kernel): Artemis and Zuse from one disk -- the stick; virtio Artemis leaves v4

sk_v4_identity.c: a USB drive is this system's stick if its GPT has both StarshipOS partitions and
it is the disk the loader booted from (BootDisk's DiskGUID), or, when the boot was not from a
stick, the first such disk while none is attached. Then: its Artemis partition must carry a good
artemis_sig ('Artemis: the stick's signature is bad -- not used' otherwise), is attached first --
the first disk slot -- ('Artemis: the stick's partition attached'), Zuse's key is read from its
genesis marker, and its identity partition is checked and attached as before. Any other drive,
raw or GPT: 'USB: a drive that is not this system's stick -- not used'. On a pull the identity
partition is detached, then Artemis. sk_v4_identity_boot / sk_v4_run take the loader's BootDisk.
kernel_main.c: no virtio Artemis on the v4 path. kernel/Makefile: ARTDISK= attaches no virtio disk
(every QEMU target); ARTDISK stays for system=v3.

STICK.md 4 amended as ruled (R2): on v4 only this system's stick is used; users' drives minted by
this system's Zuse come with the users design after INSTALL. BRINGUP.md: Secure Boot off on every
PC (ruled 2026-10-28), RDRAND in QEMU, the SER5 smoke-test stick, A4 not on v4.

Tests: new stick_artemis (x3, no virtio disk), stick_zuse, two_sticks (replaces datastick),
artemis_unsigned, raw_ident; changed stick_boot, gpt_zuse, gpt_hotplug, midpull (replug) -- all
failed before, pass after (two test defects found and fixed: the signature's offset, the 63-char
log cut). Regression 20/20. Acceptance: amd64, aarch64, riscv64 to [zuse@Hera] ok>, POST 538/538,
dict_hash 0xfec8c47cfc6f437f; v4 suite and test-32 0 failures.

Plan: docs/v4.0.0/plans/2026-10-27-stick-4-one-disk.md, Task 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-28 16:10:33 -04:00
co-authored by Claude Opus 5.5
parent 1b45f5f85f
commit 1e8a6fed34
99 changed files with 16418 additions and 103 deletions
+15 -10
View File
@@ -127,6 +127,16 @@ CAPSULES_DIR ?= capsules
# disk/artemis.img and thumbdrives/zuse-thumb-ident.img never reaches a
# prompt. The two are a pair: Zuse's genesis marker is on that Artemis disk.
ARTDISK ?= disk/zuse-scratch/artemis.img
# ARTDISK= (empty) attaches no virtio disk. Since 2026-10-28 the v4 boot takes Artemis only from the
# stick (docs/v4.0.0/plans/2026-10-27-stick-4-one-disk.md, Task 4); ARTDISK stays for system=v3.
# Precomputed for the same comma reason as ZUSEDISK_QEMU_ARGS below.
ifneq ($(strip $(ARTDISK)),)
ARTDISK_QEMU_ARGS := -drive id=artdisk,file=$(ARTDISK),format=raw,if=none -device virtio-blk-pci,drive=artdisk
ARTDISK_QEMU_ARGS_RV := -drive id=artdisk,file=$(ARTDISK),format=raw,if=none -device virtio-blk-pci,drive=artdisk,addr=0x1
else
ARTDISK_QEMU_ARGS :=
ARTDISK_QEMU_ARGS_RV :=
endif
# XHCI_PORTS -- real top-level port count the qemu-xhci controller exposes on the
# xhci0.0 bus (p2 == p3 == this value; these are the SAME physical dual-role ports
# counted from the USB2 and USB3 register sets respectively, NOT additive to p2+p3 --
@@ -1063,8 +1073,7 @@ ifeq ($(ARCH),amd64)
-drive if=pflash,format=raw,readonly=on,file=$(OVMF_CODE) \
-drive if=pflash,format=raw,file=$(BUILD_DIR)/OVMF_VARS.fd \
-cdrom $(QEMU_ISO) -boot d \
-drive id=artdisk,file=$(ARTDISK),format=raw,if=none \
-device virtio-blk-pci,drive=artdisk \
$(ARTDISK_QEMU_ARGS) \
$(XHCI_ARGS_ROOT) \
$(ZUSEDISK_QEMU_ARGS) \
$(DATASTICK_QEMU_ARGS) \
@@ -1145,8 +1154,7 @@ else ifeq ($(ARCH),aarch64)
echo "-bios $$AAVMF_CODE"; \
fi) \
-drive if=virtio,format=raw,file=$(QEMU_ISO),media=cdrom \
-drive id=artdisk,file=$(ARTDISK),format=raw,if=none \
-device virtio-blk-pci,drive=artdisk \
$(ARTDISK_QEMU_ARGS) \
-device virtio-keyboard-pci,addr=0x3 \
$(XHCI_ARGS_SLOT4) \
$(ZUSEDISK_QEMU_ARGS) \
@@ -1236,8 +1244,7 @@ else ifeq ($(ARCH),riscv64)
$$PFLASH_VARS_ARG \
-drive id=hd0,file=$$DISK,format=raw,if=none \
-device virtio-blk-pci,drive=hd0,addr=0x2 \
-drive id=artdisk,file=$(ARTDISK),format=raw,if=none \
-device virtio-blk-pci,drive=artdisk,addr=0x1 \
$(ARTDISK_QEMU_ARGS_RV) \
-device virtio-keyboard-pci,addr=0x3 \
$(XHCI_ARGS_SLOT4) \
$(ZUSEDISK_QEMU_ARGS) \
@@ -1401,8 +1408,7 @@ rpi5-rehearsal: $(ZUSESTICK_DEP)
-machine virt,virtualization=on \
-cpu cortex-a76 \
-kernel $(RPI5_NATIVE_IMG) \
-drive id=artdisk,file=$(ARTDISK),format=raw,if=none \
-device virtio-blk-pci,drive=artdisk \
$(ARTDISK_QEMU_ARGS) \
-device virtio-keyboard-pci,addr=0x3 \
$(XHCI_ARGS_SLOT4) \
$(ZUSEDISK_QEMU_ARGS) \
@@ -1538,8 +1544,7 @@ ifeq ($(ARCH),amd64)
-drive if=pflash,format=raw,readonly=on,file=$$OVMF_CODE \
-drive if=pflash,format=raw,file=$(BUILD_DIR)/OVMF_VARS.fd \
-drive format=raw,file=fat:rw:$(BUILD_DIR)/esp \
-drive id=artdisk,file=$(ARTDISK),format=raw,if=none \
-device virtio-blk-pci,drive=artdisk \
$(ARTDISK_QEMU_ARGS) \
-no-reboot
else ifeq ($(ARCH),aarch64)