diff --git a/Makefile.starkernel b/Makefile.starkernel index e38cddc..8faac39 100644 --- a/Makefile.starkernel +++ b/Makefile.starkernel @@ -556,6 +556,7 @@ KERNEL_OBJS := \ .PHONY: all clean clean-kernel kernel kernel-all .PHONY: qemu qemu-esp qemu-gdb +.PHONY: thumbdrive .PHONY: info help # ============================================================================== @@ -1001,8 +1002,42 @@ else ifeq ($(ARCH),riscv64) echo "=== Serial log: $$LOG ==="; \ echo "=== Extracting DOE CSV ==="; \ bash scripts/extract_doe.sh $$LOG $$CSV || true; \ - cp $$CSV $(DOE_LATEST_DIR)/riscv64.csv 2>/dev/null || true -endif + cp $$CSV $(DOE_LATEST_DIR)/riscv64.csv 2>/dev/null || true + endif + +# thumbdrive — build a generic UEFI-bootable GPT/FAT32 disk image that can be +# written directly to a USB thumbdrive (dd) and boots on real amd64 UEFI +# hardware (e.g. Beelink SER5) as well as under QEMU. This is the "generic +# thumbdrive bootable OS" image for the v2.5.0/SER5 bare-metal path: the +# monolithic loader embeds the whole kernel, so the ESP needs only the UEFI +# fallback boot path EFI/BOOT/BOOT.EFI. Storage on real hardware is the +# USB BOT/xHCI path (already live), not virtio. +thumbdrive: all + @mkdir -p $(BUILD_DIR) + @if ! which sgdisk >/dev/null 2>&1; then echo "Error: sgdisk not found. Install gdisk (apt-get install gdisk)."; exit 1; fi + @if ! which mkfs.fat >/dev/null 2>&1; then echo "Error: mkfs.fat not found. Install dosfstools (apt-get install dosfstools)."; exit 1; fi + @case "$(ARCH)" in \ + amd64) BOOTNAME="BOOTX64.EFI" ;; \ + aarch64) BOOTNAME="BOOTAA64.EFI" ;; \ + riscv64) BOOTNAME="BOOTRISCV64.EFI" ;; \ + *) echo "Error: no thumbdrive EFI boot name for ARCH=$(ARCH)"; exit 1 ;; \ + esac; \ + DISK=$(BUILD_DIR)/starkernel-thumbdrive.img; \ + rm -f $$DISK $(BUILD_DIR)/thumbdrive-esp.img; \ + dd if=/dev/zero of=$(BUILD_DIR)/thumbdrive-esp.img bs=512 count=131072 2>/dev/null; \ + mkfs.fat -F 32 -n "STARKERNEL" $(BUILD_DIR)/thumbdrive-esp.img >/dev/null 2>&1; \ + mmd -i $(BUILD_DIR)/thumbdrive-esp.img ::/EFI; \ + mmd -i $(BUILD_DIR)/thumbdrive-esp.img ::/EFI/BOOT; \ + mcopy -i $(BUILD_DIR)/thumbdrive-esp.img $(LOADER_EFI) ::/EFI/BOOT/$$BOOTNAME; \ + printf 'FS0:\\EFI\\BOOT\\%s\r\n' "$$BOOTNAME" > $(BUILD_DIR)/thumbdrive-startup.nsh; \ + mcopy -i $(BUILD_DIR)/thumbdrive-esp.img $(BUILD_DIR)/thumbdrive-startup.nsh ::/startup.nsh; \ + dd if=/dev/zero of=$$DISK bs=1M count=64 2>/dev/null; \ + sgdisk -n 1:2048:0 -t 1:ef00 -c 1:"EFI System" $$DISK >/dev/null 2>&1; \ + dd if=$(BUILD_DIR)/thumbdrive-esp.img of=$$DISK bs=512 seek=2048 conv=notrunc 2>/dev/null; \ + rm -f $(BUILD_DIR)/thumbdrive-esp.img $(BUILD_DIR)/thumbdrive-startup.nsh; \ + echo "Thumbdrive image: $$DISK"; \ + echo "Write to a USB stick with: dd if=$$DISK of=/dev/sdX bs=4M status=progress" + # qemu-esp — interactive dev boot from FAT directory (no disk image rebuild, # no auto-kill/timeout/DOE-injection logic — stays up until you quit it @@ -1136,6 +1171,7 @@ help: @echo " qemu — clean boot, serial tee'd live + logs/// + DOE CSV → doe/ (all arches)" @echo " qemu-esp — quick boot from FAT directory (amd64, aarch64)" @echo " qemu-gdb — boot with GDB stub on :1234" + @echo " thumbdrive — build generic GPT/FAT32 UEFI disk image (write to a USB stick with dd; real-hardware/SER5 path)" @echo "" @echo "QEMU display:" @echo " QEMU_DISPLAY=gtk — framebuffer window backend for 'qemu' goal (default: gtk)" diff --git a/capsules/BLOCK_MAP.md b/capsules/BLOCK_MAP.md index 1d5369c..9e28d25 100644 --- a/capsules/BLOCK_MAP.md +++ b/capsules/BLOCK_MAP.md @@ -1,5 +1,5 @@ # Capsule Block Manifest — Auto-generated - + diff --git a/disk/artemis.img b/disk/artemis.img index f5306e8..ef93081 100644 Binary files a/disk/artemis.img and b/disk/artemis.img differ