diff --git a/.clang-tidy b/.clang-tidy index fc5ec979..4f74e301 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,7 +14,7 @@ Checks: > WarningsAsErrors: [ ] -HeaderFilterRegex: '^src/.*|^include/.*' +HeaderFilterRegex: '^v3/(src|include)/.*|^kernel/(src|include)/.*' AnalyzeTemporaryDtors: false FormatStyle: none diff --git a/.clang-tidy-ignore b/.clang-tidy-ignore index a9f4fa42..53a4a208 100644 --- a/.clang-tidy-ignore +++ b/.clang-tidy-ignore @@ -6,8 +6,8 @@ # clang-tidy will ALWAYS false-positive them. Always. # --------------------------------------------------------- -src/platform/** -src/platform/* +v3/src/platform/** +v3/src/platform/* # --------------------------------------------------------- # Skip test infrastructure @@ -15,8 +15,8 @@ src/platform/* # and stress edge conditions clang-tidy will never grok. # --------------------------------------------------------- -src/test_runner/** -src/test_runner/* +v3/src/test_runner/** +v3/src/test_runner/* # --------------------------------------------------------- # Skip word definitions generated or "mechanically patterned" @@ -24,30 +24,30 @@ src/test_runner/* # clang-tidy gives ZERO useful feedback on them. # --------------------------------------------------------- -src/word_source/string_words.c -src/word_source/block_words.c -src/word_source/arithmetic_words.c -src/word_source/mixed_arithmetic_words.c -src/word_source/return_stack_words.c -src/word_source/defining_words.c -src/word_source/stack_words.c -src/word_source/logical_words.c -src/word_source/memory_words.c -src/word_source/io_words.c -src/word_source/dictionary_words.c -src/word_source/dictionary_manipulation_words.c -src/word_source/vocabulary_words.c -src/word_source/system_words.c -src/word_source/starforth_words.c -src/word_source/editor_words.c -src/word_source/format_words.c +v3/src/word_source/string_words.c +v3/src/word_source/block_words.c +v3/src/word_source/arithmetic_words.c +v3/src/word_source/mixed_arithmetic_words.c +v3/src/word_source/return_stack_words.c +v3/src/word_source/defining_words.c +v3/src/word_source/stack_words.c +v3/src/word_source/logical_words.c +v3/src/word_source/memory_words.c +v3/src/word_source/io_words.c +v3/src/word_source/dictionary_words.c +v3/src/word_source/dictionary_manipulation_words.c +v3/src/word_source/vocabulary_words.c +v3/src/word_source/system_words.c +v3/src/word_source/starforth_words.c +v3/src/word_source/editor_words.c +v3/src/word_source/format_words.c # --------------------------------------------------------- # Skip headers belonging to the word system # Same reason: no signal, infinite false positives. # --------------------------------------------------------- -src/word_source/include/* +v3/src/word_source/include/* # --------------------------------------------------------- # Skip anything that implements performance knobs, @@ -55,15 +55,15 @@ src/word_source/include/* # These are meant to be weird, and tidy can't reason about them. # --------------------------------------------------------- -src/stack_management.c -src/profiler.c -src/vm_debug.c -src/physics_runtime.c +v3/src/stack_management.c +v3/src/profiler.c +v3/src/vm_debug.c +v3/src/physics_runtime.c # --------------------------------------------------------- # Skip integration + stress torture-tests. # These *intentionally* do UB-like bullshit. # --------------------------------------------------------- -src/test_runner/modules/*stress* -src/test_runner/modules/*integration* +v3/src/test_runner/modules/*stress* +v3/src/test_runner/modules/*integration* diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index b6348859..8981e7d3 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -224,43 +224,43 @@ changes with any new C word registration). ```bash # Build kernel for a given architecture (amd64 default) -make -f Makefile.starkernel ARCH=amd64 -make -f Makefile.starkernel ARCH=aarch64 -make -f Makefile.starkernel ARCH=riscv64 +make -f kernel/Makefile ARCH=amd64 +make -f kernel/Makefile ARCH=aarch64 +make -f kernel/Makefile ARCH=riscv64 # Run in QEMU with OVMF -make -f Makefile.starkernel qemu -make -f Makefile.starkernel ARCH=aarch64 qemu -make -f Makefile.starkernel ARCH=riscv64 qemu +make -f kernel/Makefile qemu +make -f kernel/Makefile ARCH=aarch64 qemu +make -f kernel/Makefile ARCH=riscv64 qemu # Clean -make -f Makefile.starkernel clean +make -f kernel/Makefile clean ``` Output: `build//kernel/starkernel_loader.efi` + `build//kernel/starkernel_kernel.elf`. Two independently tracked version strings flow into the generated `include/version.h`: -`VERSION` (`Makefile.starkernel` — the embedded StarForth engine version, currently `3.1.0`; +`VERSION` (`kernel/Makefile` — the embedded StarForth engine version, currently `3.1.0`; note this does **not** auto-sync with the standalone StarForth repo's own version) and -`LITHOS_VERSION` (`Makefile.starkernel` — the kernel version, currently **`2.0.0`**; +`LITHOS_VERSION` (`kernel/Makefile` — the kernel version, currently **`2.0.0`**; corrected 2026-09-19 — this file said `2.0.1`, but `FABRIC-3.md` §I.2 rolled it back to `2.0.0` on 2026-09-04 because `2.0.1` names the SER5 hardware-track line and claims hardware progress not yet verified. The versioning policy is **semantic, not sequential** — see the -roadmap table in `Makefile.starkernel` before choosing any version). +roadmap table in `kernel/Makefile` before choosing any version). ### Build configuration (Kconfig — real, wired, not vestigial) Every kernel-only knob (`STARFORTH_ENABLE_VM`, `PARITY_MODE`, the shared physics/heartbeat family, etc.) is an optional Kconfig symbol defined across `Kconfig`, `Kconfig.arch`, `Kconfig.heartbeat`, `Kconfig.kernel`, `Kconfig.physics`, `Kconfig.variant` (~40 symbols -total). `Makefile.starkernel` pulls its defaults from this system via a `kconfig_bool(...)` +total). `kernel/Makefile` pulls its defaults from this system via a `kconfig_bool(...)` mechanism — e.g. `STARFORTH_ENABLE_VM` defaults to **1** (confirmed at -`Makefile.starkernel:61`), meaning a plain `make -f Makefile.starkernel` already builds with +`kernel/Makefile:61`), meaning a plain `make -f kernel/Makefile` already builds with VM + capsule-birth + ACL active. A bare invocation uses the defaults it always has: ```bash -make -f Makefile.starkernel ARCH=amd64 menuconfig -make -f Makefile.starkernel ARCH=amd64 kernel_amd64_defconfig +make -f kernel/Makefile ARCH=amd64 menuconfig +make -f kernel/Makefile ARCH=amd64 kernel_amd64_defconfig ``` ### Hosted VM (vendored, for local sanity only) @@ -277,7 +277,7 @@ StarForth repo) were removed 2026-08-15 — they referenced in the actual generated `include/version.h` (which only has `STARFORTH_VERSION`, `STARFORTH_ARCH`, `STARFORTH_TARGET`, `STARFORTH_TIMESTAMP`, `STARFORTH_VERSION_FULL`, `LITHOS_VERSION`, `LITHOS_VERSION_STR`), so they could never have worked. Bump versions by hand-editing the `VERSION`/ -`LITHOS_VERSION` variables in `Makefile.starkernel` instead. Report the broken targets if +`LITHOS_VERSION` variables in `kernel/Makefile` instead. Report the broken targets if asked, don't silently fix them. ### Important: Linker Configuration @@ -298,9 +298,9 @@ The vendored hosted `make` build (above) is NEVER used to validate kernel change ```bash # Run in this exact order for every kernel change: -make -f Makefile.starkernel ARCH=amd64 clean qemu -make -f Makefile.starkernel ARCH=aarch64 clean qemu -make -f Makefile.starkernel ARCH=riscv64 clean qemu +make -f kernel/Makefile ARCH=amd64 clean qemu +make -f kernel/Makefile ARCH=aarch64 clean qemu +make -f kernel/Makefile ARCH=riscv64 clean qemu ``` **QEMU rule — non-negotiable:** Only ONE QEMU instance may run at a time, always in the @@ -475,7 +475,7 @@ listed in `proof/ROOT` (corrected 2026-09-19; this file said 23, and `proof/COVE said 52 all along). **Read `proof/COVERAGE.md` first**: its stated goal is not a green build but "identify precisely what cannot be proven and why — the boundary between 'formally verified' and 'not, for this specific reason'." Run `isabelle build -D proof/` -directly; neither `Makefile` nor `Makefile.starkernel` in this repo defines an +directly; neither `Makefile` nor `kernel/Makefile` in this repo defines an `isabelle-build`/`isabelle-check` target (unlike the standalone StarForth repo, which has a broken one — this repo simply doesn't have the target at all, so there's nothing to mistakenly invoke). @@ -495,7 +495,7 @@ status for kernel work. - **Strict ANSI C99** — No GNU extensions, no C++ features - **Zero warnings target, with four explicit exceptions — corrected 2026-08-18, previous - claim was wrong.** Build with `-Wall -Wextra -Werror`, but `Makefile.starkernel` carries + claim was wrong.** Build with `-Wall -Wextra -Werror`, but `kernel/Makefile` carries `-Wno-error=unused-parameter -Wno-error=shift-negative-value -Wno-error=sign-compare -Wno-error=missing-field-initializers` — those four classes are enabled (still visible as warnings) but deliberately downgraded from fatal, everything else is. The previous version diff --git a/Doxyfile b/Doxyfile index 517db1c4..4d6cd19a 100644 --- a/Doxyfile +++ b/Doxyfile @@ -933,10 +933,12 @@ WARN_LOGFILE = docs/api/doxygen_warnings.log # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = include \ - src \ - src/word_source \ - src/test_runner \ +INPUT = v3/include \ + v3/src \ + v3/src/word_source \ + v3/src/test_runner \ + kernel/include \ + kernel/src \ README.md # This tag can be used to specify the character encoding of the source files @@ -2366,9 +2368,10 @@ SEARCH_INCLUDES = YES # RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = include \ - src/word_source/include \ - src/test_runner/include +INCLUDE_PATH = v3/include \ + kernel/include \ + v3/src/word_source/include \ + v3/src/test_runner/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/Kconfig.arch b/Kconfig.arch index 9cc52bee..21e5bdc0 100644 --- a/Kconfig.arch +++ b/Kconfig.arch @@ -5,7 +5,7 @@ choice default ARCH_AMD64 help Selects the value passed as ARCH= to whichever Makefile - (Makefile or Makefile.starkernel) is driven from this config. + (Makefile or kernel/Makefile) is driven from this config. Both Makefiles already accept "amd64"/"aarch64"/"riscv64" as canonical spellings (each has its own alias-normalizing logic for other spellings like x86_64/arm64/riscv), so this choice diff --git a/Kconfig.heartbeat b/Kconfig.heartbeat index eb6750ea..c0880d72 100644 --- a/Kconfig.heartbeat +++ b/Kconfig.heartbeat @@ -17,7 +17,7 @@ config HEARTBEAT_THREAD_ENABLED builds without needing a special case. This is UI/model correctness (menuconfig can't offer a choice LithosAnanke has no way to honor -- there are no pthreads in a freestanding kernel), - not the sole enforcement mechanism: Makefile.starkernel additionally + not the sole enforcement mechanism: kernel/Makefile additionally keeps its own unconditional `VM_FEATURE_OVERRIDES += -DHEARTBEAT_THREAD_ENABLED=0` post-override exactly as it was before this migration. Deliberately redundant with the `depends diff --git a/Kconfig.kernel b/Kconfig.kernel index bb8cc681..9cf88534 100644 --- a/Kconfig.kernel +++ b/Kconfig.kernel @@ -11,7 +11,7 @@ config STARFORTH_ENABLE_VM kernel that only reaches the M0-M6 hardware milestones (console, PMM, VMM, interrupts, timers, kmalloc) with no FORTH interpreter, no capsules, no "ok" REPL. Gates a large source-file selection - block in Makefile.starkernel, not just a handful of -D flags. + block in kernel/Makefile, not just a handful of -D flags. config PARITY_MODE bool "Deterministic parity harness mode (PARITY_MODE)" diff --git a/Makefile b/Makefile index d3757f86..e2d16cb5 100644 --- a/Makefile +++ b/Makefile @@ -1,1340 +1,159 @@ # ============================================================================== -# StarForth Build System - The Fastest Forth in the West! -# ============================================================================== +# LithosAnanke / StarForth -- top-level Makefile # -# Quick Start: -# make - Standard optimized build (auto ARCH, TARGET=standard) -# make TARGET=fastest - Maximum performance build -# make ARCH=arm64 TARGET=fastest - Build for arm64 (e.g., Raspberry Pi 4) -# make help - Show all available targets +# Thin dispatcher. The real build lives in: +# v3/Makefile -- hosted StarForth v3 (Linux userland VM, POST, DoE) +# kernel/Makefile -- LithosAnanke kernel (UEFI loader, kernel ELF, QEMU) +# boards// -- one directory per physical target (board.mk + boot files) +# docs/book/Makefile -- the single LaTeX book (build/docs/*.pdf) +# Every sub-make runs from this directory, so paths are always repo-relative. # +# TARGET is either a board (SER5 RASPI MILKV ZYNQ7020), a hosted v3 profile +# (standard fast fastest turbo asan ...), or empty: +# +# make [all] every board that has a kernel port, the +# hosted v3 build, and the book +# make [all] TARGET= that board's boot image + its book +# make [all] TARGET= hosted v3 build with that profile +# +# make boot_image TARGET= only the board's boot image +# make boot_images every board that has a kernel port +# make docs [TARGET=] the book; a board adds its appendix +# +# make clean all of build/ except build/cache/ +# make clean TARGET= the board's image + book and its ISA's kernel objects +# make clean TARGET= build// for every arch +# make clean-docs build/docs/ +# +# make kernel ARCH= [GOAL=g] kernel/Makefile goal (default: all) +# make boards list boards and whether they can be built +# make goes to v3/Makefile (make help-hosted) # ============================================================================== -# ============================================================================== -# CONFIGURATION -# ============================================================================== +# Board name (as typed on the command line) -> boards/ directory. +BOARD_DIR_SER5 := ser5 +BOARD_DIR_RASPI := raspi +BOARD_DIR_MILKV := milkv +BOARD_DIR_ZYNQ7020 := zynq7020 +BOARDS := SER5 RASPI MILKV ZYNQ7020 +empty := +space := $(empty) $(empty) -VERSION ?= 3.2.0 -CC = gcc +board_field = $(if $(BOARD_DIR_$(1)),$(shell sed -n 's/^$(2) *:= *//p' boards/$(BOARD_DIR_$(1))/board.mk)) +board_arch = $(call board_field,$(1),BOARD_ARCH) +# A board can be built once its ISA's kernel port exists. +board_ready = $(if $(call board_arch,$(1)),$(wildcard kernel/src/arch/$(call board_arch,$(1))/.)) -# Isabelle configuration -# NOTE: Isabelle must be installed separately and available on PATH -# See docs/DEVELOPER.md for installation instructions -ISABELLE ?= isabelle +READY_BOARDS := $(foreach b,$(BOARDS),$(if $(call board_ready,$(b)),$(b))) +UNREADY_BOARDS := $(filter-out $(READY_BOARDS),$(BOARDS)) -# Architecture / target selection -ARCH ?= $(shell uname -m) -ARCH := $(strip $(ARCH)) -TARGET ?= standard -TARGET := $(strip $(TARGET)) +TARGET := $(strip $(TARGET)) +BOARD_DIR := $(if $(TARGET),$(BOARD_DIR_$(TARGET))) -# Friendly guardrail: 32-bit builds are not supported -unsupported_32bit_arches := i386 i486 i586 i686 x86 armv6 armv7 armv7l arm -ifneq ($(filter $(ARCH),$(unsupported_32bit_arches)),) - $(error StarForth targets 64-bit platforms only. ARCH='$(ARCH)' is unsupported. Please build on amd64/arm64/raspi/riscv64.) -endif +SUBMAKE := $(MAKE) --no-print-directory -# Canonical architecture normalization (x86_64→amd64, aarch64→arm64, etc.) -canon_arch = $(strip $(if $(filter x86_64,$1),amd64,$(if $(filter amd64,$1),amd64,$(if $(filter aarch64 arm64,$1),arm64,$(if $(filter riscv riscv64,$1),riscv64,$1))))) -ARCH_DIR := $(call canon_arch,$(ARCH)) -# Normalize ARCH for consistent ifeq matching -ARCH := $(call canon_arch,$(ARCH)) - -# Kconfig bridge (menuconfig/xconfig/config/oldconfig/*_defconfig). See -# mk/Kconfig.mk for why KCONFIG_ARCH_DIR must be set here, before include. -# .DEFAULT_GOAL is pinned explicitly because mk/Kconfig.mk's first rule -# would otherwise silently become Make's default goal, since it's included -# before this Makefile's own `all:` target is defined below. .DEFAULT_GOAL := all -KCONFIG_ARCH_DIR := $(ARCH_DIR) -include mk/Kconfig.mk - -# Kconfig platform-mode choice (Phase 5): PLATFORM_DEFAULT/PLATFORM_MINIMAL -# in Kconfig.variant (PLATFORM_L4RE removed -- L4Re support is historical, -# see the "Platform support" section below). Must run this early -- before -# anything below that branches on MINIMAL -- since Make evaluates a Makefile -# top-to-bottom and a variable's value at the point an `ifdef` is reached is -# whatever it resolved to *so far*, not its final value. Only applies when a -# developer hasn't already set MINIMAL explicitly (command line or -# environment) -- `ifdef` in the "Platform support" section below cares -# about definedness, not value, so this can't reuse the kconfig_bool/ -# kconfig_int pattern (those always define their target variable once -# active). Checked with $(origin ...) so an explicit `make MINIMAL=1` (or -# unset) always wins over whatever .config says. -ifeq ($(KCONFIG_ACTIVE),1) -ifeq ($(origin MINIMAL),undefined) -ifeq ($(CONFIG_PLATFORM_MINIMAL),y) -MINIMAL := 1 -endif -endif -endif - -ifeq ($(ARCH),amd64) - ARCH_NAME = x86_64 - ARCH_FLAGS = -march=native - ARCH_DEFINES = -DARCH_X86_64=1 - ASM_SYNTAX = -masm=intel -else ifeq ($(ARCH),arm64) - ARCH_NAME = ARM64 - ARCH_FLAGS = -march=armv8-a+crc+simd -mtune=cortex-a72 - ARCH_DEFINES = -DARCH_ARM64=1 - ASM_SYNTAX = -else ifeq ($(ARCH),raspi) - ARCH_NAME = Raspberry Pi 4 (ARM64) - ARCH_FLAGS = -march=armv8-a+crc+simd -mtune=cortex-a72 - ARCH_DEFINES = -DARCH_ARM64=1 -DRASPBERRY_PI_BUILD=1 - ASM_SYNTAX = -else ifeq ($(ARCH),riscv64) - ARCH_NAME = RISC-V 64 (QEMU) - ARCH_FLAGS = -march=rv64gc -mabi=lp64d -mcmodel=medany - ARCH_DEFINES = -DARCH_RISCV64=1 - ASM_SYNTAX = -else ifeq ($(ARCH),riscv) - ARCH_NAME = RISC-V 64 (QEMU) - ARCH_FLAGS = -march=rv64gc -mabi=lp64d -mcmodel=medany - ARCH_DEFINES = -DARCH_RISCV64=1 - ASM_SYNTAX = -else - $(warning Unknown architecture: $(ARCH), using generic flags) - ARCH_NAME = generic - ARCH_FLAGS = - ARCH_DEFINES = - ASM_SYNTAX = -endif - -# Compiler flags -# Feature switches (default: enabled) -# Physics/SSM knob family: repointed through the Kconfig bridge (see -# mk/Kconfig.mk's kconfig_bool/kconfig_int) as of the Kconfig migration's -# Phase 3. Each call below is a drop-in replacement for a bare `?=`: when -# no build/$(ARCH)/.config exists (KCONFIG_ACTIVE unset), it's exactly -# `VAR ?= default`, identical to before; once a .config exists, the -# Kconfig-fed value takes over. `make VAR=x` on the command line always -# wins regardless of which branch fires. -# -# STRICT_PTR: VM memory bounds checking on every pointer access -# Default: 1 (enabled). Disable only for raw benchmarking comparisons. -$(eval $(call kconfig_bool,STRICT_PTR,1)) - -# ENABLE_HOTWORDS_CACHE: Physics-driven hot-words cache (1.78× speedup on dictionary lookups) -# Default: 1 (enabled - experiments show cache is optimal) -# Set ENABLE_HOTWORDS_CACHE=0 to disable (for research comparison only) -$(eval $(call kconfig_bool,ENABLE_HOTWORDS_CACHE,0)) - -# ENABLE_PIPELINING: Speculative execution via word transition prediction -# Default: 1 (enabled - experiments show pipelining is optimal) -# Set ENABLE_PIPELINING=0 to disable (for research comparison only) -# NOTE: As of 2025-11-19, all future experiments use both cache and pipelining enabled -$(eval $(call kconfig_bool,ENABLE_PIPELINING,0)) - -# EMERGENCY_CONSOLE_ENABLED: 1 = REPL recovers from errors and continues (interactive fallthrough) -# 0 = errors are non-recoverable; REPL exits and vm_fault_handler() is called instead -# Default: 1 (dev/recovery builds) -# Set EMERGENCY_CONSOLE_ENABLED=0 for production, embedded, or high-security builds -# where no interactive fallthrough surface should exist. -# Heartbeat family: repointed through the Kconfig bridge (Phase 4). Same -# drop-in-replacement-for-`?=` behavior as the physics/SSM family (Phase 3). -$(eval $(call kconfig_bool,EMERGENCY_CONSOLE_ENABLED,1)) - -# Heartbeat configuration -# HEARTBEAT_THREAD_ENABLED: 1 = run vm_tick() in background thread (OPTIMAL), 0 = inline (legacy) -# Default: 1 (experiments show threaded heartbeat is optimal for adaptive tuning) -# NOTE: As of 2025-11-19, all future experiments use heartbeat enabled -$(eval $(call kconfig_bool,HEARTBEAT_THREAD_ENABLED,1)) - -# HEARTBEAT_TICK_NS: Wake frequency for heartbeat thread (default 1ms) -$(eval $(call kconfig_int,HEARTBEAT_TICK_NS,10000)) - -# HEARTBEAT_CHECK_FREQUENCY / HEARTBEAT_WINDOW_TUNING_FREQUENCY / -# HEARTBEAT_SLOPE_VALIDATION_FREQUENCY: previously unwired in the hosted -# Makefile -- no `?=` and no -D forwarding existed for any of these three -# before Phase 4, so hosted builds always got starforth_config.h's bare -# defaults (256/1000/5000) with no override mechanism at all. The kernel -# Makefile has always had opt-in forwarding for them (VM_FEATURE_FLAG_VARS). -# Promoted here for parity, same treatment as Phase 3's SSM_* knobs. -$(eval $(call kconfig_int,HEARTBEAT_CHECK_FREQUENCY,256)) -$(eval $(call kconfig_int,HEARTBEAT_WINDOW_TUNING_FREQUENCY,1000)) -$(eval $(call kconfig_int,HEARTBEAT_SLOPE_VALIDATION_FREQUENCY,5000)) - -# HISTORICAL: L4Re had no pthreads, so this forced HEARTBEAT_THREAD_ENABLED -# off whenever L4RE=1 was set. L4Re support is no longer an active target; -# see "Platform support" below. -# ifeq ($(L4RE),1) -# HEARTBEAT_THREAD_ENABLED := 0 -# endif - -# Feedback Loop Toggle Switches (for systematic performance measurement) -# ============================================================================ -# These allow turning each feedback loop on/off to measure additive performance gains -# EXP_00-BASELINE: all loops OFF (plain FORTH-79) -# EXP_01: Loop #1 ON -# EXP_02: Loops #1-2 ON -# ... etc, building cumulatively to measure each loop's contribution - -# ============================================================================== -# SSM (Steady State Machine) Configuration - Data-Driven Architecture -# ============================================================================== -# Based on 2^7 DoE with 300 reps (128 configs, 38,400 runs). -# Top 5% analysis (speed + stability) reveals optimal loop combinations. -# -# Experimentally Validated Architecture: -# L1 (heat_tracking): DISABLED (harmful in 86% of top configs) -# L4 (pipelining_metrics): DISABLED (harmful in 100% of top configs) -# L7 (adaptive_heartrate): ALWAYS ON (beneficial in 71% of top configs) -# L2, L3, L5, L6: Runtime-controlled by L8 (workload-dependent) -# L8 (Jacquard): 4-bit mode selector (16 modes: C0-C15) -# -# L8 dynamically controls L2/L3/L5/L6 based on entropy, CV, and temporal metrics. -# Top 5% validated modes: C4, C7, C9, C11, C12 (see src/ssm_jacquard.c) - -# Tuning Knobs (Physics-driven Optimization System) -# ============================================================================ -# Knob #7: ROLLING_WINDOW_SIZE (Initial execution history capture) -# - Default: 4096 (conservative, ensures statistical significance at cold start) -# - Usage: make ROLLING_WINDOW_SIZE=8192 (larger for complex workloads) -# or ROLLING_WINDOW_SIZE=2048 (smaller for memory constraints) -# - System AUTOMATICALLY shrinks during execution if diminishing returns detected -# - Window starts conservative, self-tunes down if pattern diversity plateaus -# - Window becomes "warm" (representative) after N executions, then adapts -$(eval $(call kconfig_int,ROLLING_WINDOW_SIZE,4096)) - -# Knob #6: TRANSITION_WINDOW_SIZE (Pipelining context depth) -# - Default: 8 (see starforth_config.h for the exact shipped value) -# - Usage: make TRANSITION_WINDOW_SIZE=1 (or 2, 4 for shallower context) -# - Empirically tuned via binary chop: 1 vs 2 vs 4 vs 8 -$(eval $(call kconfig_int,TRANSITION_WINDOW_SIZE,8)) - -# SPECULATION_THRESHOLD_Q48 / SPECULATION_DEPTH / MIN_SAMPLES_FOR_SPECULATION / -# MISPREDICTION_COST_Q48 / MINIMUM_PREFETCH_ROI: previously hardcoded, -# non-overridable #define in physics_pipelining_metrics.h -- no Makefile -# knob or -D forwarding existed for any of these five before Phase 5. -# Promoted here for parity, same treatment as Phase 3/4's other -# previously-unwired constants. All five are Q48.16-fixed-point or plain -# counts meaningful only when ENABLE_PIPELINING is on; see Kconfig.physics -# for the exact hex/decimal defaults. MINIMUM_PREFETCH_ROI's default was -# corrected from the long-shipped 0x11999A to 0x1199A (rev y) -- the -# former was ~17.6 in Q48.16, not the documented 1.10. -$(eval $(call kconfig_int,SPECULATION_THRESHOLD_Q48,0x8000)) -$(eval $(call kconfig_int,SPECULATION_DEPTH,1)) -$(eval $(call kconfig_int,MIN_SAMPLES_FOR_SPECULATION,10)) -$(eval $(call kconfig_int,MISPREDICTION_COST_Q48,0x190000)) -$(eval $(call kconfig_int,MINIMUM_PREFETCH_ROI,0x1199A)) - -# Knobs #8-11: Adaptive Window Shrinking Control -# ============================================================================ -# These control how aggressively the rolling window learns and adapts -# (NOT the initial window size - that's ROLLING_WINDOW_SIZE above) - -# Knob #8: ADAPTIVE_SHRINK_RATE (percentage to retain when shrinking) -# - Default: 50 (shrink to 50% = discard 50% each cycle) -# - Range: 50-95 (lower = more aggressive, higher = more conservative) -# - Usage: make ADAPTIVE_SHRINK_RATE=75 (slower learning) or 90 (slow learning) -$(eval $(call kconfig_int,ADAPTIVE_SHRINK_RATE,50)) - -# Knob #9: ADAPTIVE_MIN_WINDOW_SIZE (floor to prevent over-shrinking) -# - Default: 256 (never shrink below 256 word IDs) -# - Range: 64-1024 (smaller = leaner, larger = safer) -# - Usage: make ADAPTIVE_MIN_WINDOW_SIZE=512 (conservative) or 128 (lean) -$(eval $(call kconfig_int,ADAPTIVE_MIN_WINDOW_SIZE,256)) - -# Knob #10: ADAPTIVE_CHECK_FREQUENCY (how often to measure diversity) -# - Default: 512 (check after every 512 executions) -# - Range: 32-1024 (more = faster response, less = less overhead) -# - Usage: make ADAPTIVE_CHECK_FREQUENCY=128 (responsive) or 256 (default of comparable knobs) -$(eval $(call kconfig_int,ADAPTIVE_CHECK_FREQUENCY,512)) - -# Knob #11: ADAPTIVE_GROWTH_THRESHOLD (growth rate that signals saturation) -# - Default: 5 (shrink when growth < 5%) -# - Range: 0-10 (lower = eager shrinking, higher = cautious) -# - Usage: make ADAPTIVE_GROWTH_THRESHOLD=0 (aggressive) or 1 (less conservative) -$(eval $(call kconfig_int,ADAPTIVE_GROWTH_THRESHOLD,5)) - -# Knob #11a: INITIAL_DECAY_SLOPE_Q48 (Starting decay slope for inference engine) -# - Default: 21845 (1/3 in Q48.16 format, = 0.333... starting slope) -# - Range: 13107-43691 (0.2 to 0.67 in Q48.16) -# - Usage: make INITIAL_DECAY_SLOPE_Q48=13107 (0.2) or 32768 (0.5) or 43691 (0.67) -# - DoE: OPP #3 tests 0.2, 0.33, 0.5, 0.67 to find optimal starting point for convergence -# - Note: Inference engine adapts this value at runtime; this is just the cold-start value -$(eval $(call kconfig_int,INITIAL_DECAY_SLOPE_Q48,21845)) - -# Knob #11b: DECAY_MIN_INTERVAL (Minimum time before decay applies) -# - Default: 500 (nanoseconds) -# - Range: 500-5000 (balance between decay sensitivity and overhead) -# - Usage: make DECAY_MIN_INTERVAL=1000 (slower decay) or 2000 (slower still) -# - NOTE: as of the tick-based Loop #3 decay conversion (rev t, see -# docs/working/architecture/VM-FLEET-ATTRACTOR-DESIGN-20260705.md), -# Loop #3 no longer consults this value at all -- decay is gated on -# elapsed heartbeat ticks, not elapsed nanoseconds. Kept only because -# doe_metrics.c still reports it as a metrics field; informational, -# not load-bearing. -$(eval $(call kconfig_int,DECAY_MIN_INTERVAL,500)) - -# Knob #11d: HEARTBEAT_INFERENCE_FREQUENCY (How often to run inference engine) -# - Default: 1000 (ticks between inference runs) -# - Set VERY HIGH (999999) to effectively disable inference (static mode) -# - Set LOW for frequent inference (adaptive mode) -# - DoE: OPP #3 tests 999999 (static, no Loop #6) vs 1000 (adaptive, with Loop #6) -# - Measures: Inference engine cost vs benefit in optimized performance -$(eval $(call kconfig_int,HEARTBEAT_INFERENCE_FREQUENCY,1000)) - -# Knob #12: DECAY_RATE_PER_US_Q16 (Heat decay rate in Q16 fixed-point) -# - Default: 1 (1/65536 heat units decayed per microsecond) -# - Range: 0-65536 (0 = no decay, 65536 = 1 heat/µs) -# - Half-life: ~6.5 seconds at default (100-heat word → 50-heat in 6.5s) -# - Usage: make DECAY_RATE_PER_US_Q16=2 (faster decay) or 0 (no decay for baseline) -# - DoE: Vary this to measure impact of heat decay on performance -$(eval $(call kconfig_int,DECAY_RATE_PER_US_Q16,1)) - -# L8 Jacquard mode selector thresholds (ssm_jacquard.h). Previously unwired -- -# no Makefile knob or -D forwarding existed for these before the Kconfig -# migration's Phase 3; ssm_jacquard.h's own #ifndef fallback was the only -# place any of these five values lived. See Kconfig.physics for the -# rationale behind modeling the four float thresholds as Kconfig `string` -# symbols (Kconfig has no native float type). -$(eval $(call kconfig_int,SSM_ENTROPY_HIGH_THRESHOLD,0.75)) -$(eval $(call kconfig_int,SSM_CV_HIGH_THRESHOLD,0.15)) -$(eval $(call kconfig_int,SSM_TEMPORAL_DECAY_THRESHOLD,0.5)) -$(eval $(call kconfig_int,SSM_TEMPORAL_DECAY_LOW_THRESHOLD,0.3)) -$(eval $(call kconfig_int,SSM_HYSTERESIS_TICKS,5)) - -# Build the CFLAGS with tuning knobs -# L8 FINAL INTEGRATION: All experimental loop flags removed. -# L1-L7 are now always-on internal physics layers. -# L8 Jacquard mode selector is the sole policy engine. -BASE_CFLAGS = -std=c99 -Wall -Werror -Iinclude -Isrc/word_source -Isrc/test_runner/include \ - -DSTRICT_PTR=$(STRICT_PTR) \ - -DENABLE_HOTWORDS_CACHE=$(ENABLE_HOTWORDS_CACHE) \ - -DENABLE_PIPELINING=$(ENABLE_PIPELINING) \ - -DROLLING_WINDOW_SIZE=$(ROLLING_WINDOW_SIZE) \ - -DTRANSITION_WINDOW_SIZE=$(TRANSITION_WINDOW_SIZE) \ - -DSPECULATION_THRESHOLD_Q48=$(SPECULATION_THRESHOLD_Q48) \ - -DSPECULATION_DEPTH=$(SPECULATION_DEPTH) \ - -DMIN_SAMPLES_FOR_SPECULATION=$(MIN_SAMPLES_FOR_SPECULATION) \ - -DMISPREDICTION_COST_Q48=$(MISPREDICTION_COST_Q48) \ - -DMINIMUM_PREFETCH_ROI=$(MINIMUM_PREFETCH_ROI) \ - -DADAPTIVE_SHRINK_RATE=$(ADAPTIVE_SHRINK_RATE) \ - -DADAPTIVE_MIN_WINDOW_SIZE=$(ADAPTIVE_MIN_WINDOW_SIZE) \ - -DADAPTIVE_CHECK_FREQUENCY=$(ADAPTIVE_CHECK_FREQUENCY) \ - -DADAPTIVE_GROWTH_THRESHOLD=$(ADAPTIVE_GROWTH_THRESHOLD) \ - -DINITIAL_DECAY_SLOPE_Q48=$(INITIAL_DECAY_SLOPE_Q48) \ - -DDECAY_RATE_PER_US_Q16=$(DECAY_RATE_PER_US_Q16) \ - -DHEARTBEAT_THREAD_ENABLED=$(HEARTBEAT_THREAD_ENABLED) \ - -DHEARTBEAT_TICK_NS=$(HEARTBEAT_TICK_NS) \ - -DHEARTBEAT_INFERENCE_FREQUENCY=$(HEARTBEAT_INFERENCE_FREQUENCY) \ - -DHEARTBEAT_CHECK_FREQUENCY=$(HEARTBEAT_CHECK_FREQUENCY) \ - -DHEARTBEAT_WINDOW_TUNING_FREQUENCY=$(HEARTBEAT_WINDOW_TUNING_FREQUENCY) \ - -DHEARTBEAT_SLOPE_VALIDATION_FREQUENCY=$(HEARTBEAT_SLOPE_VALIDATION_FREQUENCY) \ - -DEMERGENCY_CONSOLE_ENABLED=$(EMERGENCY_CONSOLE_ENABLED) \ - -DSSM_ENTROPY_HIGH_THRESHOLD=$(SSM_ENTROPY_HIGH_THRESHOLD) \ - -DSSM_CV_HIGH_THRESHOLD=$(SSM_CV_HIGH_THRESHOLD) \ - -DSSM_TEMPORAL_DECAY_THRESHOLD=$(SSM_TEMPORAL_DECAY_THRESHOLD) \ - -DSSM_TEMPORAL_DECAY_LOW_THRESHOLD=$(SSM_TEMPORAL_DECAY_LOW_THRESHOLD) \ - -DSSM_HYSTERESIS_TICKS=$(SSM_HYSTERESIS_TICKS) - -ifeq ($(HEARTBEAT_THREAD_ENABLED),1) -# HISTORICAL: this used to branch on L4RE (no pthreads there) -- -# THREAD_FLAGS := if L4RE else -pthread. L4Re support is no longer an -# active target; see "Platform support" below. -THREAD_FLAGS := -pthread -else -THREAD_FLAGS := -endif - -BASE_CFLAGS += $(THREAD_FLAGS) - -# Build profiles (TARGET values) -SUPPORTED_TARGETS := standard fast fastest turbo asan - -TARGET_DESCRIPTION_standard := Standard optimized build -TARGET_CFLAGS_standard := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O2 -flto=auto -fuse-linker-plugin -DNDEBUG \ - -DUSE_ASM_OPT=1 \ - -ffunction-sections -fdata-sections -fomit-frame-pointer \ - -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-strict-aliasing -TARGET_LDFLAGS_standard := -Wl,--gc-sections -s -flto=auto -fuse-linker-plugin -static $(THREAD_FLAGS) - -TARGET_DESCRIPTION_fast := Fast optimized build (no LTO, easier debugging) -TARGET_CFLAGS_fast := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -TARGET_LDFLAGS_fast := -s $(THREAD_FLAGS) - -TARGET_DESCRIPTION_fastest := Maximum performance build (ASM + LTO + direct threading) -TARGET_CFLAGS_fastest := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG \ - -flto=auto -fuse-linker-plugin -funroll-loops -finline-functions -fomit-frame-pointer -fno-plt -fno-semantic-interposition -TARGET_LDFLAGS_fastest := -flto=auto -fuse-linker-plugin -s -Wl,--gc-sections $(THREAD_FLAGS) - -TARGET_DESCRIPTION_turbo := Assembly-optimized build (no direct threading) -TARGET_CFLAGS_turbo := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DNDEBUG -flto -TARGET_LDFLAGS_turbo := -flto -s $(THREAD_FLAGS) - -TARGET_DESCRIPTION_asan := ASan/UBSan instrumented build for memory error detection -TARGET_CFLAGS_asan := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O1 -g \ - -fsanitize=address,undefined -fno-omit-frame-pointer -TARGET_LDFLAGS_asan := -fsanitize=address,undefined $(THREAD_FLAGS) - -define TARGET_POST_fastest - @echo "" - @echo "🎯 You've built the FASTEST FORTH IN THE WEST!" - @echo "" - @echo "Quick-draw benchmark:" - @time -f " ⏱️ Time: %E seconds" ./$(BINARY) -c ": BENCH 1000000 0 DO 1 2 + DROP LOOP ; BENCH BYE" 2>/dev/null || true -endef - -TARGET_DESCRIPTION := $(TARGET_DESCRIPTION_$(TARGET)) -ifeq ($(strip $(TARGET_DESCRIPTION)),) - $(error Unknown TARGET '$(TARGET)'. Supported targets: $(SUPPORTED_TARGETS)) -endif - -TARGET_CFLAGS_SELECTED := $(TARGET_CFLAGS_$(TARGET)) -TARGET_LDFLAGS_SELECTED := $(TARGET_LDFLAGS_$(TARGET)) -TARGET_POST := $(or $(TARGET_POST_$(TARGET)),@:) - -CFLAGS ?= $(TARGET_CFLAGS_SELECTED) -LDFLAGS ?= $(TARGET_LDFLAGS_SELECTED) - -CFLAGS += $(EXTRA_CFLAGS) -LDFLAGS += $(EXTRA_LDFLAGS) - -USE_ASM_OPT := $(if $(findstring -DUSE_ASM_OPT=1,$(CFLAGS)),1,0) -USE_LTO := $(if $(or $(findstring -flto,$(CFLAGS)),$(findstring -flto,$(LDFLAGS))),1,0) - -# Platform support -# -# HISTORICAL: L4Re/Fiasco.OC was a supported platform target (`make L4RE=1`) -# through mid-2026. Removed as an active target; src/platform/l4re/time.c -# is retained for reference but no longer wired into any build. To restore: -# reinstate the `else ifdef L4RE` branch below and the L4RE-conditional -# logic marked HISTORICAL elsewhere in this Makefile (search "L4RE"/"L4Re"). -# -# ifdef MINIMAL -# ... -# else ifdef L4RE -# CFLAGS += -D__l4__=1 -# PLATFORM_TIME_SRC = src/platform/l4re/time.c src/platform/platform_init.c -# PLATFORM_ALLOC_SRC = src/platform/alloc_kernel.c -# else -# ... -# endif -ifdef MINIMAL -# DISABLED 2026-07-08: this was never a finished feature, not a small bug. -# src/platform/starforth_minimal.c (referenced below) does not exist -# anywhere in the repo, and only 5 of ~90 source files under src/ have any -# STARFORTH_MINIMAL awareness despite -nostdlib -ffreestanding applying to -# the entire tree. Confirmed by trying it: even a throwaway empty stub for -# the missing file lets the build report "success" while linking a binary -# with no _start entry point (this build's specific -nostdlib/-static/ -# -pthread/-flto flag combination doesn't actually exclude libc, so most -# calls silently resolve anyway -- the illusion of success is the trap). -# Reviving this needs an actual freestanding platform layer written from -# scratch, not a quick fix -- failing loudly here instead of letting -# anyone hit a confusing compile error or, worse, a binary that "builds" -# but can't run. See .claude/CLAUDE.md's punch list for status. -$(error MINIMAL=1 build is disabled: incomplete freestanding platform layer, not currently supported. See the comment immediately above this line for why) -CFLAGS += -DSTARFORTH_MINIMAL=1 -nostdlib -ffreestanding -LDFLAGS += -nostdlib -PLATFORM_SRC = src/platform/starforth_minimal.c -PLATFORM_ALLOC_SRC = src/platform/alloc_kernel.c -else -PLATFORM_TIME_SRC = src/platform/linux/time.c src/platform/linux/io.c src/platform/platform_init.c -PLATFORM_ALLOC_SRC = src/platform/alloc_host.c -endif - -PLATFORM_COMMON_SRC = src/platform/threading.c $(PLATFORM_ALLOC_SRC) - -# Source and object files -SRC = $(wildcard src/*.c src/word_source/*.c src/test_runner/*.c src/test_runner/modules/*.c) $(PLATFORM_SRC) $(PLATFORM_TIME_SRC) $(PLATFORM_COMMON_SRC) -BUILD_ROOT ?= build -build_dir = $(BUILD_ROOT)/$(call canon_arch,$(or $2,$(ARCH)))/$1 -binary_path = $(call build_dir,$1,$2)/starforth -BUILD_DIR = $(call build_dir,$(TARGET),$(ARCH)) -BINARY = $(call binary_path,$(TARGET),$(ARCH)) -OBJ = $(patsubst src/%.c,$(BUILD_DIR)/%.o,$(SRC)) -ASM_FILES = $(patsubst src/%.c,$(BUILD_DIR)/%.s,$(SRC)) - -# Profiler support for test targets -PROFILE_LEVEL := $(strip $(PROFILE)) -ifeq ($(PROFILE_LEVEL),) -PROFILE_ARGS := -else -PROFILE_ARGS := --profile $(PROFILE_LEVEL) -PROFILE_REPORT ?= 1 -ifneq ($(strip $(PROFILE_REPORT)),0) -PROFILE_ARGS += --profile-report -endif -endif - -# Installation directories -PREFIX ?= . -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/share/man/man1 -INFODIR = $(PREFIX)/share/info -DOCDIR = $(PREFIX)/share/doc/starforth -CONFDIR = $(PREFIX)/etc/starforth - -# ============================================================================== -# PHONY TARGETS -# ============================================================================== - -.PHONY: all banner help clean clean-obj clean-docs starkernel mkcapsule capsule-gen capsule-manifest -.PHONY: fastest fast turbo -.PHONY: rpi4 rpi4-cross rpi4-fastest riscv64-clang -.PHONY: minimal debug profile performance -.PHONY: test bench benchmark -.PHONY: asm sbom -.PHONY: docs api-docs docs-latex docs-isabelle isabelle-build isabelle-check info math-companion math-companion-clean -.PHONY: refinement-status refinement-init refinement-phase1 verify-defect refinement-annotate-check refinement-report -.PHONY: install uninstall package deb rpm -.PHONY: quality compile_commands clang_tidy cppcheck gcc_analyzer -.PHONY: FORCE version-info build-manifest - -# ============================================================================== -# MAIN TARGETS -# ============================================================================== - -all: banner $(BINARY) - @echo "" - @echo "✓ Build complete: $(BINARY)" - @echo " Architecture: $(ARCH_NAME)" - @echo " Profile: $(TARGET_DESCRIPTION) ($(TARGET))" - @echo " Output directory: $(BUILD_DIR)" - @echo " Optimizations: $(if $(findstring USE_ASM_OPT,$(CFLAGS)),Enabled,Disabled)" - @echo " Direct Threading: $(if $(findstring USE_DIRECT_THREADING,$(CFLAGS)),Enabled,Disabled)" - @mkdir -p lfs/$(ARCH_DIR) - @cp $(BINARY) lfs/$(ARCH_DIR)/starforth - @echo " LFS copy: lfs/$(ARCH_DIR)/starforth" - $(TARGET_POST) - -banner: - @echo "════════════════════════════════════════════════════════════" - @echo " ⚡ Building the Fastest Forth in the West! ⚡" - @echo "════════════════════════════════════════════════════════════" - @echo " Target Architecture: $(ARCH_NAME) ($(ARCH_DIR))" - @echo " Build Profile: $(TARGET_DESCRIPTION) ($(TARGET))" - @echo "" - -# ============================================================================== -# OPTIMIZATION BUILDS - The Fastest in the West -# ============================================================================== - -# Maximum performance - no compromises -fastest: - @echo "🏆 Building FASTEST configuration..." - @echo " - Architecture: $(ARCH_NAME)" - @echo " - Assembly optimizations: ENABLED" - @echo " - Direct threading: ENABLED" - @echo "" - @$(MAKE) TARGET=fastest all - -# Fast without LTO (easier debugging) -fast: - @echo "⚡ Building FAST configuration (no LTO for debugging)..." - @$(MAKE) TARGET=fast all - -# Assembly optimizations only (no direct threading) -turbo: - @echo "🚀 Building TURBO configuration (ASM only)..." - @$(MAKE) TARGET=turbo all - -# ============================================================================== -# PLATFORM-SPECIFIC BUILDS -# ============================================================================== - -# Raspberry Pi 4 - native build -rpi4: - @echo "🥧 Building for Raspberry Pi 4 (native)..." - @$(MAKE) ARCH=raspi TARGET=fastest CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto" LDFLAGS="-flto -s" all - @echo "✓ Raspberry Pi build ready: $(call binary_path,fastest,raspi)" - -# Raspberry Pi 4 - cross-compile from x86_64 -rpi4-cross: - @echo "🥧 Cross-compiling for Raspberry Pi 4..." - @$(MAKE) ARCH=raspi TARGET=fastest CC=aarch64-linux-gnu-gcc \ - CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -static" \ - LDFLAGS="-flto -s -static" \ - all - @echo "✓ Cross-compiled binary ready: $(call binary_path,fastest,raspi)" - @echo " Copy to RPi4: scp $(call binary_path,fastest,raspi) pi@raspberrypi.local:~/" - -# Raspberry Pi 4 - maximum optimization -rpi4-fastest: - @echo "🥧⚡ Building FASTEST for Raspberry Pi 4..." - @$(MAKE) ARCH=raspi TARGET=fastest CC=aarch64-linux-gnu-gcc \ - CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd+crypto -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -funroll-loops -finline-functions" \ - LDFLAGS="-flto -s -static" \ - all - @echo "✓ Raspberry Pi FASTEST build ready: $(call binary_path,fastest,raspi)" - -# RISC-V 64 - cross-compile via clang (GCC fails to build this tree under -# -std=c99: a nanosleep visibility failure, not yet root-caused — see -# docs/lithosananke/hosted-acceptance-test/README.md and -# docs/working/archive/session-logs/2026-07-24-punch-list.md item #3). -# CFLAGS deliberately does NOT reuse $(BASE_CFLAGS): BASE_CFLAGS hardcodes -# -std=c99, and clang needs -std=c11 -pthread here. This mirrors the exact -# recipe verified in the hosted-acceptance-test doc, kept in sync with it. -riscv64-clang: - @echo "🦀 Cross-compiling for RISC-V 64 (clang)..." - @$(MAKE) ARCH=riscv64 TARGET=fastest \ - CC="clang-18 --target=riscv64-linux-gnu --sysroot=/usr/riscv64-linux-gnu" \ - CFLAGS="-std=c11 -pthread -Wall -Werror -Iinclude -Isrc/word_source -Isrc/test_runner/include -DSTRICT_PTR=1 -march=rv64gc -mabi=lp64d -mcmodel=medany -DARCH_RISCV64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -static" \ - LDFLAGS="-flto -s -static -fuse-ld=lld" \ - all - @echo "✓ Cross-compiled binary ready: $(call binary_path,fastest,riscv64)" - @echo " Run: qemu-riscv64 $(call binary_path,fastest,riscv64)" - -# Minimal/embedded build -minimal: - $(MAKE) MINIMAL=1 - -# HISTORICAL: L4Re support removed as an active target (see "Platform -# support" above). This target cross-compiled a minimal build with the -# L4Re toolchain (l4-gcc) for smoke-testing without real L4Re headers. -# fake-l4re: -# $(MAKE) MINIMAL=1 CC=l4-gcc CFLAGS="$(BASE_CFLAGS) -DL4RE_TARGET=1" - -# ============================================================================== -# DEBUG & DEVELOPMENT BUILDS -# ============================================================================== - -# Debug build with symbols -debug: banner - @echo "🐛 Building DEBUG configuration..." - $(MAKE) CFLAGS="$(BASE_CFLAGS) -O0 -g -DDEBUG" LDFLAGS="" $(BINARY) - -# Build with profiler support -profile: - $(MAKE) CFLAGS="$(BASE_CFLAGS) -g -O1" $(BINARY) - -# Performance build (legacy alias - redirects to 'fastest') -performance: fastest - -# ============================================================================== -# BUILD RULES -# ============================================================================== - -# Generate version header from Makefile VERSION, ARCH, TARGET, and timestamp -include/version.h: FORCE - @mkdir -p include - @echo "Generating version header..." - @BUILD_TS=$$(date -Iseconds 2>/dev/null || echo "unknown"); \ - printf '#ifndef STARFORTH_VERSION_H\n#define STARFORTH_VERSION_H\n\n' > $@; \ - printf '#define STARFORTH_VERSION "%s"\n' "$(VERSION)" >> $@; \ - printf '#define STARFORTH_ARCH "%s"\n' "$(ARCH_NAME)" >> $@; \ - printf '#define STARFORTH_TARGET "%s"\n' "$(TARGET)" >> $@; \ - printf '#define STARFORTH_TIMESTAMP "%s"\n' "$$BUILD_TS" >> $@; \ - printf '#define STARFORTH_VERSION_FULL "StarForth v%s %s %s %s"\n\n' "$(VERSION)" "$(ARCH_NAME)" "$(TARGET)" "$$BUILD_TS" >> $@; \ - printf '#endif /* STARFORTH_VERSION_H */\n' >> $@ - -# Ensure version.h exists and is up-to-date before compilation -FORCE: - -# ============================================================================== -# CAPSULE SUBSYSTEM -# ============================================================================== - -CAPSULES_DIR ?= capsules -MKCAPSULE_SRC = tools/mkcapsule.c -MKCAPSULE_BIN = $(BUILD_DIR)/tools/mkcapsule -CAPSULE_GENERATED = $(BUILD_DIR)/capsule_generated.c -CAPSULE_GENERATED_OBJ = $(BUILD_DIR)/capsule_generated.o -CAPSULE_MANIFEST = $(CAPSULES_DIR)/MANIFEST_AUTO.md - -# Build the mkcapsule host tool -$(MKCAPSULE_BIN): $(MKCAPSULE_SRC) - @mkdir -p $(dir $@) - @echo " HOSTCC $<" - @$(CC) -O2 -Wall -o $@ $< - -# Run mkcapsule to generate the capsule directory C source -$(CAPSULE_GENERATED): $(MKCAPSULE_BIN) $(CAPSULES_DIR) - @mkdir -p $(dir $@) - @echo " MKCAP $(CAPSULES_DIR) -> $@" - @$(MKCAPSULE_BIN) $(CAPSULES_DIR) $@ - -# Compile the generated capsule directory -$(CAPSULE_GENERATED_OBJ): $(CAPSULE_GENERATED) | include/version.h - @mkdir -p $(dir $@) - @echo " CC $<" - @$(CC) $(CFLAGS) -c $< -o $@ - -.PHONY: mkcapsule capsule-gen capsule-manifest -mkcapsule: $(MKCAPSULE_BIN) -capsule-manifest: $(MKCAPSULE_BIN) - @echo " MANIFEST $(CAPSULES_DIR) -> $(CAPSULE_MANIFEST)" - @$(MKCAPSULE_BIN) --manifest $(CAPSULES_DIR) $(CAPSULE_MANIFEST) -capsule-gen: $(CAPSULE_GENERATED) capsule-manifest - -# starkernel: full capsule-aware build -# 1. Build mkcapsule tool -# 2. Generate capsule_generated.c from capsules/ -# 3. Compile StarForth with __STARKERNEL__ and capsule_generated.o linked in -starkernel: $(MKCAPSULE_BIN) $(CAPSULE_GENERATED_OBJ) - @$(MAKE) $(BINARY) \ - EXTRA_CFLAGS="-D__STARKERNEL__=1 -Iinclude" \ - EXTRA_OBJ="$(CAPSULE_GENERATED_OBJ)" - -# ============================================================================== -# Main executable -$(BINARY): $(OBJ) $(EXTRA_OBJ) - @echo "🔗 Linking $(BINARY)..." - @mkdir -p $(dir $@) - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -# Pattern rule for all C files (consolidates 5 repetitive rules) -# Order-only dependency: version.h must exist before compilation, but changes don't trigger rebuild -$(BUILD_DIR)/%.o: src/%.c | include/version.h - @mkdir -p $(dir $@) - @echo " CC $<" - @$(CC) $(CFLAGS) -c $< -o $@ -ifdef ASM - @$(CC) $(CFLAGS) -S $(ASM_SYNTAX) $< -o $(patsubst %.o,%.s,$@) -endif - -# Files that include version.h - rebuild when timestamp changes -$(BUILD_DIR)/main.o: include/version.h -$(BUILD_DIR)/cli.o: include/version.h -$(BUILD_DIR)/word_source/starforth_words.o: include/version.h - -# ============================================================================== -# TESTING & BENCHMARKING -# ============================================================================== - -# Quick benchmark -bench: $(BINARY) - @echo "" - @echo "🏇 Running quick-draw benchmark..." - @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - @echo "Test: 1 million stack operations" - @time -f "Time: %E seconds" ./$(BINARY) -c ": BENCH 1000000 0 DO 1 2 + DROP LOOP ; BENCH BYE" 2>/dev/null || echo "Benchmark complete" - @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - -# Full benchmark suite -benchmark: $(BINARY) - @echo "" - @echo "🎯 Full Benchmark Suite - Fastest Forth in the West" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @echo "📊 Stack Operations (1M iterations):" - @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-STACK 1000000 0 DO 1 2 3 DROP DROP DROP LOOP ; BENCH-STACK BYE" 2>/dev/null || true - @echo "" - @echo "📊 Arithmetic Operations (1M iterations):" - @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-MATH 1000000 0 DO 10 20 + 5 * 100 / DROP LOOP ; BENCH-MATH BYE" 2>/dev/null || true - @echo "" - @echo "📊 Logic Operations (1M iterations):" - @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-LOGIC 1000000 0 DO 255 DUP AND DUP OR XOR DROP LOOP ; BENCH-LOGIC BYE" 2>/dev/null || true - @echo "" - @echo "════════════════════════════════════════════════════════════" - -# ============================================================================== -# ASSEMBLY OUTPUT & ANALYSIS -# ============================================================================== - -# Generate assembly files for inspection -asm: banner - @echo "📝 Generating assembly output..." - @echo " Cleaning to force rebuild..." - @$(MAKE) clean-obj > /dev/null 2>&1 - $(MAKE) ASM=1 CFLAGS="$(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1" LDFLAGS="" $(BINARY) - @echo "✓ Assembly files generated in $(BUILD_DIR)/" - @echo " Files generated: $$(find $(BUILD_DIR) -name '*.s' | wc -l)" - @echo " Example: less $(BUILD_DIR)/stack_management.s" - -# Generate Software Bill of Materials (SBOM) in SPDX format -sbom: - @echo "📋 Generating SBOM (Software Bill of Materials)..." - @if ! which syft >/dev/null 2>&1; then \ - echo "Error: syft not found. Install from https://github.com/anchore/syft"; \ - exit 1; \ - fi - @syft dir:. -o spdx-json=sbom.spdx.json -o spdx=sbom.spdx \ - --source-name LithosAnanke \ - --source-version $(VERSION) \ - --exclude './build/**' --exclude './tools/**' --exclude './.git/**' - @echo "✅ SBOM generated:" - @echo " SPDX JSON: sbom.spdx.json" - @echo " SPDX: sbom.spdx" - @echo " Version: $(VERSION)" - -# ============================================================================== -# DOCUMENTATION -# ============================================================================== - -# Generate API documentation (Doxygen XML → AsciiDoc) -api-docs: - @echo "📚 Generating API documentation from Doxygen..." - @if [ ! -f scripts/generate-doxygen-appendix.sh ]; then \ - echo "Error: scripts/generate-doxygen-appendix.sh not found"; \ - exit 1; \ - fi - @./scripts/generate-doxygen-appendix.sh - @echo "✅ API documentation generated: docs/src/appendix/" - -# ---------------------------------------------------------------------------- -# Math companion to the SSRN paper. -# Builds docs/SSRN_companion/Math_Companion_SSRN.pdf from the LaTeX source. -# Requires: pdflatex (texlive-latex-base, texlive-latex-extra, texlive-science). -# ---------------------------------------------------------------------------- -math-companion: - @echo "Building SSRN math companion (docs/SSRN_companion/Math_Companion_SSRN.pdf)..." - @if ! command -v pdflatex >/dev/null 2>&1; then \ - echo "Error: pdflatex not found."; \ - echo " Install with: apt-get install texlive-latex-base texlive-latex-extra texlive-science"; \ - exit 1; \ - fi - @cd docs/SSRN_companion && \ - pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null && \ - pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null && \ - pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null - @echo "Built: docs/SSRN_companion/Math_Companion_SSRN.pdf" - @cd docs/SSRN_companion && ls -lh Math_Companion_SSRN.pdf | awk '{print " Size:", $$5, " Pages: see pdfinfo"}' - -math-companion-clean: - @rm -f docs/SSRN_companion/Math_Companion_SSRN.{aux,log,out,toc,lof,lot,nav,snm,vrb} - @rm -f docs/SSRN_companion/Math_Companion_SSRN.pdf - @echo "Cleaned math companion build artifacts." - -# Convert all AsciiDoc to LaTeX -docs-latex: - @echo "📄 Converting AsciiDoc to LaTeX..." - @if [ ! -f scripts/asciidoc-to-latex.sh ]; then \ - echo "Error: scripts/asciidoc-to-latex.sh not found"; \ - exit 1; \ - fi - @./scripts/asciidoc-to-latex.sh - @echo "✅ LaTeX files generated: docs/latex/" - -# Build and verify Isabelle theories -isabelle-build: - @echo "🔬 Building Isabelle formal verification theories..." - @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ - echo "Error: Isabelle not found: $(ISABELLE)"; \ - echo " Install Isabelle or set ISABELLE variable"; \ - exit 1; \ - fi - @echo " Using: $$(command -v $(ISABELLE))" - @echo " Building StarForth_Formal session (VM + Physics)..." - @cd docs/src/internal/formal && $(ISABELLE) build -v -d . StarForth_Formal - @echo "✅ Isabelle theories verified successfully" - -# Quick check of Isabelle theories (faster than full build) -isabelle-check: - @echo "🔬 Quick-checking Isabelle theories..." - @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ - echo "Error: Isabelle not found: $(ISABELLE)"; \ - exit 1; \ - fi - @cd docs/src/internal/formal && \ - for thy in *.thy; do \ - echo " Checking $$thy..."; \ - $(ISABELLE) process -T "$$thy" 2>&1 | head -5; \ - done - @echo "✅ Quick check complete" - -# Generate comprehensive Isabelle documentation (for auditing & CI/CD) -# This generates documentation and verification reports regardless of proof status -# Suitable for Jenkinsfile pipelines - shows complete state including errors -docs-isabelle: - @echo "📚 Generating comprehensive Isabelle documentation (audit mode)..." - @mkdir -p docs/src/isabelle - @echo "" - @echo "Step 1: Attempting to verify Isabelle theories..." - @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - @cd docs/src/internal/formal && \ - if $(ISABELLE) build -v -d . StarForth_Formal > "$(CURDIR)/docs/src/isabelle/build.log" 2>&1; then \ - echo "✅ All theories verified successfully"; \ - else \ - echo "⚠️ Some theories have incomplete proofs (see build.log for details)"; \ - fi - @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - @echo "" - @echo "Step 2: Generating documentation from theory source..." - @if [ ! -f scripts/isabelle-to-adoc.sh ]; then \ - echo "⚠️ Warning: scripts/isabelle-to-adoc.sh not found"; \ - echo " Creating default script..."; \ - mkdir -p scripts; \ - echo '#!/bin/bash' > scripts/isabelle-to-adoc.sh; \ - echo 'echo "Generating Isabelle theory reports to AsciiDoc..."' >> scripts/isabelle-to-adoc.sh; \ - echo 'cd docs/src/internal/formal' >> scripts/isabelle-to-adoc.sh; \ - echo 'for thy in *.thy; do' >> scripts/isabelle-to-adoc.sh; \ - echo ' base=$$(basename "$$thy" .thy)' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "= $$base Theory" > "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "Formal verification theory for StarForth VM." >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "== Theory Source" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "[source,isabelle]" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "----" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' cat "$$thy" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo ' echo "----" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ - echo 'done' >> scripts/isabelle-to-adoc.sh; \ - chmod +x scripts/isabelle-to-adoc.sh; \ - fi - @bash scripts/isabelle-to-adoc.sh - @echo "" - @echo "Step 3: Creating audit summary..." - @echo "✅ Comprehensive Isabelle documentation generated: docs/src/isabelle/" - @echo "" - @echo "📂 Documentation includes:" - @echo " • index.adoc - Master index of all theories" - @echo " • VERIFICATION_REPORT.adoc - Audit report" - @echo " • .adoc - Individual theory documentation with source" - @echo " • build.log - Isabelle build output (verification status)" - -# ============================================================================== -# REFINEMENT VERIFICATION (C ⊑ Isabelle) -# ============================================================================== - -# Refinement status dashboard -refinement-status: - @echo "════════════════════════════════════════════════════════════" - @echo " StarForth C ⊑ Isabelle Refinement Status" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @if [ ! -f docs/REFINEMENT_CAPA.adoc ]; then \ - echo "⚠️ No REFINEMENT_CAPA.adoc found. Initialize with: make refinement-init"; \ - echo ""; \ - echo "Refinement infrastructure status: UNINITIALIZED"; \ - else \ - echo "📋 Defect Summary:"; \ - echo ""; \ - echo -n " Total Defects: "; grep -c "^== DEFECT-" docs/REFINEMENT_CAPA.adoc || echo "0"; \ - echo -n " OPEN: "; grep "| OPEN" docs/REFINEMENT_CAPA.adoc | wc -l; \ - echo -n " IN-PROGRESS: "; grep "| IN-PROGRESS" docs/REFINEMENT_CAPA.adoc | wc -l; \ - echo -n " CLOSED: "; grep "| CLOSED" docs/REFINEMENT_CAPA.adoc | wc -l; \ - fi - @echo "" - @echo "🏆 Phase Status:" - @echo " Phase 1: vm.c core .............. NOT STARTED" - @echo " Phase 2: Root utilities ......... NOT STARTED" - @echo " Phase 3: Test harness .......... NOT STARTED" - @echo " Phase 4: Primitive dictionary .. NOT STARTED" - @echo " Phase 5: VM expansion .......... NOT STARTED" - @echo "" - @echo "📂 Documentation:" - @echo " • docs/REFINEMENT_CAPA.adoc - Defect tracking" - @echo " • docs/REFINEMENT_ANNOTATIONS.adoc - Code annotation guide" - @echo "" - @echo "Next steps: make refinement-phase1 (to start Phase 1 proofs)" - @echo "════════════════════════════════════════════════════════════" - -# Initialize refinement tracking -refinement-init: - @echo "Initializing refinement tracking..." - @if [ -f docs/REFINEMENT_CAPA.adoc ]; then \ - echo "✅ docs/REFINEMENT_CAPA.adoc already exists"; \ - else \ - echo "📋 Creating REFINEMENT_CAPA.adoc"; \ - fi - @if [ -f docs/REFINEMENT_ANNOTATIONS.adoc ]; then \ - echo "✅ docs/REFINEMENT_ANNOTATIONS.adoc already exists"; \ - else \ - echo "📋 Creating REFINEMENT_ANNOTATIONS.adoc"; \ - fi - @echo "✅ Refinement infrastructure ready" - @echo "" - @echo "Next: Review docs/REFINEMENT_ANNOTATIONS.adoc" - @echo " Then: make refinement-phase1" - -# Phase 1: VM Core refinement -refinement-phase1: - @echo "════════════════════════════════════════════════════════════" - @echo " ⚙️ PHASE 1: VM Core Refinement (C ⊑ Isabelle)" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @echo "Building refinement proofs for:" - @echo " • stack_push / stack_pop (DEFECT-001, DEFECT-002)" - @echo " • execute_call / execute_return (DEFECT-002)" - @echo " • instruction_dispatch (DEFECT-003)" - @echo "" - @echo "Proof target: StarForth_Refinement (Isabelle theory)" - @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ - echo "Error: Isabelle not found. Install or set ISABELLE variable"; \ - exit 1; \ - fi - @echo "" - @echo "Step 1: Creating StarForth_Refinement.thy if needed..." - @if [ ! -f docs/src/internal/formal/StarForth_Refinement.thy ]; then \ - echo "Creating template..."; \ - mkdir -p docs/src/internal/formal; \ - touch docs/src/internal/formal/StarForth_Refinement.thy; \ - echo "TODO: Add refinement proofs here" > docs/src/internal/formal/StarForth_Refinement.thy; \ - fi - @echo "" - @echo "Step 2: Attempting to build refinement proofs..." - @echo "(This will fail until proofs are written)" - @cd docs/src/internal/formal && \ - $(ISABELLE) build -v -d . StarForth_Formal 2>&1 | tail -20 - @echo "" - @echo "📋 Next steps:" - @echo " 1. Review open defects: grep 'OPEN' docs/REFINEMENT_CAPA.adoc" - @echo " 2. Start working on DEFECT-001 (stack_push)" - @echo " 3. Add refinement proofs to StarForth_Refinement.thy" - @echo " 4. Run: make verify-defect DEFECT=001" - -# Verify specific defect resolution -verify-defect: - @if [ -z "$(DEFECT)" ]; then \ - echo "Usage: make verify-defect DEFECT=001"; \ - echo ""; \ - echo "Available defects:"; \ - grep "== DEFECT-" docs/REFINEMENT_CAPA.adoc | sed 's/== / /'; \ - exit 1; \ - fi - @echo "════════════════════════════════════════════════════════════" - @echo " 🔍 Verifying Resolution: $(DEFECT)" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @if ! grep -q "== DEFECT-$(DEFECT):" docs/REFINEMENT_CAPA.adoc; then \ - echo "❌ DEFECT-$(DEFECT) not found in REFINEMENT_CAPA.adoc"; \ - exit 1; \ - fi - @echo "Defect Details:" - @grep -A 30 "== DEFECT-$(DEFECT):" docs/REFINEMENT_CAPA.adoc | head -35 - @echo "" - @echo "Next: Implement corrective action, then run this again" - -# Check code annotation coverage -refinement-annotate-check: - @echo "════════════════════════════════════════════════════════════" - @echo " 📝 Checking Code Annotation Coverage" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @echo "Phase 1 target functions:" - @echo "" - @for func in stack_push stack_pop execute_instruction execute_call execute_return; do \ - if grep -q "REFINEMENT.*$$func\|void $$func" src/vm.c; then \ - if grep -q "REFINEMENT:" src/vm.c | grep -q "$$func"; then \ - echo " ✅ $$func - ANNOTATED"; \ - else \ - echo " ❌ $$func - MISSING ANNOTATION"; \ - fi; \ - else \ - echo " ⚠️ $$func - NOT FOUND"; \ - fi; \ +.PHONY: all boot_image boot_images docs clean clean-docs kernel boards help help-hosted + +# ------------------------------------------------------------------------------ +# all +# ------------------------------------------------------------------------------ +ifeq ($(TARGET),) +all: + @for b in $(READY_BOARDS); do \ + $(SUBMAKE) boot_image TARGET=$$b || exit 1; \ done + @$(SUBMAKE) -f v3/Makefile all + @$(SUBMAKE) docs @echo "" - @echo "Guide: docs/REFINEMENT_ANNOTATIONS.adoc" + @echo "Built:" + @for b in $(READY_BOARDS); do \ + d=$$(echo $$b | tr A-Z a-z); ls build/boards/$$d/*.img | sed 's/^/ /'; \ + done + @echo " build/docs/LithosAnanke.pdf" + @$(foreach b,$(UNREADY_BOARDS),echo "Skipped $(b): needs kernel/src/arch/$(call board_arch,$(b)), which does not exist yet";) +else ifneq ($(BOARD_DIR),) +all: + @$(SUBMAKE) boot_image TARGET=$(TARGET) + @$(SUBMAKE) docs TARGET=$(TARGET) +else +all: + @$(SUBMAKE) -f v3/Makefile all TARGET=$(TARGET) +endif -# Generate refinement report -refinement-report: - @echo "🔄 Generating refinement status report..." - @mkdir -p docs/reports - @echo "# StarForth Refinement Status" > docs/reports/refinement-status.md - @echo "" >> docs/reports/refinement-status.md - @echo "Generated: $$(date)" >> docs/reports/refinement-status.md - @echo "" >> docs/reports/refinement-status.md - @echo "## Summary" >> docs/reports/refinement-status.md - @echo "" >> docs/reports/refinement-status.md - @grep -c "== DEFECT-" docs/REFINEMENT_CAPA.adoc | xargs -I {} echo "Total Defects: {}" >> docs/reports/refinement-status.md - @echo "" >> docs/reports/refinement-status.md - @echo "See docs/REFINEMENT_CAPA.adoc for details" >> docs/reports/refinement-status.md - @echo "✅ Report: docs/reports/refinement-status.md" - -# Generate GNU info documentation -docs/starforth.info: - @if [ ! -f docs/starforth.texi ]; then \ - echo "⚠️ Skipping info docs: docs/starforth.texi not present"; \ - touch docs/starforth.info; \ - else \ - echo "📖 Building GNU info documentation..."; \ - if ! command -v makeinfo >/dev/null 2>&1; then \ - echo "Warning: makeinfo not found. Install with: sudo apt-get install texinfo"; \ - touch docs/starforth.info; \ - else \ - makeinfo docs/starforth.texi -o docs/starforth.info && \ - echo "✅ Info documentation: docs/starforth.info"; \ - fi; \ +# ------------------------------------------------------------------------------ +# boot images +# ------------------------------------------------------------------------------ +boot_image: + @if [ -z "$(BOARD_DIR)" ]; then \ + echo "Usage: make boot_image TARGET=<$(subst $(space),|,$(BOARDS))>"; \ + [ -z "$(TARGET)" ] || echo "Unknown board TARGET='$(TARGET)'"; \ + exit 1; \ fi + @if [ -z "$(call board_ready,$(TARGET))" ]; then \ + echo "Error: $(TARGET) needs the $(call board_arch,$(TARGET)) kernel port (kernel/src/arch/$(call board_arch,$(TARGET))), which does not exist yet."; \ + echo " $(call board_field,$(TARGET),BOARD_DESC)"; \ + exit 1; \ + fi + @$(SUBMAKE) -f kernel/Makefile \ + BOARD=$(BOARD_DIR) ARCH=$(call board_arch,$(TARGET)) TARGET=kernel boot_image -# Generate all documentation -docs: api-docs docs-isabelle - @echo "✅ All documentation generated!" - @echo "" - @echo "📂 Documentation locations:" - @echo " • API docs: docs/src/appendix/" - @echo " • Isabelle docs: docs/src/isabelle/" - @echo " • LaTeX: docs/latex/" +boot_images: + @for b in $(READY_BOARDS); do \ + $(SUBMAKE) boot_image TARGET=$$b || exit 1; \ + done + @$(foreach b,$(UNREADY_BOARDS),echo "Skipped $(b): needs kernel/src/arch/$(call board_arch,$(b)), which does not exist yet";) + +# ------------------------------------------------------------------------------ +# docs +# ------------------------------------------------------------------------------ +docs: + @if [ -n "$(TARGET)" ] && [ -z "$(BOARD_DIR)" ]; then \ + echo "Error: make docs takes TARGET=<$(subst $(space),|,$(BOARDS))> or no TARGET; '$(TARGET)' is not a board."; \ + exit 1; \ + fi + @$(SUBMAKE) -f docs/book/Makefile BOARD=$(BOARD_DIR) BOARD_NAME=$(TARGET) -# Clean generated documentation clean-docs: - @echo "🗑️ Cleaning generated documentation..." - @rm -rf docs/src/appendix/ docs/latex/ docs/src/isabelle/ - @echo "✅ Documentation cleaned" - -# ============================================================================== -# INSTALLATION -# ============================================================================== - -install: $(BINARY) - @echo "📦 Installing StarForth to $(PREFIX)..." - @install -d $(BINDIR) - @install -m 755 $(BINARY) $(BINDIR)/starforth - @echo " ✓ Binary installed: $(BINDIR)/starforth" - @if [ -f capsules/init.4th ]; then \ - install -d $(CONFDIR); \ - install -m 644 capsules/init.4th $(CONFDIR)/init.4th; \ - echo " ✓ Config installed: $(CONFDIR)/init.4th"; \ - fi - @if [ -f man/starforth.1 ]; then \ - install -d $(MANDIR); \ - install -m 644 man/starforth.1 $(MANDIR)/starforth.1; \ - echo " ✓ Man page installed: $(MANDIR)/starforth.1"; \ - fi - @if [ -f docs/starforth.info ]; then \ - install -d $(INFODIR); \ - install -m 644 docs/starforth.info $(INFODIR)/starforth.info; \ - install-info --info-dir=$(INFODIR) $(INFODIR)/starforth.info 2>/dev/null || true; \ - echo " ✓ Info docs installed: $(INFODIR)/starforth.info"; \ - fi - @install -d $(DOCDIR) - @if [ -f README.md ]; then install -m 644 README.md $(DOCDIR)/; fi - @if [ -f QUICKSTART.md ]; then install -m 644 QUICKSTART.md $(DOCDIR)/; fi - @if ls docs/*.md >/dev/null 2>&1; then install -m 644 docs/*.md $(DOCDIR)/ 2>/dev/null || true; fi - @echo " ✓ Documentation installed: $(DOCDIR)/" - @echo "✅ Installation complete!" - -uninstall: - @echo "🗑️ Uninstalling StarForth from $(PREFIX)..." - @rm -f $(BINDIR)/starforth - @rm -f $(MANDIR)/starforth.1 - @install-info --delete --info-dir=$(INFODIR) $(INFODIR)/starforth.info 2>/dev/null || true - @rm -f $(INFODIR)/starforth.info - @rm -rf $(DOCDIR) - @rm -rf $(CONFDIR) - @echo "✅ Uninstall complete!" - -# ============================================================================== -# PACKAGING -# ============================================================================== - -# Build Debian package -deb: $(BINARY) - @echo "📦 Building Debian package..." - @if ! command -v fpm >/dev/null 2>&1; then \ - echo "Error: fpm not found. Install with: gem install fpm"; \ - echo " or: sudo apt-get install ruby-dev && gem install fpm"; \ - exit 1; \ - fi - @mkdir -p package/deb - @fpm -s dir -t deb \ - -n starforth \ - -v $(VERSION) \ - -a native \ - --description "StarForth - The Fastest Forth in the West" \ - --url "https://github.com/yourusername/starforth" \ - --maintainer "StarForth Team" \ - --license "MIT" \ - --category "devel" \ - --package package/deb/ \ - --deb-compression xz \ - $(BINARY)=/usr/bin/starforth \ - capsules/init.4th=/etc/starforth/init.4th \ - README.md=/usr/share/doc/starforth/README.md - @echo "✅ Debian package created: package/deb/starforth_$(VERSION)_*.deb" - -# Build RPM package -rpm: $(BINARY) - @echo "📦 Building RPM package..." - @if ! command -v fpm >/dev/null 2>&1; then \ - echo "Error: fpm not found. Install with: gem install fpm"; \ - exit 1; \ - fi - @mkdir -p package/rpm - @fpm -s dir -t rpm \ - -n starforth \ - -v $(VERSION) \ - -a native \ - --description "StarForth - The Fastest Forth in the West" \ - --url "https://github.com/yourusername/starforth" \ - --maintainer "StarForth Team" \ - --license "MIT" \ - --category "Development/Languages" \ - --package package/rpm/ \ - $(BINARY)=/usr/bin/starforth \ - capsules/init.4th=/etc/starforth/init.4th \ - README.md=/usr/share/doc/starforth/README.md - @echo "✅ RPM package created: package/rpm/starforth-$(VERSION)-*.rpm" - -# Build all packages -package: deb rpm - @echo "" - @echo "✅ All packages built successfully!" - @echo " Debian: package/deb/" - @echo " RPM: package/rpm/" - -# ============================================================================== -# VERSIONING & BUILD MANIFEST (Workflow/Governance Integration) -# ============================================================================== - -# Parse version from include/version.h -GET_VERSION = $(shell grep "define STARFORTH_VERSION" include/version.h | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1) - -.PHONY: version-info -version-info: - @echo "Current Version: $(GET_VERSION)" - @grep "STARFORTH_VERSION" include/version.h | grep define - -.PHONY: build-manifest -build-manifest: $(BINARY) - @echo "📋 Generating BUILD_MANIFEST.json..." - @mkdir -p builds/manifest - @VERSION=$$(grep "STARFORTH_VERSION_STRING" include/version.h | grep -o '"[^"]*"' | tr -d '"'); \ - GIT_HASH=$$(git rev-parse --short HEAD 2>/dev/null || echo "0000000"); \ - GIT_BRANCH=$$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown"); \ - BUILD_TIME=$$(date -Iseconds); \ - BINARY_PATH="$(BINARY)"; \ - if [ -f "$$BINARY_PATH" ]; then \ - BINARY_SHA256=$$(sha256sum "$$BINARY_PATH" | awk '{print $$1}'); \ - else \ - BINARY_SHA256="not-built"; \ - fi; \ - cat > builds/manifest/BUILD_MANIFEST.json << EOF; \ -{ \ - "version": "$$VERSION", \ - "timestamp": "$$BUILD_TIME", \ - "git": { \ - "commit_hash": "$$GIT_HASH", \ - "branch": "$$GIT_BRANCH", \ - "tag": "v$$VERSION" \ - }, \ - "build": { \ - "timestamp": "$$BUILD_TIME", \ - "compiler": "$$(gcc --version | head -1)", \ - "compiler_flags": "$(CFLAGS) $(ARCH_FLAGS)", \ - "target_architecture": "$(ARCH_NAME)", \ - "use_asm_opt": $(USE_ASM_OPT), \ - "use_lto": $(USE_LTO) \ - }, \ - "testing": { \ - "total_tests": 936, \ - "passed_tests": 0, \ - "failed_tests": 0, \ - "code_coverage_percent": 0, \ - "smoke_test_result": "N/A" \ - }, \ - "binary": { \ - "path": "$$BINARY_PATH", \ - "sha256": "$$BINARY_SHA256" \ - }, \ - "signatures": { \ - "builder": "jenkins-agent", \ - "approval_timestamp": "$(shell date -Iseconds)" \ - } \ -} \ -EOF - @echo "✓ BUILD_MANIFEST created: builds/manifest/BUILD_MANIFEST.json" - @cat builds/manifest/BUILD_MANIFEST.json | head -20 - -# ============================================================================== -# CLEANUP -# ============================================================================== + rm -rf build/docs +# ------------------------------------------------------------------------------ +# clean +# ------------------------------------------------------------------------------ +ifeq ($(TARGET),) clean: - @echo "🧹 Cleaning build artifacts..." - @rm -rfv build/* - @rm -f src/*.gcda src/word_source/*.gcda src/*.gcno src/word_source/*.gcno - @echo "✓ Clean complete" + @if [ -d build ]; then find build -mindepth 1 -maxdepth 1 ! -name cache -exec rm -rf {} +; fi + rm -f v3/include/version.h + rm -f v3/src/*.gcda v3/src/*.gcno v3/src/word_source/*.gcda v3/src/word_source/*.gcno + @echo "Cleaned build/ (kept build/cache/)" +else ifneq ($(BOARD_DIR),) +clean: + rm -rf build/boards/$(BOARD_DIR) build/$(call board_arch,$(TARGET))/kernel build/docs/$(BOARD_DIR) \ + build/docs/LithosAnanke-$(BOARD_DIR).pdf +else +clean: + rm -rf build/*/$(TARGET) +endif -clean-obj: - @echo "🧹 Cleaning object files..." - @find build -name "*.o" -type f -delete 2>/dev/null || true - @echo "✓ Object files cleaned" +# ------------------------------------------------------------------------------ +# misc +# ------------------------------------------------------------------------------ +GOAL ?= all +kernel: + @$(SUBMAKE) -f kernel/Makefile TARGET=kernel $(GOAL) -# ============================================================================== -# HELP -# ============================================================================== +boards: + @$(foreach b,$(BOARDS),printf ' %-9s %-8s %s\n' "$(b)" \ + "$(if $(call board_ready,$(b)),ready,no port)" "$(call board_field,$(b),BOARD_DESC)";) help: - @echo "════════════════════════════════════════════════════════════" - @echo " ⚡ StarForth Build System - Fastest in the West! ⚡" - @echo "════════════════════════════════════════════════════════════" - @echo "" - @echo "🛠️ Variables:" - @echo " ARCH= (default: $(ARCH); canonical directory: $(ARCH_DIR))" - @echo " TARGET= (standard | fast | fastest | turbo)" - @echo "" - @echo "🏆 OPTIMIZATION BUILDS:" - @echo " fastest - Maximum performance (ASM + direct threading + LTO)" - @echo " fast - Fast without LTO (easier debugging)" - @echo " turbo - Assembly optimizations only" - @echo "" - @echo "🥧 PLATFORM-SPECIFIC BUILDS:" - @echo " rpi4 - Native build on Raspberry Pi 4" - @echo " rpi4-cross - Cross-compile from x86_64" - @echo " rpi4-fastest - Maximum optimization for RPi4" - @echo " riscv64-clang - Cross-compile for RISC-V 64 via clang (GCC fails here)" - @echo " minimal - Minimal/embedded build" - @echo "" - @echo "🔧 DEBUG & DEVELOPMENT:" - @echo " all - Standard optimized build (default)" - @echo " debug - Debug build with symbols (-g -O0)" - @echo " profile - Build with profiling support" - @echo " performance - Legacy performance build (use 'fastest')" - @echo "" - @echo "🧪 TESTING & BENCHMARKING:" - @echo " test - Run full test suite" - @echo " bench - Quick benchmark" - @echo " benchmark - Full benchmark suite" - @echo "" - @echo "📝 ANALYSIS & DOCUMENTATION:" - @echo " asm - Generate assembly output" - @echo " sbom - Generate SBOM (Software Bill of Materials, SPDX)" - @echo " docs - Generate all documentation" - @echo " api-docs - Generate API docs (Doxygen → AsciiDoc)" - @echo " docs-latex - Convert AsciiDoc to LaTeX" - @echo " docs-isabelle - Generate Isabelle documentation for auditing (includes build log)" - @echo " isabelle-build - Build and verify Isabelle formal theories (strict verification)" - @echo " isabelle-check - Quick-check Isabelle theories" - @echo " info - Build GNU info documentation" - @echo "" - @echo "🔬 REFINEMENT VERIFICATION (C ⊑ Isabelle):" - @echo " refinement-init - Initialize refinement tracking (CAPA + annotations)" - @echo " refinement-status - Show refinement defect summary and phase status" - @echo " refinement-phase1 - Build Phase 1 refinement proofs (vm.c core)" - @echo " verify-defect - Verify specific defect (Usage: make verify-defect DEFECT=001)" - @echo " refinement-annotate-check - Check code annotation coverage" - @echo " refinement-report - Generate refinement status report" - @echo "" - @echo "📦 INSTALLATION & PACKAGING:" - @echo " install - Install to PREFIX (default: .)" - @echo " uninstall - Uninstall from PREFIX" - @echo " deb - Build Debian package" - @echo " rpm - Build RPM package" - @echo " package - Build all packages" - @echo "" - @echo "🧹 CLEANUP:" - @echo " clean - Remove all build artifacts" - @echo " clean-obj - Remove object files only" - @echo " clean-docs - Remove generated documentation" - @echo "" - @echo "⚙️ CONFIGURATION VARIABLES:" - @echo " CC - Compiler (default: gcc)" - @echo " CFLAGS - Compiler flags (override defaults)" - @echo " LDFLAGS - Linker flags (override defaults)" - @echo " PREFIX - Install prefix (default: .)" - @echo " MINIMAL=1 - Minimal build mode (DISABLED -- incomplete, errors out)" - @echo " ASM=1 - Generate assembly files during build" - @echo "" - @echo "📋 EXAMPLES:" - @echo " make fastest # Fastest build for current platform" - @echo " make rpi4-cross # Cross-compile for Raspberry Pi 4" - @echo " make riscv64-clang # Cross-compile for RISC-V 64 (clang)" - @echo " make asm # Generate assembly for inspection" - @echo " make debug # Debug build" - @echo " make PREFIX=/usr/local install # Install system-wide" - @echo "" - @echo "🌟 CURRENT PLATFORM: $(ARCH_NAME)" - @echo "════════════════════════════════════════════════════════════" + @sed -n '/^# TARGET is/,/^# =====/p' Makefile | sed '$$d; s/^# \{0,1\}//' -quality: compile_commands clang_tidy cppcheck gcc_analyzer +help-hosted: + @$(SUBMAKE) -f v3/Makefile help -compile_commands: - bear --output build/compile_commands.json -- make -j$(nproc) - -clang_tidy: - clang-tidy -p build $(shell find src -name '*.c' -o -name '*.h') | tee build/clang-tidy.txt - -cppcheck: - cppcheck --enable=all --inconclusive --std=c99 src 2> build/cppcheck.txt || true - -gcc_analyzer: - $(MAKE) clean - CFLAGS="$(CFLAGS) -fanalyzer -Wall -Wextra" $(MAKE) all 2>&1 | tee build/gcc-analyzer.txt +# Everything else is the hosted v3 build, unchanged. (The empty Makefile +# rule stops the match-anything rule from trying to remake this file.) +Makefile: ; +%: + @$(SUBMAKE) -f v3/Makefile $@ diff --git a/README.md b/README.md index f3d8355e..6fa97f8c 100644 --- a/README.md +++ b/README.md @@ -48,19 +48,39 @@ POST at boot: **parity hash verified across amd64/aarch64/riscv64 · Mama capsul ## Quick Start ```bash +# One boot image per physical target (output: build/boards//) +make boot_image TARGET=SER5 # Beelink SER5 -- GPT/ESP, BOOTX64.EFI +make boot_image TARGET=RASPI # Raspberry Pi 5 -- FAT, config.txt + kernel_2712.img + DTB +make boot_image TARGET=MILKV # Milk-V Mars -- GPT/ESP, BOOTRISCV64.EFI (U-Boot bootefi) +make boot_image TARGET=ZYNQ7020 # Zynq-7020 -- ARMv7 port in progress +make boards # list boards + +# The same TARGET drives all, docs and clean (make help) +make # every board with a kernel port + hosted v3 + the book +make TARGET=RASPI # one board's image + build/docs/LithosAnanke-raspi.pdf +make docs # build/docs/LithosAnanke.pdf (LaTeX master: docs/book/main.tex) +make clean TARGET=RASPI # that board's outputs and build/aarch64/kernel +make clean # all of build/ except build/cache/ + # Build kernel (requires cross-compilation toolchain, or native gcc) -make -f Makefile.starkernel ARCH=amd64 +make -f kernel/Makefile ARCH=amd64 # Run in QEMU with OVMF -make -f Makefile.starkernel qemu +make -f kernel/Makefile qemu # Other architectures -make -f Makefile.starkernel ARCH=aarch64 qemu -make -f Makefile.starkernel ARCH=riscv64 qemu +make -f kernel/Makefile ARCH=aarch64 qemu +make -f kernel/Makefile ARCH=riscv64 qemu ``` Artifacts: `build/amd64/kernel/starkernel_loader.efi` · `build/amd64/kernel/starkernel_kernel.elf` +Tree: `kernel/` (LithosAnanke: `Makefile`, `src/`, `include/starkernel/`, `linker/`), +`v3/` (StarForth v3 engine and hosted build: `Makefile`, `src/`, `include/`), +`v4/` (StarForth v4, see `docs/v4.0.0/`), `boards//` (`board.mk` + boot files). +Every makefile runs from the repo root; the root `Makefile` forwards any other goal to +`v3/Makefile` (hosted build). + For the hosted VM by itself (Linux, no cross-compiler needed, no bare-metal tooling): see the separate **StarForth** repository — LithosAnanke used to be a branch inside that repo, now it's its own project with its own `master`. @@ -69,12 +89,12 @@ now it's its own project with its own `master`. Every kernel-only knob (`STARFORTH_ENABLE_VM`, `PARITY_MODE`, the shared physics/heartbeat family, etc.) is an optional Kconfig symbol — a plain -`make -f Makefile.starkernel` uses the same defaults it always has unless +`make -f kernel/Makefile` uses the same defaults it always has unless you opt in: ```bash -make -f Makefile.starkernel ARCH=amd64 menuconfig -make -f Makefile.starkernel ARCH=amd64 kernel_amd64_defconfig +make -f kernel/Makefile ARCH=amd64 menuconfig +make -f kernel/Makefile ARCH=amd64 kernel_amd64_defconfig ``` --- diff --git a/boards/README.md b/boards/README.md new file mode 100644 index 00000000..3816786f --- /dev/null +++ b/boards/README.md @@ -0,0 +1,29 @@ +# boards/ + +One directory per physical target. `make boot_image TARGET=` (repo root) maps the +name to a directory here, reads its `board.mk`, and builds the single file that goes on +that board's boot medium into `build/boards//`. + +| TARGET | Directory | ISA | Boot path | Image | +|---|---|---|---|---| +| `SER5` | `ser5/` | amd64 | UEFI firmware, removable-media path | GPT + FAT32 ESP: `EFI/BOOT/BOOTX64.EFI` | +| `RASPI` | `raspi/` | aarch64 | Pi 5 EEPROM firmware, native | MBR + FAT32: `config.txt`, `kernel_2712.img`, `bcm2712-rpi-5-b.dtb` | +| `MILKV` | `milkv/` | riscv64 | SPI-flash U-Boot + OpenSBI, `bootefi` | GPT + FAT32 ESP: `EFI/BOOT/BOOTRISCV64.EFI` | +| `ZYNQ7020` | `zynq7020/` | armv7 | BootROM, `BOOT.BIN`, U-Boot | not yet: needs `kernel/src/arch/armv7` | + +`board.mk` sets: + +- `BOARD_DESC`: one-line description (`make boards`) +- `BOARD_ARCH`: kernel ISA (`kernel/src/arch/`) +- `BOARD_BOOT`: image recipe in `kernel/Makefile` (`uefi-esp`, `rpi-native`, ...) +- `BOARD_IMAGE`: output file name + +Disk images are assembled by `scripts/mkdiskimage.sh`, which needs no root access and no loop +devices. `KERNEL_ARGS="..."` is written as `starforth.cfg` (UEFI boards) or `cmdline.txt` +(Pi 5, where the firmware copies it into `/chosen/bootargs`). `BOOT_IMAGE_SIZE_MIB` sets the +image size; the default is 128. + +Hardware status: none of these images has been booted on real silicon from this build. The +SER5 image has been booted in QEMU (q35 + OVMF, from its own disk) through POST. The Pi 5 +native path (`raspi/README.md`) and the JH7110 peripherals have still only been checked by +compiling. diff --git a/boards/milkv/README.md b/boards/milkv/README.md new file mode 100644 index 00000000..63a9c99a --- /dev/null +++ b/boards/milkv/README.md @@ -0,0 +1,30 @@ +# Milk-V Mars boot media + +`make boot_image TARGET=MILKV` builds `build/boards/milkv/lithos-milkv.img`: a GPT disk with one +FAT32 EFI System Partition. Write it to an SD card with `dd`. The partition holds: + +- `EFI/BOOT/BOOTRISCV64.EFI`: the riscv64 monolithic loader, the same one QEMU boots. +- `startup.nsh`: for a UEFI shell, if one is used. +- `starforth.cfg`: only present when `KERNEL_ARGS="..."` is given. + +The board's own SPI-flash U-Boot, with OpenSBI underneath, finds the loader through its standard +`bootefi` scan of the removable-media path. U-Boot passes its devicetree to the loader through the +EFI configuration table. + +Status: booted in QEMU through the same chain the board uses: OpenSBI, then U-Boot +`qemu-riscv64_smode`, then `bootefi` from this image's ESP, then the loader and the kernel. POST +passed, Stadium conservation was exact (resident 43691 + reservoir 21845 = 65536 = `Q48_ONE`), and +Hestia and Artemis came up. Not yet booted on the Mars itself. The JH7110 peripherals +(framebuffer, RNG) have only been checked by compiling. + +To repeat the QEMU boot (`qemu-system-riscv64` is in Ubuntu 26.04's `qemu-system-riscv` package; +OpenSBI and U-Boot come from `opensbi` and `u-boot-qemu`). Use a copy, because the kernel writes +to its disk: + +``` +cp build/boards/milkv/lithos-milkv.img /tmp/mv.img +qemu-system-riscv64 -machine virt -cpu rv64 -m 2048 -nographic \ + -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_dynamic.bin \ + -kernel /usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin \ + -drive if=none,format=raw,file=/tmp/mv.img,id=d0 -device virtio-blk-device,drive=d0 +``` diff --git a/boards/milkv/board.mk b/boards/milkv/board.mk new file mode 100644 index 00000000..64ed1490 --- /dev/null +++ b/boards/milkv/board.mk @@ -0,0 +1,11 @@ +# boards/milkv/board.mk -- Milk-V Mars (StarFive JH7110, SiFive U74, RV64GC). +# +# The board's own SPI-flash U-Boot (OpenSBI underneath) runs the EFI +# application through its standard distro/bootefi scan: the SD card is a GPT +# disk with one FAT32 EFI System Partition holding EFI/BOOT/BOOTRISCV64.EFI, +# the same riscv64 monolithic loader QEMU boots. U-Boot passes its own +# devicetree through the EFI configuration table. +BOARD_DESC := Milk-V Mars (StarFive JH7110, RV64GC, U-Boot bootefi) +BOARD_ARCH := riscv64 +BOARD_BOOT := uefi-esp +BOARD_IMAGE := lithos-milkv.img diff --git a/boards/raspi/README.md b/boards/raspi/README.md new file mode 100644 index 00000000..d3e3e2d6 --- /dev/null +++ b/boards/raspi/README.md @@ -0,0 +1,20 @@ +# Raspberry Pi 5 native boot media + +`make boot_image TARGET=RASPI` builds `build/boards/raspi/lithos-raspi.img`: an MBR disk +with one FAT32 (LBA) partition. Write it to an SD card with `dd`. The partition holds: + +- `config.txt`: checked in here (FABRIC-3.md §IV.3 item 6). It pins `kernel_address=0x80000` + because Pi 5 firmware loads `kernel_2712.img` at 0x200000 by default. +- `kernel_2712.img`: the aarch64 kernel objects relinked at 0x80000 by + `kernel/linker/starkernel-native-rpi5.ld`, entered at `rpi5_native_start` + (`kernel/src/arch/aarch64/native_rpi5_entry.S`, which zeroes `.bss` first), and flattened + with `objcopy -O binary`. +- `bcm2712-rpi-5-b.dtb`: the Raspberry Pi firmware's own stock DTB. It is not built by this + project; it is fetched once from the firmware release pinned in `board.mk` + (`RPI_FIRMWARE_TAG`) into `build/cache/`. To use a local copy, pass `RPI5_DTB=/path/to/dtb`. +- `cmdline.txt`: only present when `KERNEL_ARGS="..."` is given. The firmware copies it into + `/chosen/bootargs`, which `rpi5_native_boot()` parses. + +Not yet verified on hardware. The native path still assumes everything `kernel_main()` +needs after a UEFI handoff. The firmware enters at EL2 with the MMU off, which is not what +UEFI hands over, and that difference has not been exercised. diff --git a/boards/raspi/board.mk b/boards/raspi/board.mk new file mode 100644 index 00000000..9555bbf9 --- /dev/null +++ b/boards/raspi/board.mk @@ -0,0 +1,18 @@ +# boards/raspi/board.mk -- Raspberry Pi 5 (BCM2712, Cortex-A76, aarch64). +# +# Native firmware boot, no UEFI (FABRIC-3.md §IV): the Pi 5 bootloader +# lives in EEPROM and reads config.txt, kernel_2712.img and the board DTB +# from the first FAT partition of the SD card. kernel_2712.img is the +# aarch64 kernel relinked at 0x80000 (kernel/linker/starkernel-native-rpi5.ld) +# and flattened to a raw binary. +# +# The DTB is the Raspberry Pi firmware's own stock file, not built here. It +# is fetched once from the pinned firmware release below into build/cache/ +# unless RPI5_DTB points at a local copy. +BOARD_DESC := Raspberry Pi 5 (BCM2712, Cortex-A76, native firmware boot) +BOARD_ARCH := aarch64 +BOARD_BOOT := rpi-native +BOARD_IMAGE := lithos-raspi.img +RPI_FIRMWARE_TAG ?= 1.20260915 +RPI5_DTB_URL ?= https://raw.githubusercontent.com/raspberrypi/firmware/$(RPI_FIRMWARE_TAG)/boot/bcm2712-rpi-5-b.dtb +RPI5_DTB ?= build/cache/raspi-$(RPI_FIRMWARE_TAG)/bcm2712-rpi-5-b.dtb diff --git a/boot_media/rpi5/config.txt b/boards/raspi/config.txt similarity index 91% rename from boot_media/rpi5/config.txt rename to boards/raspi/config.txt index 3f084b85..546b7491 100644 --- a/boot_media/rpi5/config.txt +++ b/boards/raspi/config.txt @@ -12,6 +12,13 @@ # firmware picks up. kernel=kernel_2712.img +# Pin the load address to the one the image is linked at +# (kernel/linker/starkernel-native-rpi5.ld). Pi 5 firmware's own default +# for kernel_2712.img is 0x200000, not the classic 0x80000 -- leaving it +# implicit would load a 0x80000-linked flat image 1.5 MiB away from where +# every absolute address in it points. +kernel_address=0x80000 + # Disable the firmware's Linux-compatible-image sanity check. Without # this, official docs describe it as checking for "a compatible Device # Tree file before attempting to boot" and warn that "older non-compatible diff --git a/boards/ser5/README.md b/boards/ser5/README.md new file mode 100644 index 00000000..af4eee17 --- /dev/null +++ b/boards/ser5/README.md @@ -0,0 +1,14 @@ +# Beelink SER5 boot media + +`make boot_image TARGET=SER5` builds `build/boards/ser5/lithos-ser5.img`: a GPT disk with one +FAT32 EFI System Partition. Write it to a USB stick with `dd`. The partition holds: + +- `EFI/BOOT/BOOTX64.EFI`: the amd64 monolithic loader, with the whole kernel embedded. Firmware + finds it through the UEFI removable-media path, so no boot entry has to be created. +- `startup.nsh`: runs the loader if the firmware drops into the UEFI shell. +- `starforth.cfg`: only present when `KERNEL_ARGS="..."` is given. + +Nothing in the image is SER5-specific. It follows the generic UEFI/ACPI path in FABRIC-3.md §III. + +Status: booted in QEMU (q35 + OVMF, from this image as its own disk) through POST, with Stadium +conservation exact (sum 65536 = `Q48_ONE`). Not yet booted on the SER5 itself. diff --git a/boards/ser5/board.mk b/boards/ser5/board.mk new file mode 100644 index 00000000..33df360f --- /dev/null +++ b/boards/ser5/board.mk @@ -0,0 +1,10 @@ +# boards/ser5/board.mk -- Beelink SER5 (AMD Ryzen, x86-64, UEFI/ACPI). +# +# Generic standards-compliant UEFI path (FABRIC-3.md §III): nothing in the +# image is SER5-specific. The monolithic loader embeds the whole kernel, so +# the image is a GPT disk with one FAT32 EFI System Partition holding +# EFI/BOOT/BOOTX64.EFI. Write it to a USB stick with dd. +BOARD_DESC := Beelink SER5 (AMD Ryzen, x86-64, UEFI) +BOARD_ARCH := amd64 +BOARD_BOOT := uefi-esp +BOARD_IMAGE := lithos-ser5.img diff --git a/boards/zynq7020/README.md b/boards/zynq7020/README.md new file mode 100644 index 00000000..b28cad8d --- /dev/null +++ b/boards/zynq7020/README.md @@ -0,0 +1,17 @@ +# Xilinx Zynq-7020 boot media + +The Zynq-7020's processing system is a dual Cortex-A9: ARMv7-A, 32-bit. It is the host for the +StarForth v4 mesh (`docs/v4.0.0/JUSTIFICATION.md` §5, §8). + +Boot chain: BootROM, then `BOOT.BIN` (U-Boot SPL with the board's `ps7_init` DDR and clock setup), +then U-Boot, then LithosAnanke. Everything is read from the SD card's FAT partition. + +Status: no image yet. `make boot_image TARGET=ZYNQ7020` stops with an error, because there is no +ARMv7 kernel port (`kernel/src/arch/armv7`: entry code, MMU, GIC, private timer). A trial +compile for Cortex-A9 built 147 of the 151 kernel and engine sources. The four that failed use +`__int128` or have no ARMv7 branch: `kernel/src/crypto/fe25519.c`, +`kernel/src/crypto/scalar25519.c`, `kernel/src/hal/hal.c` and +`v3/src/word_source/mixed_arithmetic_words.c`. + +`BOOT.BIN` depends on the exact board (Zybo Z7-20, PYNQ-Z2, Arty Z7-20, ZedBoard, ...), because +`ps7_init` holds that board's DDR timing. The board has not been chosen yet. diff --git a/boards/zynq7020/board.mk b/boards/zynq7020/board.mk new file mode 100644 index 00000000..9fbd1ab5 --- /dev/null +++ b/boards/zynq7020/board.mk @@ -0,0 +1,11 @@ +# boards/zynq7020/board.mk -- Xilinx Zynq-7020 (dual Cortex-A9, ARMv7-A, 32-bit). +# +# Boot chain: BootROM -> BOOT.BIN (U-Boot SPL with the board's ps7_init DDR/ +# clock setup) -> U-Boot -> LithosAnanke, all from the SD card's FAT +# partition. Needs the ARMv7 kernel port (kernel/src/arch/armv7), which is +# in progress: until it exists, boot_image stops with an explicit error +# rather than producing an image that cannot run. +BOARD_DESC := Xilinx Zynq-7020 (Cortex-A9, ARMv7-A, BOOT.BIN) -- ARMv7 port in progress +BOARD_ARCH := armv7 +BOARD_BOOT := zynq-bootbin +BOARD_IMAGE := lithos-zynq7020.img diff --git a/boot_media/rpi5/README.md b/boot_media/rpi5/README.md deleted file mode 100644 index a1f7cd4e..00000000 --- a/boot_media/rpi5/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Raspberry Pi 5 native boot media - -What goes on the SD card for the native (non-UEFI) boot path (FABRIC-3.md §IV): - -- `config.txt` — checked in here, done (§IV.3 item 6). -- `bcm2712-rpi-5-b.dtb` — Raspberry Pi firmware's own stock DTB; not built by this - project, copied from the firmware release the card is otherwise built from. -- `kernel_2712.img` — **does not exist yet.** `config.txt` names it, but no build target - in `Makefile.starkernel` currently emits a raw image by this name at load address - 0x80000 — item 1 (entry stub) explicitly scoped a separate-image build target as future - work, not part of that item. Building this file is the remaining prerequisite before - item 7 (assembling the card) is possible. diff --git a/capsules/BLOCK_MAP.md b/capsules/BLOCK_MAP.md index 57fdf053..d2477242 100644 --- a/capsules/BLOCK_MAP.md +++ b/capsules/BLOCK_MAP.md @@ -1,5 +1,5 @@ # Capsule Block Manifest — Auto-generated - + @@ -8,42 +8,44 @@ | Capsule | Blocks claimed | xxHash64 | Signed | |---------|----------------|----------|--------| -| `ACL.4th` | 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4015 | `0xf8890c05c0d8f921` | yes | -| `acl-std79.4th` | 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048 | `0x773bf9209df191d1` | yes | -| `artemis:init.4th` | 4110, 4111, 4112, 4113, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4177, 4178, 4179, 4180, 4181, 4182, 4851, 4852, 4853, 4854, 4856, 4857, 4858, 4860 | `0xe6fba9ae56e1c916` | yes | -| `block-acl.4th` | 4019, 4020 | `0xf6cc2a59e3a6734e` | yes | -| `doe-campaign.4th` | 4060, 4061, 4062, 4063, 4064, 4065 | `0x26fb485e5c9dc6ff` | yes | -| `doe.4th` | 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107 | `0xf154616d248e861f` | yes | -| `fabric.4th` | 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 5000, 5001, 5002 | `0x9d9489cbeca4099b` | yes | -| `font.4th` | 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985 | `0x3f305911500c78f6` | yes | -| `hestia:init.4th` | 4986, 4987, 4988 | `0x64e111990fbc45ff` | yes | -| `init-l8-diverse.4th` | 4820, 4821, 4822 | `0xaa293201a6c91838` | yes | -| `init-l8-omni.4th` | 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079 | `0x5979e314d6452045` | yes | -| `init-l8-stable.4th` | 4806 | `0xdc3830f189063a9a` | yes | -| `init-l8-temporal.4th` | 4830, 4831 | `0x51abd4c138246651` | yes | -| `init-l8-transition.4th` | 4840, 4841, 4842 | `0xbcc1a81976f0a4c9` | yes | -| `init-l8-volatile.4th` | 4810, 4811, 4812, 4813 | `0x98caabbbd92abac4` | yes | -| `init.4th` | 2049, 2050, 2057 | `0xea038ba684c53443` | yes | -| `lib.4th` | 4050 | `0x4b216635c359ef73` | yes | -| `multiuser-doe.4th` | 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055 | `0x22140588ee7c39e6` | yes | -| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` | yes | -| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` | yes | -| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | yes | -| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | yes | -| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | yes | -| `workload-1.4th` | 4406, 4415, 4425, 4435 | `0x63e251adb0a03613` | yes | -| `workload-2.4th` | 4506, 4515, 4525, 4535, 4545 | `0xf113b3d0bcccae47` | yes | -| `workload-3.4th` | 4606, 4615, 4625, 4635, 4645, 4655, 4665 | `0x62b7a71576ad1041` | yes | -| `workload-4.4th` | 2130, 2131, 2132 | `0x099619264e650b1c` | yes | -| `workload-5-lite.4th` | 5056, 5057 | `0xea0303f38824f254` | yes | -| `workload-5.4th` | *(none — raw code capsule)* | `0x526964c7c9506a11` | yes | -| `workload-6.4th` | 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095 | `0x06fc0ce1e369ef5a` | yes | -| `workload-7.4th` | 2150 | `0x02862291387eb7ac` | yes | -| `workload-8.4th` | 2160 | `0x56b7f2f0efa000df` | yes | -| `workload-9.4th` | 4706, 4715, 4725, 4735, 4745 | `0x3f2bec73142aa424` | yes | -| `workload-calib1.4th` | 5043 | `0x3b9f2d17b554fabc` | yes | -| `zuse-eligibility.4th` | 4021, 4022 | `0x7b28f4776a32e0b7` | yes | -| `zuse.4th` | 4016, 4017, 4018 | `0x490ded9be257a90b` | yes | +| `ACL.4th` | 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4015 | `0xf8890c05c0d8f921` | n/a | +| `acl-std79.4th` | 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048 | `0x773bf9209df191d1` | n/a | +| `artemis:init.4th` | 4110, 4111, 4112, 4113, 4122, 4123, 4124, 4125, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140, 4141, 4160, 4161, 4162, 4163, 4164, 4165, 4166, 4167, 4168, 4169, 4170, 4171, 4172, 4173, 4174, 4177, 4178, 4179, 4180, 4181, 4182, 4851, 4852, 4853, 4854, 4856, 4857, 4858, 4860 | `0xe6fba9ae56e1c916` | n/a | +| `block-acl.4th` | 4019, 4020 | `0xf6cc2a59e3a6734e` | n/a | +| `doe-campaign.4th` | 4060, 4061, 4062, 4063, 4064, 4065 | `0x26fb485e5c9dc6ff` | n/a | +| `doe.4th` | 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107 | `0xf154616d248e861f` | n/a | +| `fabric.4th` | 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924, 5000, 5001, 5002 | `0x9d9489cbeca4099b` | n/a | +| `font.4th` | 4925, 4926, 4927, 4928, 4929, 4930, 4931, 4932, 4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4951, 4952, 4953, 4954, 4955, 4956, 4957, 4958, 4959, 4960, 4961, 4962, 4963, 4964, 4965, 4966, 4967, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 4976, 4977, 4978, 4979, 4980, 4981, 4982, 4983, 4984, 4985 | `0x3f305911500c78f6` | n/a | +| `hestia:init.4th` | 4986, 4987, 4988 | `0x64e111990fbc45ff` | n/a | +| `init-l8-diverse.4th` | 4820, 4821, 4822 | `0xaa293201a6c91838` | n/a | +| `init-l8-omni.4th` | 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079 | `0x5979e314d6452045` | n/a | +| `init-l8-stable.4th` | 4806 | `0xdc3830f189063a9a` | n/a | +| `init-l8-temporal.4th` | 4830, 4831 | `0x51abd4c138246651` | n/a | +| `init-l8-transition.4th` | 4840, 4841, 4842 | `0xbcc1a81976f0a4c9` | n/a | +| `init-l8-volatile.4th` | 4810, 4811, 4812, 4813 | `0x98caabbbd92abac4` | n/a | +| `init.4th` | 2049, 2050, 2057 | `0xea038ba684c53443` | n/a | +| `lib.4th` | 4050 | `0x4b216635c359ef73` | n/a | +| `multiuser-doe.4th` | 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055 | `0x22140588ee7c39e6` | n/a | +| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` | n/a | +| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` | n/a | +| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | n/a | +| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | n/a | +| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | n/a | +| `workload-1.4th` | 4406, 4415, 4425, 4435 | `0x63e251adb0a03613` | n/a | +| `workload-2.4th` | 4506, 4515, 4525, 4535, 4545 | `0xf113b3d0bcccae47` | n/a | +| `workload-3.4th` | 4606, 4615, 4625, 4635, 4645, 4655, 4665 | `0x62b7a71576ad1041` | n/a | +| `workload-4.4th` | 2130, 2131, 2132 | `0x099619264e650b1c` | n/a | +| `workload-5-lite.4th` | 5056, 5057 | `0xea0303f38824f254` | n/a | +| `workload-5.4th` | *(none — raw code capsule)* | `0x526964c7c9506a11` | n/a | +| `workload-6.4th` | 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095 | `0x06fc0ce1e369ef5a` | n/a | +| `workload-7.4th` | 2150 | `0x02862291387eb7ac` | n/a | +| `workload-8.4th` | 2160 | `0x56b7f2f0efa000df` | n/a | +| `workload-9.4th` | 4706, 4715, 4725, 4735, 4745 | `0x3f2bec73142aa424` | n/a | +| `workload-calib1.4th` | 5043 | `0x3b9f2d17b554fabc` | n/a | +| `zuse-eligibility.4th` | 4021, 4022 | `0x7b28f4776a32e0b7` | n/a | +| `zuse.4th` | 4016, 4017, 4018 | `0xa14d5a7a88791cf6` | n/a | + +*Signed column is `n/a`: this manifest run had no `--sign-key`. Re-run with `--sign-key ` to check signing status (does not modify or require rebuilding capsule_generated.c).* ## Block Map (sorted by LBN) @@ -109,9 +111,9 @@ | 4007 | `ACL.4th` | `0xf8890c05c0d8f921` | ok | | 4008 | `ACL.4th` | `0xf8890c05c0d8f921` | ok | | 4015 | `ACL.4th` | `0xf8890c05c0d8f921` | ok | -| 4016 | `zuse.4th` | `0x490ded9be257a90b` | ok | -| 4017 | `zuse.4th` | `0x490ded9be257a90b` | ok | -| 4018 | `zuse.4th` | `0x490ded9be257a90b` | ok | +| 4016 | `zuse.4th` | `0xa14d5a7a88791cf6` | ok | +| 4017 | `zuse.4th` | `0xa14d5a7a88791cf6` | ok | +| 4018 | `zuse.4th` | `0xa14d5a7a88791cf6` | ok | | 4019 | `block-acl.4th` | `0xf6cc2a59e3a6734e` | ok | | 4020 | `block-acl.4th` | `0xf6cc2a59e3a6734e` | ok | | 4021 | `zuse-eligibility.4th` | `0x7b28f4776a32e0b7` | ok | diff --git a/configs/README.md b/configs/README.md index dfe48f80..1cc77e37 100644 --- a/configs/README.md +++ b/configs/README.md @@ -1,7 +1,7 @@ # configs/ Example Kconfig `defconfig` files — starting points for `make -f -Makefile.starkernel ARCH= defconfig` (kernel) or the equivalent +kernel/Makefile ARCH= defconfig` (kernel) or the equivalent hosted target, matching the current committed default build behavior for each profile. Loaded via `tools/kconfig/conf`. diff --git a/ONTOLOGY.md b/docs/ONTOLOGY.md similarity index 100% rename from ONTOLOGY.md rename to docs/ONTOLOGY.md diff --git a/ROADMAP.md b/docs/ROADMAP.md similarity index 100% rename from ROADMAP.md rename to docs/ROADMAP.md diff --git a/docs/book/Makefile b/docs/book/Makefile new file mode 100644 index 00000000..43481d7c --- /dev/null +++ b/docs/book/Makefile @@ -0,0 +1,112 @@ +# docs/book/Makefile -- the single LithosAnanke book, built from LaTeX. +# +# Run from the repo root (the root Makefile does this): +# make docs -> build/docs/LithosAnanke.pdf +# make docs TARGET= -> build/docs/LithosAnanke-.pdf +# (same book + that board's appendix) +# +# docs/book/main.tex is the master. Markdown sources are converted by pandoc +# into LaTeX fragments under build/docs/gen/ and \input from main.tex; the +# Markdown stays the source of truth until a chapter is rewritten in LaTeX. +# Figures and tables that present data read the CSV directly at LaTeX time +# (pgfplots / pgfplotstable) and cite it with \datasource{path}; see +# docs/book/README.md. + +BOOK_DIR := docs/book +OUT := build/docs +GEN := $(OUT)/gen + +BOARD ?= +BOARD_NAME ?= +VARIANT := $(if $(BOARD),$(BOARD),book) +VAR_DIR := $(OUT)/$(VARIANT) +PDF := $(OUT)/LithosAnanke$(if $(BOARD),-$(BOARD)).pdf + +PANDOC ?= pandoc +LATEXMK ?= latexmk +PANDOC_FILTERS := $(BOOK_DIR)/pandoc/table-widths.lua $(BOOK_DIR)/pandoc/code-breaks.lua +PANDOC_FLAGS := -f gfm -t latex --top-level-division=chapter --wrap=preserve \ + $(foreach f,$(PANDOC_FILTERS),--lua-filter=$(f)) + +# fragment name : Markdown source. The order of \input lines is main.tex's. +CHAPTERS := \ + ontology:docs/ONTOLOGY.md \ + roadmap:docs/ROADMAP.md \ + boards:boards/README.md \ + justification:docs/v4.0.0/JUSTIFICATION.md \ + decomposition:docs/v4.0.0/DECOMPOSITION.md \ + fabric-0:docs/fabric/FABRIC-0.md \ + fabric-1:docs/fabric/FABRIC-1.md \ + fabric-2:docs/fabric/FABRIC-2.md \ + fabric-3:docs/fabric/FABRIC-3.md \ + fabric-3-5:docs/fabric/FABRIC-3.5.md \ + fabric-3-6:docs/fabric/FABRIC-3.6.md \ + fabric-3-7:docs/fabric/FABRIC-3.7.md \ + fabric-4:docs/fabric/FABRIC-4.md + +ifneq ($(BOARD),) +ifeq ($(wildcard boards/$(BOARD)/README.md),) + $(error boards/$(BOARD)/README.md is missing: it is the board's appendix) +endif +CHAPTERS += board-$(BOARD):boards/$(BOARD)/README.md +endif + +chapter_name = $(word 1,$(subst :, ,$(1))) +chapter_src = $(word 2,$(subst :, ,$(1))) +FRAGMENTS := $(foreach c,$(CHAPTERS),$(GEN)/$(call chapter_name,$(c)).tex) + +.PHONY: all tools FORCE +all: $(PDF) + +tools: + @missing=""; \ + for t in $(PANDOC) $(LATEXMK) xelatex; do command -v $$t >/dev/null 2>&1 || missing="$$missing $$t"; done; \ + if [ -n "$$missing" ]; then \ + echo "Error: make docs needs:$$missing"; \ + echo " sudo apt-get install -y pandoc latexmk texlive-xetex texlive-latex-extra texlive-pictures texlive-fonts-recommended fonts-dejavu fonts-dejavu-extra"; \ + echo " (or a user-local TinyTeX + pandoc in ~/.local; see docs/book/README.md)"; \ + exit 1; \ + fi + +# --id-prefix keeps heading labels unique across documents that reuse +# section names ("Summary", "Open questions", ...). +define chapter_rule +$(GEN)/$(call chapter_name,$(1)).tex: $(call chapter_src,$(1)) $(PANDOC_FILTERS) | tools + @mkdir -p $(GEN) + @echo " PANDOC $$< -> $$@" + @$(PANDOC) $(PANDOC_FLAGS) --id-prefix=$(call chapter_name,$(1))- $$< -o $$@ +endef +$(foreach c,$(CHAPTERS),$(eval $(call chapter_rule,$(c)))) + +# Pandoc's syntax-highlighting macros, taken from the installed pandoc so the +# fragments and their macros always come from the same version. +$(GEN)/pandoc-highlighting.tex: $(BOOK_DIR)/pandoc/highlighting.latex | tools + @mkdir -p $(GEN) + @printf '```c\nx\n```\n' | $(PANDOC) -f gfm -t latex -s --template=$< -o $@ + +# Per-build facts the book prints: the commit every \datasource refers to, +# and which board appendix (if any) is included. +$(VAR_DIR)/meta.tex: FORCE + @mkdir -p $(VAR_DIR) + @{ \ + c=$$(git rev-parse --short=12 HEAD 2>/dev/null || echo unknown); \ + git diff --quiet HEAD -- 2>/dev/null || c="$$c (+ uncommitted changes)"; \ + printf '\\newcommand{\\bookcommit}{%s}\n' "$$c"; \ + printf '\\newcommand{\\bookdate}{%s}\n' "$$(date -u +%Y-%m-%d)"; \ + printf '\\def\\bookboard{%s}\n' "$(BOARD_NAME)"; \ + $(if $(BOARD),printf '\\newcommand{\\bookboardappendix}{board-%s}\n' "$(BOARD)";) \ + } > $@.tmp + @cmp -s $@.tmp $@ && rm -f $@.tmp || mv $@.tmp $@ + +FORCE: + +TEXINPUTS_BOOK := $(abspath $(VAR_DIR)):$(abspath $(GEN)):$(abspath $(BOOK_DIR)): + +$(PDF): $(BOOK_DIR)/main.tex $(FRAGMENTS) $(GEN)/pandoc-highlighting.tex $(VAR_DIR)/meta.tex | tools + @echo " LATEXMK $(BOOK_DIR)/main.tex -> $@" + @TEXINPUTS=$(TEXINPUTS_BOOK) $(LATEXMK) -xelatex -interaction=nonstopmode -halt-on-error \ + -file-line-error -outdir=$(VAR_DIR) $(BOOK_DIR)/main.tex > $(VAR_DIR)/latexmk.log 2>&1 || { \ + grep -A4 -E '^(.*:[0-9]+:|!)' $(VAR_DIR)/main.log | head -40; \ + echo "Error: LaTeX failed; full log: $(VAR_DIR)/main.log"; exit 1; } + @cp $(VAR_DIR)/main.pdf $@ + @echo " PDF $@" diff --git a/docs/book/README.md b/docs/book/README.md new file mode 100644 index 00000000..eedb4db7 --- /dev/null +++ b/docs/book/README.md @@ -0,0 +1,66 @@ +# docs/book/ + +`make docs` builds one PDF, `build/docs/LithosAnanke.pdf`, from `main.tex` with xelatex. +`make docs TARGET=` builds `build/docs/LithosAnanke-.pdf`: the same book with +`boards//README.md` added as an appendix. + +Tools: `sudo apt-get install -y pandoc latexmk texlive-xetex texlive-latex-extra texlive-pictures texlive-fonts-recommended fonts-dejavu fonts-dejavu-extra` + +Without root, a user-local TeX Live works too (this is how the book was first built): +TinyTeX (`curl -sL https://yihui.org/tinytex/install-bin-unix.sh | sh`) plus +`tlmgr install latexmk xetex fontspec pgf pgfplots booktabs multirow fancyvrb fvextra lineno upquote ulem enumitem newunicodechar bookmark hyperref geometry xcolor graphics tools etoolbox fancyhdr truncate amsfonts`, +and the pandoc release tarball unpacked into `~/.local`. + +The installed DejaVu decides italics: `fonts-dejavu-core` alone has no serif italic, so +`main.tex` falls back to a slanted upright face; `fonts-dejavu-extra` gives real italics. + +## How it fits together + +- `main.tex` is the master file. It sets the parts and the chapter order. +- Chapters that are still Markdown are listed in `Makefile` (`CHAPTERS`, as `name:source.md`). + At build time pandoc converts each one into `build/docs/gen/.tex`, and `main.tex` + includes it with `\input{}`. The Markdown stays the source until the chapter is + rewritten in LaTeX. At that point the `.tex` moves into this directory and the `CHAPTERS` + entry is removed. +- `pandoc/highlighting.latex` extracts the code-highlighting macros from the installed pandoc, + so the macros and the fragments always come from the same pandoc version. +- Two Lua filters run on every chapter. `pandoc/table-widths.lua` gives wide tables + proportional wrapping columns, because pandoc's gfm reader leaves column widths unset. + `pandoc/code-breaks.lua` lets long inline identifiers and paths break after `_ / . - :`. + Code blocks wrap through fvextra (`breaklines`). +- `build/docs//meta.tex` is written on every build. It records the commit (and + whether there were uncommitted changes), the date, and the board. + +## Rule for data + +Any figure or table that shows measured numbers is generated from the CSV when the book is +built. Numbers are never typed in by hand: + +```latex +\begin{tikzpicture} + \begin{axis}[xlabel=run, ylabel=K] + \addplot table[col sep=comma, x=run, y=K]{experiments//results.csv}; + \end{axis} +\end{tikzpicture} +\datasource{experiments//results.csv} +``` + +Use `\pgfplotstabletypeset[col sep=comma]{...}` for tables. `\datasource` prints the CSV path +and the commit, so a reader can find the exact file the figure was drawn from. CSV paths are +repo-relative, because xelatex runs from the repo root. + +## Older pipelines to fold in or retire + +These still exist and still have their own targets. Each one needs a decision during the +curation pass: move it into this book, or retire it. + +| Source | Current target | Produces | +|---|---|---| +| `docs/formal/vol1-vm-physics`, `vol2-kernel`, `vol3-research` | `make -C docs/formal vols` | three volume PDFs | +| `docs/formal/dev-guide`, `user-guide`, `cookbook` | `make -C docs/formal books` | three practitioner PDFs | +| `docs/formal/experiments`, `proofs`, `ssrn`, `patent` | `make -C docs/formal standalone` | four standalone PDFs | +| Doxygen (`Doxyfile`) | `make -C docs/formal doxygen` | API reference PDF | +| `scripts/generate-doxygen-appendix.sh` | `make -f v3/Makefile api-docs` | AsciiDoc API appendix | +| `docs/src/internal/formal/*.thy` | `make -f v3/Makefile docs-isabelle` | Isabelle report | +| `scripts/asciidoc-to-latex.sh` | `make -f v3/Makefile docs-latex` | `docs/latex/` | +| `docs/SSRN_companion/Math_Companion_SSRN.tex` | `make -f v3/Makefile math-companion` | SSRN math companion | diff --git a/docs/book/main.tex b/docs/book/main.tex new file mode 100644 index 00000000..5435e9dc --- /dev/null +++ b/docs/book/main.tex @@ -0,0 +1,161 @@ +% docs/book/main.tex -- master file of the single LithosAnanke book. +% +% Built by `make docs [TARGET=]` (docs/book/Makefile) with xelatex. +% Fragments named below (ontology, fabric-0, ...) are generated by pandoc +% from the Markdown listed in docs/book/Makefile's CHAPTERS into +% build/docs/gen/; meta.tex is generated per build. Neither is committed. +\documentclass[11pt,openany]{book} + +\usepackage{amsmath,amssymb} +\usepackage{fontspec} +% fonts-dejavu-core has no serif/sans italics (fonts-dejavu-extra does); when a +% shape is missing, slant the upright one rather than silently drop emphasis. +\setmainfont{DejaVu Serif}[AutoFakeSlant=0.2] +\setsansfont{DejaVu Sans}[AutoFakeSlant=0.2] +\setmonofont{DejaVu Sans Mono}[Scale=0.85] +\newfontfamily\symbolfont{DejaVu Sans} + +\usepackage[letterpaper,margin=1in]{geometry} +\usepackage{xcolor} +\usepackage{graphicx} +\usepackage{longtable,booktabs,array,calc,multirow} +\usepackage{fancyvrb} +\usepackage[normalem]{ulem} +\usepackage{enumitem} +\usepackage{newunicodechar} +\usepackage{pgfplots} +\usepackage{pgfplotstable} +\pgfplotsset{compat=1.18} +\usepackage[hidelinks]{hyperref} +\usepackage{bookmark} + +% --- what pandoc's LaTeX fragments expect (normally from its own template) +\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +\providecommand{\pandocbounded}[1]{#1} +\providecommand{\st}[1]{\sout{#1}} +\newcounter{none} % pandoc: {\def\LTcaptype{none} ...} marks unnumbered tables +\usepackage{etoolbox} +\makeatletter +\def\fnum@table{\tablename~\thetable} +\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} +\makeatother +\usepackage{fvextra} +\input{pandoc-highlighting} +% Code and diagrams are wider than the page in places: wrap, never overflow. +\RecustomVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\},breaklines,breakanywhere,fontsize=\small} +\RecustomVerbatimEnvironment{verbatim}{Verbatim}{breaklines,breakanywhere,fontsize=\small} +\setlistdepth{9} +\renewlist{itemize}{itemize}{9} +\setlist[itemize]{label=\textbullet} +\renewlist{enumerate}{enumerate}{9} +\setlist[enumerate]{label=\arabic*.} +% Running heads: chapter on the left page, section on the right, both cut to +% the page width (several design-record titles are a full sentence long). +\usepackage{fancyhdr} +\usepackage[fit]{truncate} +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{\markright{#1}} +\fancyhead[LE]{\small\truncate{\dimexpr\headwidth-3em}{\leftmark}} +\fancyhead[RO]{\small\truncate{\dimexpr\headwidth-3em}{\rightmark}} +\fancyhead[RE,LO]{\small\thepage} +\renewcommand{\headrulewidth}{0.4pt} +\setlength{\headheight}{14pt} +\fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\small\thepage}\renewcommand{\headrulewidth}{0pt}} +\setlength{\emergencystretch}{3em} +\setlength{\parindent}{0pt} +\setlength{\parskip}{0.5em} + +% --- glyphs DejaVu Serif lacks: the status marks used across the docs +\newunicodechar{✅}{{\symbolfont ✔}} +\newunicodechar{✓}{{\symbolfont ✓}} +\newunicodechar{❌}{{\symbolfont ✘}} +\newunicodechar{✗}{{\symbolfont ✗}} +\newunicodechar{⬜}{{\symbolfont ☐}} +\newunicodechar{⭐}{{\symbolfont ★}} +\newunicodechar{🔶}{{\symbolfont ◆}} +\newunicodechar{⚠}{{\symbolfont ⚠}} +\newunicodechar{📋}{} +\newunicodechar{🐛}{[bug]} +\newunicodechar{🎯}{[goal]} +\newunicodechar{🟡}{{\symbolfont ●}} +\newunicodechar{📍}{{\symbolfont ▸}} +\newunicodechar{🔓}{[unlocked]} +\newunicodechar{❓}{?} +\newunicodechar{⟺}{\ensuremath{\Longleftrightarrow}} +\newunicodechar{⋯}{\ensuremath{\cdots}} +\newunicodechar{^^^^fe0f}{} + +% --- the documents number their own sections (§III.1, D-3, ...) +\setcounter{secnumdepth}{0} +\setcounter{tocdepth}{1} + +\input{meta} + +% \datasource{path/to/data.csv}: cite the data behind a figure or table. +% Every figure or table of measured numbers reads its CSV at build time +% (\addplot table / \pgfplotstabletypeset) and is followed by this line, so +% the reader can find the exact file at the exact commit. +\newcommand{\datasource}[1]{% + \par{\small Data: \texttt{\detokenize{#1}} at commit \texttt{\bookcommit}.}\par} + +\title{LithosAnanke and StarForth} +\author{} +\date{Built \bookdate{} from commit \texttt{\bookcommit}% + \ifx\bookboard\empty\else\\Board appendix: \bookboard\fi} + +\begin{document} +\frontmatter +\maketitle +\tableofcontents + +\chapter{About this book} +This book is generated from the repository by \texttt{make docs}. Each +chapter below is still maintained as the Markdown file named in the table and +converted at build time; a chapter moves into LaTeX source when it is +rewritten. Part~III is the design record: those documents are archival and +are reproduced as written, including their struck-through corrections. + +\begin{longtable}{@{}ll@{}} +\toprule +Chapter & Source \\ +\midrule +\endhead +Ontology & \texttt{docs/ONTOLOGY.md} \\ +Roadmap & \texttt{docs/ROADMAP.md} \\ +Boot targets & \texttt{boards/README.md} \\ +v4 justification & \texttt{docs/v4.0.0/JUSTIFICATION.md} \\ +v4 decomposition & \texttt{docs/v4.0.0/DECOMPOSITION.md} \\ +FABRIC-0 \dots{} FABRIC-4 & \texttt{docs/fabric/FABRIC-*.md} \\ +Board appendix (\texttt{TARGET=}) & \texttt{boards//README.md} \\ +\bottomrule +\end{longtable} + +\mainmatter + +\part{The system} +\input{ontology} +\input{roadmap} +\input{boards} + +\part{StarForth v4} +\input{justification} +\input{decomposition} + +\part{Design record (FABRIC series)} +\input{fabric-0} +\input{fabric-1} +\input{fabric-2} +\input{fabric-3} +\input{fabric-3-5} +\input{fabric-3-6} +\input{fabric-3-7} +\input{fabric-4} + +\ifdefined\bookboardappendix +\appendix +\input{\bookboardappendix} +\fi + +\end{document} diff --git a/docs/book/pandoc/code-breaks.lua b/docs/book/pandoc/code-breaks.lua new file mode 100644 index 00000000..ec8bc5f5 --- /dev/null +++ b/docs/book/pandoc/code-breaks.lua @@ -0,0 +1,29 @@ +-- docs/book/pandoc/code-breaks.lua +-- +-- Inline code in the design record is full of long identifiers and paths +-- (g_wirebind_attached_username, kernel/src/arch/riscv64/...), which LaTeX +-- cannot break, so they run into the margin. Emit inline code as \texttt +-- ourselves, escaped the same way pandoc does, with a break opportunity +-- after each separator character. + +local BREAK_AFTER = { ["_"] = true, ["/"] = true, ["."] = true, ["-"] = true, + [":"] = true, [","] = true, ["("] = true, ["="] = true } + +local ESCAPE = { + ["\\"] = "\\textbackslash{}", ["{"] = "\\{", ["}"] = "\\}", + ["$"] = "\\$", ["&"] = "\\&", ["#"] = "\\#", ["%"] = "\\%", ["_"] = "\\_", + ["^"] = "\\textasciicircum{}", ["~"] = "\\textasciitilde{}", + ["'"] = "\\textquotesingle{}", ["`"] = "\\textasciigrave{}", + [" "] = "\\ ", +} + +function Code(el) + if not FORMAT:match("latex") then return nil end + local out = {} + for _, cp in utf8.codes(el.text) do + local ch = utf8.char(cp) + out[#out + 1] = ESCAPE[ch] or ch + if BREAK_AFTER[ch] then out[#out + 1] = "\\allowbreak{}" end + end + return pandoc.RawInline("latex", "\\texttt{" .. table.concat(out) .. "}") +end diff --git a/docs/book/pandoc/highlighting.latex b/docs/book/pandoc/highlighting.latex new file mode 100644 index 00000000..c8427f53 --- /dev/null +++ b/docs/book/pandoc/highlighting.latex @@ -0,0 +1,3 @@ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ diff --git a/docs/book/pandoc/table-widths.lua b/docs/book/pandoc/table-widths.lua new file mode 100644 index 00000000..4f74a020 --- /dev/null +++ b/docs/book/pandoc/table-widths.lua @@ -0,0 +1,55 @@ +-- docs/book/pandoc/table-widths.lua +-- +-- pandoc's gfm reader leaves every column width unset, so the LaTeX writer +-- emits `l` columns and a table with long cells runs off the page. For any +-- table wider than WIDE characters, give each column a width proportional +-- to its longest cell (clamped to [MIN_COL, MAX_COL] characters); the +-- writer then emits wrapping p{} columns that together fill \linewidth. + +local WIDE = 72 +local MIN_COL = 6 +local MAX_COL = 60 + +local stringify = pandoc.utils.stringify + +local function measure(rows, widths) + for _, row in ipairs(rows) do + local col = 1 + for _, cell in ipairs(row.cells) do + local span = cell.col_span or 1 + local len = utf8.len(stringify(cell.contents)) or #stringify(cell.contents) + local per = len / span + for c = col, col + span - 1 do + if per > (widths[c] or 0) then widths[c] = per end + end + col = col + span + end + end +end + +function Table(tbl) + local n = #tbl.colspecs + local widths = {} + for i = 1, n do widths[i] = 0 end + + measure(tbl.head.rows, widths) + for _, body in ipairs(tbl.bodies) do + measure(body.head, widths) + measure(body.body, widths) + end + measure(tbl.foot.rows, widths) + + local total = 0 + for i = 1, n do total = total + widths[i] end + if total <= WIDE then return nil end + + local sum = 0 + for i = 1, n do + widths[i] = math.max(MIN_COL, math.min(MAX_COL, widths[i])) + sum = sum + widths[i] + end + for i = 1, n do + tbl.colspecs[i] = { tbl.colspecs[i][1], widths[i] / sum } + end + return tbl +end diff --git a/FABRIC-0.md b/docs/fabric/FABRIC-0.md similarity index 100% rename from FABRIC-0.md rename to docs/fabric/FABRIC-0.md diff --git a/FABRIC-1.md b/docs/fabric/FABRIC-1.md similarity index 100% rename from FABRIC-1.md rename to docs/fabric/FABRIC-1.md diff --git a/FABRIC-2.md b/docs/fabric/FABRIC-2.md similarity index 100% rename from FABRIC-2.md rename to docs/fabric/FABRIC-2.md diff --git a/FABRIC-3.5.md b/docs/fabric/FABRIC-3.5.md similarity index 100% rename from FABRIC-3.5.md rename to docs/fabric/FABRIC-3.5.md diff --git a/FABRIC-3.6.md b/docs/fabric/FABRIC-3.6.md similarity index 100% rename from FABRIC-3.6.md rename to docs/fabric/FABRIC-3.6.md diff --git a/FABRIC-3.7.md b/docs/fabric/FABRIC-3.7.md similarity index 100% rename from FABRIC-3.7.md rename to docs/fabric/FABRIC-3.7.md diff --git a/FABRIC-3.md b/docs/fabric/FABRIC-3.md similarity index 100% rename from FABRIC-3.md rename to docs/fabric/FABRIC-3.md diff --git a/FABRIC-4.md b/docs/fabric/FABRIC-4.md similarity index 100% rename from FABRIC-4.md rename to docs/fabric/FABRIC-4.md diff --git a/Makefile.starkernel b/kernel/Makefile similarity index 84% rename from Makefile.starkernel rename to kernel/Makefile index ccb035d1..2ea15960 100644 --- a/Makefile.starkernel +++ b/kernel/Makefile @@ -1,13 +1,13 @@ # ============================================================================== -# Makefile.starkernel — StarKernel UEFI Build System +# kernel/Makefile — StarKernel UEFI Build System # Multi-architecture: amd64 (x86_64), aarch64 (ARM64), riscv64 (RISC-V 64) # # Quick start: -# make -f Makefile.starkernel — build for host arch -# make -f Makefile.starkernel ARCH=amd64 qemu — build + boot (x86_64) -# make -f Makefile.starkernel ARCH=aarch64 qemu — build + boot (aarch64) -# make -f Makefile.starkernel ARCH=riscv64 qemu — build + boot (riscv64) -# make -f Makefile.starkernel help — show all targets +# make -f kernel/Makefile — build for host arch +# make -f kernel/Makefile ARCH=amd64 qemu — build + boot (x86_64) +# make -f kernel/Makefile ARCH=aarch64 qemu — build + boot (aarch64) +# make -f kernel/Makefile ARCH=riscv64 qemu — build + boot (riscv64) +# make -f kernel/Makefile help — show all targets # ============================================================================== # ============================================================================== @@ -64,7 +64,7 @@ $(eval $(call kconfig_bool,STARFORTH_ENABLE_VM,1)) MONOLITHIC ?= 1 # Parallel build — use all available cores when not cleaning -# (adding -j when 'clean' is also a goal causes a race on include/version.h) +# (adding -j when 'clean' is also a goal causes a race on v3/include/version.h) NPROC := $(shell nproc 2>/dev/null || echo 4) ifeq ($(filter clean,$(MAKECMDGOALS)),) MAKEFLAGS += -j$(NPROC) @@ -106,9 +106,9 @@ KERNEL_OBJ_DIR := $(OBJ_DIR)/kernel LOADER_EFI := $(BUILD_DIR)/starkernel_loader.efi KERNEL_ELF := $(BUILD_DIR)/starkernel_kernel.elf -KERNEL_SRC := src/starkernel -KERNEL_INC := include/starkernel -STARFORTH_CONFIG_HEADER := include/starforth_config.h +KERNEL_SRC := kernel/src +KERNEL_INC := kernel/include/starkernel +STARFORTH_CONFIG_HEADER := v3/include/starforth_config.h QEMU_LOG_DIR := logs QEMU_ISO := $(BUILD_DIR)/starkernel.iso @@ -129,17 +129,17 @@ ARTDISK ?= disk/artemis.img # headroom above the current 9-device identity roster (Zuse + 8 minted identities) # rather than matching it exactly, per Bob's standing ruling against hardcoding a bound # to today's scale (FABRIC-3.md §VII.4). Override if a future test needs more, e.g. -# `make -f Makefile.starkernel qemu XHCI_PORTS=32`. +# `make -f kernel/Makefile qemu XHCI_PORTS=32`. XHCI_PORTS ?= 16 # ZUSEDISK -- Zuse's own minted USB thumbdrive, attached by default so a # plain `make qemu` lands already authenticated into the Zuse identity # (Captain Bob, 2026-08-28). Attached at QEMU launch time via -drive/ # -device on the qemu-xhci controller each arch's qemu target already -# creates; xhci_bringup()'s initial port scan (src/starkernel/usb/xhci.c) +# creates; xhci_bringup()'s initial port scan (kernel/src/usb/xhci.c) # is what makes an already-connected-at-launch device visible at all -- # xhci_poll_events() alone is purely hotplug-event-driven and would never # see a device present before controller reset. Override to "" (empty) to -# boot without Zuse attached, e.g. `make -f Makefile.starkernel qemu ZUSEDISK=`. +# boot without Zuse attached, e.g. `make -f kernel/Makefile qemu ZUSEDISK=`. ZUSEDISK ?= disk/thumbdrives/zuse-thumb-ident.img # Precomputed (not inlined as $(if ...,...)) because the drive/device specs # below are comma-heavy and GNU make's $(if) function splits its own @@ -153,10 +153,10 @@ else ZUSEDISK_QEMU_ARGS := endif MKCAPSULE_SRC = tools/mkcapsule.c tools/pkcs8_ed25519.c \ - src/starkernel/crypto/ed25519.c \ - src/starkernel/crypto/fe25519.c \ - src/starkernel/crypto/scalar25519.c \ - src/starkernel/crypto/sha512.c + kernel/src/crypto/ed25519.c \ + kernel/src/crypto/fe25519.c \ + kernel/src/crypto/scalar25519.c \ + kernel/src/crypto/sha512.c MKCAPSULE_BIN = $(BUILD_DIR)/tools/mkcapsule # Milestone 6 (Phase 8): the snakeoil intermediate's private key, generated # offline outside this repo entirely (see FABRIC-2.md's Phase 8 §Milestone 6 @@ -169,6 +169,28 @@ CAPSULE_GENERATED = $(BUILD_DIR)/capsule_generated.c CAPSULE_GENERATED_OBJ = $(BUILD_DIR)/capsule_generated.o CAPSULE_GENERATED_KOBJ = $(KERNEL_OBJ_DIR)/capsule_generated.o +# ============================================================================== +# BOARD (boot_image) +# ============================================================================== +# BOARD names a directory under boards/ (ser5, raspi, milkv, ...). Its +# board.mk sets BOARD_ARCH, BOARD_BOOT (how the firmware finds us) and +# BOARD_IMAGE (the single file written to the boot medium). The root +# Makefile's `make boot_image TARGET=` maps NAME to BOARD and passes +# ARCH=$(BOARD_ARCH); the kernel objects themselves are the ordinary +# build/$(ARCH)/kernel ones, shared with `make qemu`. +BOARD ?= +ifneq ($(strip $(BOARD)),) +ifeq ($(wildcard boards/$(BOARD)/board.mk),) + $(error Unknown BOARD='$(BOARD)': no boards/$(BOARD)/board.mk) +endif +include boards/$(BOARD)/board.mk +ifneq ($(BOARD_ARCH),$(ARCH)) + $(error BOARD=$(BOARD) is ARCH=$(BOARD_ARCH), but ARCH=$(ARCH) was requested) +endif +BOARD_OUT := build/boards/$(BOARD) +endif +BOOT_IMAGE_SIZE_MIB ?= 128 + # ============================================================================== # TOOLCHAIN # ============================================================================== @@ -195,8 +217,8 @@ ifeq ($(ARCH),amd64) # correctly. These flags come after COMMON_CFLAGS on the command line so # they win for amd64 only; riscv64/aarch64 keep -fPIC. ARCH_CFLAGS := -m64 -march=x86-64 -mno-red-zone -DARCH_AMD64 -fno-pic -fno-pie - LOADER_LINKER_SCRIPT := linker/starkernel-loader-amd64.ld - KERNEL_LINKER_SCRIPT := linker/starkernel-kernel-amd64.ld + LOADER_LINKER_SCRIPT := kernel/linker/starkernel-loader-amd64.ld + KERNEL_LINKER_SCRIPT := kernel/linker/starkernel-kernel-amd64.ld else ifeq ($(ARCH),aarch64) ifneq ($(shell which aarch64-linux-gnu-gcc 2>/dev/null),) @@ -211,14 +233,16 @@ else ifeq ($(ARCH),aarch64) $(error No ARM64 toolchain found. Install aarch64-linux-gnu-gcc or aarch64-none-elf-gcc) endif # aarch64 loader uses clang + lld-link (COFF target — GCC cannot produce aarch64 PE) - LOADER_CC := clang-18 - # Debian/Ubuntu package only installs the versioned lld-link-18 on PATH by - # default (unversioned lld-link lives under /usr/lib/llvm-18/bin, which + # Any clang with the aarch64 COFF backend works; the version is not + # pinned (Ubuntu 26.04 ships clang-21, older hosts clang-18). + LOADER_CC := $(shell which clang 2>/dev/null || ls /usr/bin/clang-[0-9]* 2>/dev/null | sort -V | tail -1 || echo clang) + # Debian/Ubuntu package only installs the versioned lld-link-NN on PATH by + # default (unversioned lld-link lives under /usr/lib/llvm-NN/bin, which # isn't on PATH unless explicitly prepended) — detect whichever resolves. - LOADER_LD := $(shell which lld-link 2>/dev/null || which lld-link-18 2>/dev/null || echo lld-link) + LOADER_LD := $(shell which lld-link 2>/dev/null || ls /usr/bin/lld-link-[0-9]* /usr/lib/llvm-*/bin/lld-link 2>/dev/null | sort -V | tail -1 || echo lld-link) ARCH_CFLAGS := -march=armv8-a -mcpu=cortex-a72 -DARCH_AARCH64 -mno-outline-atomics - LOADER_LINKER_SCRIPT := linker/starkernel-loader-aarch64.ld - KERNEL_LINKER_SCRIPT := linker/starkernel-kernel-aarch64.ld + LOADER_LINKER_SCRIPT := kernel/linker/starkernel-loader-aarch64.ld + KERNEL_LINKER_SCRIPT := kernel/linker/starkernel-kernel-aarch64.ld else ifeq ($(ARCH),riscv64) ifneq ($(shell which riscv64-unknown-elf-gcc 2>/dev/null),) @@ -233,8 +257,8 @@ else ifeq ($(ARCH),riscv64) $(error No RISC-V toolchain found. Install riscv64-unknown-elf-gcc or riscv64-linux-gnu-gcc) endif ARCH_CFLAGS := -march=rv64gc -mabi=lp64d -DARCH_RISCV64 - LOADER_LINKER_SCRIPT := linker/starkernel-loader-riscv64.ld - KERNEL_LINKER_SCRIPT := linker/starkernel-kernel-riscv64.ld + LOADER_LINKER_SCRIPT := kernel/linker/starkernel-loader-riscv64.ld + KERNEL_LINKER_SCRIPT := kernel/linker/starkernel-kernel-riscv64.ld endif # Default loader toolchain = kernel toolchain (overridden for aarch64 above) @@ -260,13 +284,13 @@ COMMON_CFLAGS := \ -ffreestanding -nostdlib -fno-builtin \ -fPIC -fvisibility=hidden -fno-stack-protector -fshort-wchar \ $(ARCH_CFLAGS) \ - -I$(KERNEL_INC) -Iinclude -Isrc \ + -I$(KERNEL_INC) -Iv3/include -Ikernel/include -Iv3/src \ -include $(STARFORTH_CONFIG_HEADER) \ -DPARITY_MODE=$(PARITY_MODE) VMCORE_CFLAGS_COMMON := \ $(filter-out -I$(KERNEL_INC),$(COMMON_CFLAGS)) \ - -Iinclude -I. -Isrc/word_source -Isrc/test_runner/include \ + -Iv3/include -Ikernel/include -I. -Iv3/src/word_source -Iv3/src/test_runner/include \ -Wno-error=unused-parameter -Wno-error=shift-negative-value \ -Wno-error=sign-compare -Wno-error=missing-field-initializers @@ -281,8 +305,8 @@ LOADER_BASE_CFLAGS := \ -mno-stack-arg-probe \ -march=armv8-a \ -DARCH_AARCH64 \ - -I$(KERNEL_INC) -Iinclude -Isrc \ - -Iinclude/starkernel/freestanding \ + -I$(KERNEL_INC) -Iv3/include -Ikernel/include -Iv3/src \ + -Ikernel/include/starkernel/freestanding \ -include $(STARFORTH_CONFIG_HEADER) \ -DPARITY_MODE=$(PARITY_MODE) \ -DPLATFORM_TIME_NO_INLINE @@ -308,7 +332,7 @@ ifeq ($(ARCH),aarch64) else ifeq ($(ARCH),riscv64) LOADER_LDFLAGS_PE := # ELF→objcopy pipeline in link rule else - LOADER_LINKER_SCRIPT_PE := linker/starkernel-loader-amd64-pe.ld + LOADER_LINKER_SCRIPT_PE := kernel/linker/starkernel-loader-amd64-pe.ld LOADER_LDFLAGS_PE := \ -T $(LOADER_LINKER_SCRIPT_PE) -m i386pep -nostdlib \ --enable-reloc-section --image-base 0 --subsystem 10 -e efi_main @@ -429,7 +453,7 @@ LOADER_CFLAGS += $(VM_FEATURE_OVERRIDES) endif # SK_CMD — optional startup FORTH script injected before the interactive REPL. -# Usage: make -f Makefile.starkernel qemu SK_CMD="TIME-TICKS . BYE" +# Usage: make -f kernel/Makefile qemu SK_CMD="TIME-TICKS . BYE" ifdef SK_CMD KERNEL_CFLAGS += -DSK_STARTUP_FORTH='"$(SK_CMD)"' LOADER_CFLAGS += -DSK_STARTUP_FORTH='"$(SK_CMD)"' @@ -439,7 +463,7 @@ endif # The loader reads this file from the EFI partition and parses it at boot. # Supported flags: --doe --log-level= # --stack=[MG] --heap=[MG] -# Usage: make -f Makefile.starkernel qemu KERNEL_ARGS="--doe --log-level=info" +# Usage: make -f kernel/Makefile qemu KERNEL_ARGS="--doe --log-level=info" KERNEL_ARGS ?= # ============================================================================== @@ -534,19 +558,19 @@ KERNEL_ASM := $(wildcard $(KERNEL_SRC)/arch/$(ARCH)/*.S) ifeq ($(STARFORTH_ENABLE_VM),1) VM_ALL_SRCS := \ - $(wildcard src/*.c) \ - $(wildcard src/word_source/*.c) \ - $(wildcard src/test_runner/*.c) \ - $(wildcard src/test_runner/modules/*.c) + $(wildcard v3/src/*.c) \ + $(wildcard v3/src/word_source/*.c) \ + $(wildcard v3/src/test_runner/*.c) \ + $(wildcard v3/src/test_runner/modules/*.c) VM_EXCLUDE := \ - src/main.c src/cli.c src/repl.c \ - src/platform/% \ - src/blkio_factory.c src/blkio_file.c \ - src/log.c src/doe_metrics.c \ - src/vm.c src/vm_core.c src/vm_bootstrap.c src/vm_runtime.c src/vm_time.c \ - src/word_source/q48_16_words.c \ - src/test_runner/modules/break_me_tests.c + v3/src/main.c v3/src/cli.c v3/src/repl.c \ + v3/src/platform/% \ + v3/src/blkio_factory.c v3/src/blkio_file.c \ + v3/src/log.c v3/src/doe_metrics.c \ + v3/src/vm.c v3/src/vm_core.c v3/src/vm_bootstrap.c v3/src/vm_runtime.c v3/src/vm_time.c \ + v3/src/word_source/q48_16_words.c \ + v3/src/test_runner/modules/break_me_tests.c VM_CORE_SRCS := $(filter-out $(VM_EXCLUDE),$(VM_ALL_SRCS)) @@ -569,8 +593,8 @@ LOADER_EXTRA_SRCS := \ KERNEL_EXTRA_SRCS := $(LOADER_EXTRA_SRCS) -LOADER_VM_OBJS := $(patsubst src/%.c,$(LOADER_OBJ_DIR)/vmcore/%.o,$(VM_CORE_SRCS)) -KERNEL_VM_OBJS := $(patsubst src/%.c,$(KERNEL_OBJ_DIR)/vmcore/%.o,$(VM_CORE_SRCS)) +LOADER_VM_OBJS := $(patsubst v3/src/%.c,$(LOADER_OBJ_DIR)/vmcore/%.o,$(VM_CORE_SRCS)) +KERNEL_VM_OBJS := $(patsubst v3/src/%.c,$(KERNEL_OBJ_DIR)/vmcore/%.o,$(VM_CORE_SRCS)) endif LOADER_SRCS := $(LOADER_SRCS_BASE) $(LOADER_EXTRA_SRCS) @@ -603,7 +627,7 @@ KERNEL_OBJS := \ # MAIN TARGETS # ============================================================================== -all: include/version.h $(CAPSULE_GENERATED_OBJ) $(CAPSULE_GENERATED_KOBJ) $(LOADER_EFI) $(KERNEL_ELF) +all: v3/include/version.h $(CAPSULE_GENERATED_OBJ) $(CAPSULE_GENERATED_KOBJ) $(LOADER_EFI) $(KERNEL_ELF) @echo "StarKernel built successfully for $(ARCH)" @echo " Loader: $(LOADER_EFI)" @echo " Kernel: $(KERNEL_ELF)" @@ -611,13 +635,13 @@ all: include/version.h $(CAPSULE_GENERATED_OBJ) $(CAPSULE_GENERATED_KOBJ) $(LOAD kernel: all kernel-all: - @$(MAKE) -f Makefile.starkernel ARCH=amd64 TARGET=$(TARGET) - @$(MAKE) -f Makefile.starkernel ARCH=aarch64 TARGET=$(TARGET) - @$(MAKE) -f Makefile.starkernel ARCH=riscv64 TARGET=$(TARGET) + @$(MAKE) -f kernel/Makefile ARCH=amd64 TARGET=$(TARGET) + @$(MAKE) -f kernel/Makefile ARCH=aarch64 TARGET=$(TARGET) + @$(MAKE) -f kernel/Makefile ARCH=riscv64 TARGET=$(TARGET) clean: rm -rf build/$(ARCH)/$(TARGET) - rm -f include/version.h + rm -f v3/include/version.h clean-kernel: @echo "Cleaning all StarKernel build artifacts..." @@ -636,8 +660,8 @@ FORCE: # here after a hosted `make` run silently reuses that stale/wrong-flavored file # and fails with "LITHOS_VERSION_STR undeclared" deep in kernel_main.c, instead # of regenerating its own correct version. -include/version.h: FORCE - @mkdir -p include +v3/include/version.h: FORCE + @mkdir -p v3/include @BUILD_TS=$$(date -Iseconds 2>/dev/null || echo "unknown"); \ printf '#ifndef STARFORTH_VERSION_H\n#define STARFORTH_VERSION_H\n\n' > $@; \ printf '#define STARFORTH_VERSION "%s"\n' "$(VERSION)" >> $@; \ @@ -653,7 +677,7 @@ include/version.h: FORCE $(MKCAPSULE_BIN): $(MKCAPSULE_SRC) @mkdir -p $(dir $@) @echo "HOSTCC $(MKCAPSULE_SRC)" - @cc -std=c99 -Wall -Wextra -O2 -Iinclude -Itools -o $@ $(MKCAPSULE_SRC) + @cc -std=c99 -Wall -Wextra -O2 -Iv3/include -Ikernel/include -Itools -o $@ $(MKCAPSULE_SRC) # Generate capsule_generated.c from capsules/ CAPSULE_SRCS := $(shell find $(CAPSULES_DIR) -type f ! -name '.*' 2>/dev/null) @@ -695,12 +719,12 @@ $(LOADER_OBJ_DIR)/%.o: $(KERNEL_SRC)/%.c | $(LOADER_OBJ_DIR) @$(LOADER_CC) $(LOADER_CFLAGS) -c $< -o $@ # Compile loader VM core sources -$(LOADER_OBJ_DIR)/vmcore/%.o: src/%.c include/version.h | $(LOADER_OBJ_DIR) +$(LOADER_OBJ_DIR)/vmcore/%.o: v3/src/%.c v3/include/version.h | $(LOADER_OBJ_DIR) @mkdir -p $(dir $@) @echo "CC (loader) $<" ifeq ($(ARCH),aarch64) @$(LOADER_CC) $(LOADER_CFLAGS) \ - -Iinclude -I. -Isrc/test_runner/include \ + -Iv3/include -Ikernel/include -I. -Iv3/src/test_runner/include \ -Wno-error=unused-parameter -Wno-error=shift-negative-value \ -Wno-error=sign-compare -Wno-error=missing-field-initializers \ -Wno-unused-function \ @@ -722,10 +746,10 @@ $(KERNEL_OBJ_DIR)/%.o: $(KERNEL_SRC)/%.c | $(KERNEL_OBJ_DIR) @$(CC) $(KERNEL_CFLAGS) -c $< -o $@ # Compile kernel VM core sources -$(KERNEL_OBJ_DIR)/vmcore/%.o: src/%.c include/version.h | $(KERNEL_OBJ_DIR) +$(KERNEL_OBJ_DIR)/vmcore/%.o: v3/src/%.c v3/include/version.h | $(KERNEL_OBJ_DIR) @mkdir -p $(dir $@) @echo "CC (kernel) $<" - @$(CC) $(VMCORE_CFLAGS_COMMON) $(filter-out -I$(KERNEL_INC),$(KERNEL_CFLAGS)) -Isrc/starkernel/vm -c $< -o $@ + @$(CC) $(VMCORE_CFLAGS_COMMON) $(filter-out -I$(KERNEL_INC),$(KERNEL_CFLAGS)) -Ikernel/src/vm -c $< -o $@ # Compile kernel assembly sources $(KERNEL_OBJ_DIR)/%.o: $(KERNEL_SRC)/%.S | $(KERNEL_OBJ_DIR) @@ -802,7 +826,7 @@ OVMF_CODE := /usr/share/OVMF/OVMF_CODE_4M.fd OVMF_VARS_RO := /usr/share/OVMF/OVMF_VARS_4M.fd # QEMU_DISPLAY — window backend for the framebuffer console (gtk/sdl/none/...). -# Usage: make -f Makefile.starkernel qemu QEMU_DISPLAY=none # headless/CI +# Usage: make -f kernel/Makefile qemu QEMU_DISPLAY=none # headless/CI QEMU_DISPLAY ?= gtk # QEMU_EXTRA — extra raw qemu-system-* args appended verbatim to every arch's @@ -1072,38 +1096,98 @@ else ifeq ($(ARCH),riscv64) # 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; \ - # Geometry: 128 MiB disk (262144 sectors), GPT partition 1 spans sectors \ - # 2048..262110 (the GPT last-usable sector for this disk size), i.e. \ - # 260063 sectors. The FAT32 ESP image MUST match the partition size \ - # exactly; a larger ESP overruns the disk (GPT grows corrupt) or \ - # spills past the partition end, both of which made earlier builds \ - # unbootable on hardware. \ - DISK=$(BUILD_DIR)/starkernel-thumbdrive.img; \ - ESP_SECTORS=260063; \ - rm -f $$DISK $(BUILD_DIR)/thumbdrive-esp.img; \ - dd if=/dev/zero of=$(BUILD_DIR)/thumbdrive-esp.img bs=512 count=$$ESP_SECTORS 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=128 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" + @printf 'FS0:\\EFI\\BOOT\\%s\r\n' "$(EFI_BOOTNAME)" > $(BUILD_DIR)/thumbdrive-startup.nsh + @bash scripts/mkdiskimage.sh --out $(BUILD_DIR)/starkernel-thumbdrive.img --table gpt \ + --size-mib 128 --label STARKERNEL \ + $(LOADER_EFI):/EFI/BOOT/$(EFI_BOOTNAME) \ + $(BUILD_DIR)/thumbdrive-startup.nsh:/startup.nsh + @rm -f $(BUILD_DIR)/thumbdrive-startup.nsh + @echo "Write to a USB stick with: dd if=$(BUILD_DIR)/starkernel-thumbdrive.img of=/dev/sdX bs=4M status=progress" +# ============================================================================== +# BOOT IMAGES (one per board) +# ============================================================================== +# boot_image -- the single file written to a board's boot medium. Driven by +# BOARD (boards//board.mk); normally invoked from the repo root as +# make boot_image TARGET=SER5|RASPI|MILKV|ZYNQ7020 +# Output: build/boards//$(BOARD_IMAGE). +# +# BOARD_BOOT selects the recipe: +# uefi-esp -- GPT disk, one FAT32 EFI System Partition holding the +# monolithic loader as EFI/BOOT/BOOT.EFI (+ startup.nsh +# for the UEFI shell, + starforth.cfg when KERNEL_ARGS is set). +# Real UEFI firmware (SER5) and U-Boot's bootefi (Milk-V) both +# boot it through the removable-media fallback path. +# rpi-native -- MBR disk, one FAT32 (LBA) partition holding config.txt, +# kernel_2712.img (kernel relinked at 0x80000 and flattened) +# and the stock BCM2712 DTB (+ cmdline.txt, which firmware +# copies into /chosen/bootargs, when KERNEL_ARGS is set). +ifeq ($(ARCH),amd64) +EFI_BOOTNAME := BOOTX64.EFI +else ifeq ($(ARCH),aarch64) +EFI_BOOTNAME := BOOTAA64.EFI +else ifeq ($(ARCH),riscv64) +EFI_BOOTNAME := BOOTRISCV64.EFI +endif + +RPI5_NATIVE_LINKER_SCRIPT := kernel/linker/starkernel-native-rpi5.ld +RPI5_NATIVE_ELF := $(BUILD_DIR)/starkernel_rpi5.elf +RPI5_NATIVE_IMG := $(BUILD_DIR)/kernel_2712.img + +$(RPI5_NATIVE_ELF): $(KERNEL_OBJS) $(RPI5_NATIVE_LINKER_SCRIPT) | $(BUILD_DIR) + @echo "LD (rpi5 native) $@" + @$(LD) -T $(RPI5_NATIVE_LINKER_SCRIPT) -nostdlib --build-id=none \ + -e rpi5_native_start $(KERNEL_OBJS) -o $@ + +$(RPI5_NATIVE_IMG): $(RPI5_NATIVE_ELF) + @echo "OBJCOPY (raw) $@" + @$(OBJCOPY) -O binary $< $@ + +.PHONY: boot_image +ifeq ($(strip $(BOARD)),) +boot_image: + @echo "boot_image needs a board. From the repo root:" + @echo " make boot_image TARGET=SER5|RASPI|MILKV|ZYNQ7020" + @exit 1 +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) + @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) + @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) +$(RPI5_DTB): + @mkdir -p $(dir $@) + @echo " FETCH $(RPI5_DTB_URL)" + @curl -fsSL -o $@.tmp $(RPI5_DTB_URL) || { rm -f $@.tmp; \ + echo "Error: could not fetch the Pi 5 DTB. Copy bcm2712-rpi-5-b.dtb from a Raspberry Pi"; \ + echo "firmware release and pass RPI5_DTB=/path/to/bcm2712-rpi-5-b.dtb"; exit 1; } + @mv $@.tmp $@ + +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) + @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) + @echo "$(BOARD_DESC)" + @echo "Write with: dd if=$(BOARD_OUT)/$(BOARD_IMAGE) of=/dev/mmcblkX bs=4M conv=fsync status=progress" +else +boot_image: + @echo "Error: BOARD=$(BOARD) has BOARD_BOOT='$(BOARD_BOOT)', which has no boot_image recipe" + @exit 1 +endif # iso-usb — build a PURE UEFI isohybrid ISO for the Iso Image Writer workflow # (GNOME Disks "Restore Disk Image...", or dd). Writes a single .iso to a USB @@ -1150,7 +1234,7 @@ iso-usb: all # yourself with Ctrl-A X or by closing the window). # amd64/aarch64: serial → stdio (bidirectional, you can type into the REPL); # riscv64: uses proper GPT (esp dir not supported) -qemu-esp: include/version.h $(LOADER_EFI) $(KERNEL_ELF) +qemu-esp: v3/include/version.h $(LOADER_EFI) $(KERNEL_ELF) ifeq ($(ARCH),amd64) @rm -rf $(BUILD_DIR)/esp @mkdir -p $(BUILD_DIR)/esp/EFI/BOOT @@ -1206,7 +1290,7 @@ else ifeq ($(ARCH),riscv64) endif # qemu-gdb — launch QEMU with GDB stub on port 1234 -qemu-gdb: include/version.h $(LOADER_EFI) $(KERNEL_ELF) +qemu-gdb: v3/include/version.h $(LOADER_EFI) $(KERNEL_ELF) ifeq ($(ARCH),amd64) @mkdir -p $(BUILD_DIR)/esp/EFI/BOOT @cp $(LOADER_EFI) $(BUILD_DIR)/esp/EFI/BOOT/BOOTX64.EFI @@ -1259,7 +1343,7 @@ help: @echo "StarKernel Build System" @echo "=======================" @echo "" - @echo "Usage: make -f Makefile.starkernel [ARCH=] [TARGET=] " + @echo "Usage: make -f kernel/Makefile [ARCH=] [TARGET=] " @echo "" @echo "Architectures (aliases accepted):" @echo " ARCH=amd64 / x86_64 — x86-64 (default on x86 host)" @@ -1289,8 +1373,8 @@ help: @echo " help — show this message" @echo "" @echo "Examples:" - @echo " make -f Makefile.starkernel ARCH=amd64 qemu" - @echo " make -f Makefile.starkernel ARCH=aarch64 clean qemu" - @echo " make -f Makefile.starkernel ARCH=riscv64 clean qemu" - @echo " make -f Makefile.starkernel ARCH=x86_64 qemu # alias works" - @echo " make -f Makefile.starkernel kernel-all" + @echo " make -f kernel/Makefile ARCH=amd64 qemu" + @echo " make -f kernel/Makefile ARCH=aarch64 clean qemu" + @echo " make -f kernel/Makefile ARCH=riscv64 clean qemu" + @echo " make -f kernel/Makefile ARCH=x86_64 qemu # alias works" + @echo " make -f kernel/Makefile kernel-all" diff --git a/include/starkernel/README.md b/kernel/include/starkernel/README.md similarity index 100% rename from include/starkernel/README.md rename to kernel/include/starkernel/README.md diff --git a/include/starkernel/apic.h b/kernel/include/starkernel/apic.h similarity index 100% rename from include/starkernel/apic.h rename to kernel/include/starkernel/apic.h diff --git a/include/starkernel/arch.h b/kernel/include/starkernel/arch.h similarity index 100% rename from include/starkernel/arch.h rename to kernel/include/starkernel/arch.h diff --git a/include/starkernel/artemis_sig.h b/kernel/include/starkernel/artemis_sig.h similarity index 100% rename from include/starkernel/artemis_sig.h rename to kernel/include/starkernel/artemis_sig.h diff --git a/include/starkernel/blkio_usb.h b/kernel/include/starkernel/blkio_usb.h similarity index 100% rename from include/starkernel/blkio_usb.h rename to kernel/include/starkernel/blkio_usb.h diff --git a/include/starkernel/boot_info_offsets.h b/kernel/include/starkernel/boot_info_offsets.h similarity index 100% rename from include/starkernel/boot_info_offsets.h rename to kernel/include/starkernel/boot_info_offsets.h diff --git a/include/starkernel/capsule.h b/kernel/include/starkernel/capsule.h similarity index 100% rename from include/starkernel/capsule.h rename to kernel/include/starkernel/capsule.h diff --git a/include/starkernel/capsule_birth.h b/kernel/include/starkernel/capsule_birth.h similarity index 100% rename from include/starkernel/capsule_birth.h rename to kernel/include/starkernel/capsule_birth.h diff --git a/include/starkernel/capsule_console.h b/kernel/include/starkernel/capsule_console.h similarity index 100% rename from include/starkernel/capsule_console.h rename to kernel/include/starkernel/capsule_console.h diff --git a/include/starkernel/capsule_generated.h b/kernel/include/starkernel/capsule_generated.h similarity index 100% rename from include/starkernel/capsule_generated.h rename to kernel/include/starkernel/capsule_generated.h diff --git a/include/starkernel/capsule_loader.h b/kernel/include/starkernel/capsule_loader.h similarity index 100% rename from include/starkernel/capsule_loader.h rename to kernel/include/starkernel/capsule_loader.h diff --git a/include/starkernel/capsule_mint.h b/kernel/include/starkernel/capsule_mint.h similarity index 100% rename from include/starkernel/capsule_mint.h rename to kernel/include/starkernel/capsule_mint.h diff --git a/include/starkernel/capsule_run.h b/kernel/include/starkernel/capsule_run.h similarity index 100% rename from include/starkernel/capsule_run.h rename to kernel/include/starkernel/capsule_run.h diff --git a/include/starkernel/capsule_runcap.h b/kernel/include/starkernel/capsule_runcap.h similarity index 100% rename from include/starkernel/capsule_runcap.h rename to kernel/include/starkernel/capsule_runcap.h diff --git a/include/starkernel/capsule_sig.h b/kernel/include/starkernel/capsule_sig.h similarity index 100% rename from include/starkernel/capsule_sig.h rename to kernel/include/starkernel/capsule_sig.h diff --git a/include/starkernel/capsule_vm_physics.h b/kernel/include/starkernel/capsule_vm_physics.h similarity index 100% rename from include/starkernel/capsule_vm_physics.h rename to kernel/include/starkernel/capsule_vm_physics.h diff --git a/include/starkernel/capsule_vm_switch_signal.h b/kernel/include/starkernel/capsule_vm_switch_signal.h similarity index 100% rename from include/starkernel/capsule_vm_switch_signal.h rename to kernel/include/starkernel/capsule_vm_switch_signal.h diff --git a/include/starkernel/capsule_wirebind.h b/kernel/include/starkernel/capsule_wirebind.h similarity index 100% rename from include/starkernel/capsule_wirebind.h rename to kernel/include/starkernel/capsule_wirebind.h diff --git a/include/starkernel/capsule_zuse_boot.h b/kernel/include/starkernel/capsule_zuse_boot.h similarity index 100% rename from include/starkernel/capsule_zuse_boot.h rename to kernel/include/starkernel/capsule_zuse_boot.h diff --git a/include/starkernel/cmdline.h b/kernel/include/starkernel/cmdline.h similarity index 100% rename from include/starkernel/cmdline.h rename to kernel/include/starkernel/cmdline.h diff --git a/include/starkernel/console.h b/kernel/include/starkernel/console.h similarity index 100% rename from include/starkernel/console.h rename to kernel/include/starkernel/console.h diff --git a/include/starkernel/doe_log.h b/kernel/include/starkernel/doe_log.h similarity index 100% rename from include/starkernel/doe_log.h rename to kernel/include/starkernel/doe_log.h diff --git a/include/starkernel/ed25519.h b/kernel/include/starkernel/ed25519.h similarity index 100% rename from include/starkernel/ed25519.h rename to kernel/include/starkernel/ed25519.h diff --git a/include/starkernel/elf64.h b/kernel/include/starkernel/elf64.h similarity index 100% rename from include/starkernel/elf64.h rename to kernel/include/starkernel/elf64.h diff --git a/include/starkernel/elf_loader.h b/kernel/include/starkernel/elf_loader.h similarity index 100% rename from include/starkernel/elf_loader.h rename to kernel/include/starkernel/elf_loader.h diff --git a/include/starkernel/fdt.h b/kernel/include/starkernel/fdt.h similarity index 100% rename from include/starkernel/fdt.h rename to kernel/include/starkernel/fdt.h diff --git a/include/starkernel/fe25519.h b/kernel/include/starkernel/fe25519.h similarity index 100% rename from include/starkernel/fe25519.h rename to kernel/include/starkernel/fe25519.h diff --git a/include/starkernel/framebuffer.h b/kernel/include/starkernel/framebuffer.h similarity index 100% rename from include/starkernel/framebuffer.h rename to kernel/include/starkernel/framebuffer.h diff --git a/include/starkernel/freestanding/README.md b/kernel/include/starkernel/freestanding/README.md similarity index 100% rename from include/starkernel/freestanding/README.md rename to kernel/include/starkernel/freestanding/README.md diff --git a/include/starkernel/freestanding/assert.h b/kernel/include/starkernel/freestanding/assert.h similarity index 100% rename from include/starkernel/freestanding/assert.h rename to kernel/include/starkernel/freestanding/assert.h diff --git a/include/starkernel/freestanding/ctype.h b/kernel/include/starkernel/freestanding/ctype.h similarity index 100% rename from include/starkernel/freestanding/ctype.h rename to kernel/include/starkernel/freestanding/ctype.h diff --git a/include/starkernel/freestanding/errno.h b/kernel/include/starkernel/freestanding/errno.h similarity index 100% rename from include/starkernel/freestanding/errno.h rename to kernel/include/starkernel/freestanding/errno.h diff --git a/include/starkernel/freestanding/inttypes.h b/kernel/include/starkernel/freestanding/inttypes.h similarity index 100% rename from include/starkernel/freestanding/inttypes.h rename to kernel/include/starkernel/freestanding/inttypes.h diff --git a/include/starkernel/freestanding/math.h b/kernel/include/starkernel/freestanding/math.h similarity index 100% rename from include/starkernel/freestanding/math.h rename to kernel/include/starkernel/freestanding/math.h diff --git a/include/starkernel/freestanding/sched.h b/kernel/include/starkernel/freestanding/sched.h similarity index 100% rename from include/starkernel/freestanding/sched.h rename to kernel/include/starkernel/freestanding/sched.h diff --git a/include/starkernel/freestanding/signal.h b/kernel/include/starkernel/freestanding/signal.h similarity index 100% rename from include/starkernel/freestanding/signal.h rename to kernel/include/starkernel/freestanding/signal.h diff --git a/include/starkernel/freestanding/stdio.h b/kernel/include/starkernel/freestanding/stdio.h similarity index 100% rename from include/starkernel/freestanding/stdio.h rename to kernel/include/starkernel/freestanding/stdio.h diff --git a/include/starkernel/freestanding/stdlib.h b/kernel/include/starkernel/freestanding/stdlib.h similarity index 100% rename from include/starkernel/freestanding/stdlib.h rename to kernel/include/starkernel/freestanding/stdlib.h diff --git a/include/starkernel/freestanding/string.h b/kernel/include/starkernel/freestanding/string.h similarity index 100% rename from include/starkernel/freestanding/string.h rename to kernel/include/starkernel/freestanding/string.h diff --git a/include/starkernel/freestanding/sys/README.md b/kernel/include/starkernel/freestanding/sys/README.md similarity index 100% rename from include/starkernel/freestanding/sys/README.md rename to kernel/include/starkernel/freestanding/sys/README.md diff --git a/include/starkernel/freestanding/sys/time.h b/kernel/include/starkernel/freestanding/sys/time.h similarity index 100% rename from include/starkernel/freestanding/sys/time.h rename to kernel/include/starkernel/freestanding/sys/time.h diff --git a/include/starkernel/freestanding/sys/types.h b/kernel/include/starkernel/freestanding/sys/types.h similarity index 100% rename from include/starkernel/freestanding/sys/types.h rename to kernel/include/starkernel/freestanding/sys/types.h diff --git a/include/starkernel/freestanding/time.h b/kernel/include/starkernel/freestanding/time.h similarity index 100% rename from include/starkernel/freestanding/time.h rename to kernel/include/starkernel/freestanding/time.h diff --git a/include/starkernel/hal/README.md b/kernel/include/starkernel/hal/README.md similarity index 100% rename from include/starkernel/hal/README.md rename to kernel/include/starkernel/hal/README.md diff --git a/include/starkernel/hal/hal.h b/kernel/include/starkernel/hal/hal.h similarity index 100% rename from include/starkernel/hal/hal.h rename to kernel/include/starkernel/hal/hal.h diff --git a/include/starkernel/hal_memory.h b/kernel/include/starkernel/hal_memory.h similarity index 100% rename from include/starkernel/hal_memory.h rename to kernel/include/starkernel/hal_memory.h diff --git a/include/starkernel/homeblocks_sig.h b/kernel/include/starkernel/homeblocks_sig.h similarity index 100% rename from include/starkernel/homeblocks_sig.h rename to kernel/include/starkernel/homeblocks_sig.h diff --git a/include/starkernel/i8042.h b/kernel/include/starkernel/i8042.h similarity index 100% rename from include/starkernel/i8042.h rename to kernel/include/starkernel/i8042.h diff --git a/include/starkernel/ioapic.h b/kernel/include/starkernel/ioapic.h similarity index 100% rename from include/starkernel/ioapic.h rename to kernel/include/starkernel/ioapic.h diff --git a/include/starkernel/kernel_args.h b/kernel/include/starkernel/kernel_args.h similarity index 100% rename from include/starkernel/kernel_args.h rename to kernel/include/starkernel/kernel_args.h diff --git a/include/starkernel/kmalloc.h b/kernel/include/starkernel/kmalloc.h similarity index 100% rename from include/starkernel/kmalloc.h rename to kernel/include/starkernel/kmalloc.h diff --git a/include/starkernel/log.h b/kernel/include/starkernel/log.h similarity index 100% rename from include/starkernel/log.h rename to kernel/include/starkernel/log.h diff --git a/include/starkernel/log_attrib.h b/kernel/include/starkernel/log_attrib.h similarity index 100% rename from include/starkernel/log_attrib.h rename to kernel/include/starkernel/log_attrib.h diff --git a/include/starkernel/log_region.h b/kernel/include/starkernel/log_region.h similarity index 100% rename from include/starkernel/log_region.h rename to kernel/include/starkernel/log_region.h diff --git a/include/starkernel/pci.h b/kernel/include/starkernel/pci.h similarity index 100% rename from include/starkernel/pci.h rename to kernel/include/starkernel/pci.h diff --git a/include/starkernel/plic.h b/kernel/include/starkernel/plic.h similarity index 100% rename from include/starkernel/plic.h rename to kernel/include/starkernel/plic.h diff --git a/include/starkernel/pmm.h b/kernel/include/starkernel/pmm.h similarity index 100% rename from include/starkernel/pmm.h rename to kernel/include/starkernel/pmm.h diff --git a/include/starkernel/q48_16.h b/kernel/include/starkernel/q48_16.h similarity index 100% rename from include/starkernel/q48_16.h rename to kernel/include/starkernel/q48_16.h diff --git a/include/starkernel/repl.h b/kernel/include/starkernel/repl.h similarity index 100% rename from include/starkernel/repl.h rename to kernel/include/starkernel/repl.h diff --git a/include/starkernel/rng.h b/kernel/include/starkernel/rng.h similarity index 100% rename from include/starkernel/rng.h rename to kernel/include/starkernel/rng.h diff --git a/include/starkernel/rpi5_dtb.h b/kernel/include/starkernel/rpi5_dtb.h similarity index 100% rename from include/starkernel/rpi5_dtb.h rename to kernel/include/starkernel/rpi5_dtb.h diff --git a/include/starkernel/rpi5_mailbox.h b/kernel/include/starkernel/rpi5_mailbox.h similarity index 100% rename from include/starkernel/rpi5_mailbox.h rename to kernel/include/starkernel/rpi5_mailbox.h diff --git a/include/starkernel/rpi5_native_boot.h b/kernel/include/starkernel/rpi5_native_boot.h similarity index 100% rename from include/starkernel/rpi5_native_boot.h rename to kernel/include/starkernel/rpi5_native_boot.h diff --git a/include/starkernel/rpi5_native_entry.h b/kernel/include/starkernel/rpi5_native_entry.h similarity index 100% rename from include/starkernel/rpi5_native_entry.h rename to kernel/include/starkernel/rpi5_native_entry.h diff --git a/include/starkernel/scalar25519.h b/kernel/include/starkernel/scalar25519.h similarity index 100% rename from include/starkernel/scalar25519.h rename to kernel/include/starkernel/scalar25519.h diff --git a/include/starkernel/session.h b/kernel/include/starkernel/session.h similarity index 100% rename from include/starkernel/session.h rename to kernel/include/starkernel/session.h diff --git a/include/starkernel/sha512.h b/kernel/include/starkernel/sha512.h similarity index 100% rename from include/starkernel/sha512.h rename to kernel/include/starkernel/sha512.h diff --git a/include/starkernel/timer.h b/kernel/include/starkernel/timer.h similarity index 100% rename from include/starkernel/timer.h rename to kernel/include/starkernel/timer.h diff --git a/include/starkernel/ttf.h b/kernel/include/starkernel/ttf.h similarity index 100% rename from include/starkernel/ttf.h rename to kernel/include/starkernel/ttf.h diff --git a/include/starkernel/uefi.h b/kernel/include/starkernel/uefi.h similarity index 100% rename from include/starkernel/uefi.h rename to kernel/include/starkernel/uefi.h diff --git a/include/starkernel/user_identity_seed.h b/kernel/include/starkernel/user_identity_seed.h similarity index 100% rename from include/starkernel/user_identity_seed.h rename to kernel/include/starkernel/user_identity_seed.h diff --git a/include/starkernel/virtio_blk.h b/kernel/include/starkernel/virtio_blk.h similarity index 100% rename from include/starkernel/virtio_blk.h rename to kernel/include/starkernel/virtio_blk.h diff --git a/include/starkernel/virtio_input.h b/kernel/include/starkernel/virtio_input.h similarity index 100% rename from include/starkernel/virtio_input.h rename to kernel/include/starkernel/virtio_input.h diff --git a/include/starkernel/virtio_rng.h b/kernel/include/starkernel/virtio_rng.h similarity index 100% rename from include/starkernel/virtio_rng.h rename to kernel/include/starkernel/virtio_rng.h diff --git a/include/starkernel/vm/README.md b/kernel/include/starkernel/vm/README.md similarity index 100% rename from include/starkernel/vm/README.md rename to kernel/include/starkernel/vm/README.md diff --git a/include/starkernel/vm/arena.h b/kernel/include/starkernel/vm/arena.h similarity index 100% rename from include/starkernel/vm/arena.h rename to kernel/include/starkernel/vm/arena.h diff --git a/include/starkernel/vm/bootstrap/README.md b/kernel/include/starkernel/vm/bootstrap/README.md similarity index 100% rename from include/starkernel/vm/bootstrap/README.md rename to kernel/include/starkernel/vm/bootstrap/README.md diff --git a/include/starkernel/vm/bootstrap/sk_vm_bootstrap.h b/kernel/include/starkernel/vm/bootstrap/sk_vm_bootstrap.h similarity index 100% rename from include/starkernel/vm/bootstrap/sk_vm_bootstrap.h rename to kernel/include/starkernel/vm/bootstrap/sk_vm_bootstrap.h diff --git a/include/starkernel/vm/kernel_hermes.h b/kernel/include/starkernel/vm/kernel_hermes.h similarity index 100% rename from include/starkernel/vm/kernel_hermes.h rename to kernel/include/starkernel/vm/kernel_hermes.h diff --git a/include/starkernel/vm/parity.h b/kernel/include/starkernel/vm/parity.h similarity index 100% rename from include/starkernel/vm/parity.h rename to kernel/include/starkernel/vm/parity.h diff --git a/include/starkernel/vm/stadium.h b/kernel/include/starkernel/vm/stadium.h similarity index 100% rename from include/starkernel/vm/stadium.h rename to kernel/include/starkernel/vm/stadium.h diff --git a/include/starkernel/vm/stadium_blocks.h b/kernel/include/starkernel/vm/stadium_blocks.h similarity index 100% rename from include/starkernel/vm/stadium_blocks.h rename to kernel/include/starkernel/vm/stadium_blocks.h diff --git a/include/starkernel/vm/stadium_words.h b/kernel/include/starkernel/vm/stadium_words.h similarity index 100% rename from include/starkernel/vm/stadium_words.h rename to kernel/include/starkernel/vm/stadium_words.h diff --git a/include/starkernel/vm/switch.h b/kernel/include/starkernel/vm/switch.h similarity index 100% rename from include/starkernel/vm/switch.h rename to kernel/include/starkernel/vm/switch.h diff --git a/include/starkernel/vm_identity.h b/kernel/include/starkernel/vm_identity.h similarity index 100% rename from include/starkernel/vm_identity.h rename to kernel/include/starkernel/vm_identity.h diff --git a/include/starkernel/vm_uuid.h b/kernel/include/starkernel/vm_uuid.h similarity index 100% rename from include/starkernel/vm_uuid.h rename to kernel/include/starkernel/vm_uuid.h diff --git a/include/starkernel/vmm.h b/kernel/include/starkernel/vmm.h similarity index 100% rename from include/starkernel/vmm.h rename to kernel/include/starkernel/vmm.h diff --git a/include/starkernel/vt100.h b/kernel/include/starkernel/vt100.h similarity index 100% rename from include/starkernel/vt100.h rename to kernel/include/starkernel/vt100.h diff --git a/include/starkernel/x509_ed25519.h b/kernel/include/starkernel/x509_ed25519.h similarity index 100% rename from include/starkernel/x509_ed25519.h rename to kernel/include/starkernel/x509_ed25519.h diff --git a/include/starkernel/xhci.h b/kernel/include/starkernel/xhci.h similarity index 100% rename from include/starkernel/xhci.h rename to kernel/include/starkernel/xhci.h diff --git a/include/starkernel/xhci_driver.h b/kernel/include/starkernel/xhci_driver.h similarity index 100% rename from include/starkernel/xhci_driver.h rename to kernel/include/starkernel/xhci_driver.h diff --git a/include/starkernel/xxhash64.h b/kernel/include/starkernel/xxhash64.h similarity index 100% rename from include/starkernel/xxhash64.h rename to kernel/include/starkernel/xxhash64.h diff --git a/include/starkernel/zuse_cert_devblock.h b/kernel/include/starkernel/zuse_cert_devblock.h similarity index 100% rename from include/starkernel/zuse_cert_devblock.h rename to kernel/include/starkernel/zuse_cert_devblock.h diff --git a/include/starkernel/zuse_eligibility.h b/kernel/include/starkernel/zuse_eligibility.h similarity index 100% rename from include/starkernel/zuse_eligibility.h rename to kernel/include/starkernel/zuse_eligibility.h diff --git a/include/starkernel/zuse_eligibility_list.h b/kernel/include/starkernel/zuse_eligibility_list.h similarity index 100% rename from include/starkernel/zuse_eligibility_list.h rename to kernel/include/starkernel/zuse_eligibility_list.h diff --git a/include/starkernel/zuse_genesis_marker.h b/kernel/include/starkernel/zuse_genesis_marker.h similarity index 100% rename from include/starkernel/zuse_genesis_marker.h rename to kernel/include/starkernel/zuse_genesis_marker.h diff --git a/linker/README.md b/kernel/linker/README.md similarity index 100% rename from linker/README.md rename to kernel/linker/README.md diff --git a/linker/starkernel-amd64.ld b/kernel/linker/starkernel-amd64.ld similarity index 100% rename from linker/starkernel-amd64.ld rename to kernel/linker/starkernel-amd64.ld diff --git a/linker/starkernel-kernel-aarch64.ld b/kernel/linker/starkernel-kernel-aarch64.ld similarity index 100% rename from linker/starkernel-kernel-aarch64.ld rename to kernel/linker/starkernel-kernel-aarch64.ld diff --git a/linker/starkernel-kernel-amd64.ld b/kernel/linker/starkernel-kernel-amd64.ld similarity index 100% rename from linker/starkernel-kernel-amd64.ld rename to kernel/linker/starkernel-kernel-amd64.ld diff --git a/linker/starkernel-kernel-riscv64.ld b/kernel/linker/starkernel-kernel-riscv64.ld similarity index 100% rename from linker/starkernel-kernel-riscv64.ld rename to kernel/linker/starkernel-kernel-riscv64.ld diff --git a/linker/starkernel-loader-aarch64-pe.ld b/kernel/linker/starkernel-loader-aarch64-pe.ld similarity index 100% rename from linker/starkernel-loader-aarch64-pe.ld rename to kernel/linker/starkernel-loader-aarch64-pe.ld diff --git a/linker/starkernel-loader-aarch64.ld b/kernel/linker/starkernel-loader-aarch64.ld similarity index 100% rename from linker/starkernel-loader-aarch64.ld rename to kernel/linker/starkernel-loader-aarch64.ld diff --git a/linker/starkernel-loader-amd64-pe.ld b/kernel/linker/starkernel-loader-amd64-pe.ld similarity index 100% rename from linker/starkernel-loader-amd64-pe.ld rename to kernel/linker/starkernel-loader-amd64-pe.ld diff --git a/linker/starkernel-loader-amd64.ld b/kernel/linker/starkernel-loader-amd64.ld similarity index 100% rename from linker/starkernel-loader-amd64.ld rename to kernel/linker/starkernel-loader-amd64.ld diff --git a/linker/starkernel-loader-riscv64.ld b/kernel/linker/starkernel-loader-riscv64.ld similarity index 100% rename from linker/starkernel-loader-riscv64.ld rename to kernel/linker/starkernel-loader-riscv64.ld diff --git a/kernel/linker/starkernel-native-rpi5.ld b/kernel/linker/starkernel-native-rpi5.ld new file mode 100644 index 00000000..7a9c6b9e --- /dev/null +++ b/kernel/linker/starkernel-native-rpi5.ld @@ -0,0 +1,74 @@ +/* Linker script for the Raspberry Pi 5 native (non-UEFI) kernel image. + * + * Linked from the same objects as the aarch64 kernel ELF, entered at + * rpi5_native_start (arch/aarch64/native_rpi5_entry.S, section + * .text.entry -- placed first so it sits at the load address), then + * flattened with `objcopy -O binary` into kernel_2712.img. + * + * Load address 0x80000 must match boards/raspi/config.txt's + * kernel_address=0x80000: Pi 5 firmware's own default for + * kernel_2712.img is 0x200000, so the address is pinned on both sides + * rather than left to the firmware default. + * + * __kernel_start/__kernel_end span the whole image including .bss so + * pmm_init() reserves every page the image occupies (aarch64 boot.S's + * zero-length substitutes are only correct for the UEFI loader path, + * where UEFI owns the image pages). __bss_start/__bss_end are 16-byte + * aligned for the entry stub's zeroing loop: firmware does not clear + * memory past the end of the file it loads. + */ + +OUTPUT_FORMAT("elf64-littleaarch64") +OUTPUT_ARCH(aarch64) +ENTRY(rpi5_native_start) + +SECTIONS +{ + . = 0x80000; + + __kernel_start = .; + + .text : { + __text_start = .; + KEEP(*(.text.entry)) + *(.text .text.*) + __text_end = .; + } + + .rodata : ALIGN(4K) { + __rodata_start = .; + *(.rodata .rodata.*) + __rodata_end = .; + } + + .data : ALIGN(4K) { + __data_start = .; + *(.data .data.*) + *(.got .got.*) + __data_end = .; + } + + .rela.dyn : ALIGN(8) { + *(.rela .rela.*) + } + + .bss (NOLOAD) : ALIGN(4K) { + __bss_start = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(16); + __bss_end = .; + } + + . = ALIGN(4K); + __kernel_end = .; + + /DISCARD/ : { + *(.comment) + *(.note*) + *(.eh_frame) + *(.dynamic) + *(.dynsym) + *(.interp) + } +} diff --git a/src/starkernel/README.md b/kernel/src/README.md similarity index 100% rename from src/starkernel/README.md rename to kernel/src/README.md diff --git a/src/starkernel/arch/aarch64/README.md b/kernel/src/arch/aarch64/README.md similarity index 100% rename from src/starkernel/arch/aarch64/README.md rename to kernel/src/arch/aarch64/README.md diff --git a/src/starkernel/arch/aarch64/apic.c b/kernel/src/arch/aarch64/apic.c similarity index 100% rename from src/starkernel/arch/aarch64/apic.c rename to kernel/src/arch/aarch64/apic.c diff --git a/src/starkernel/arch/aarch64/arch.c b/kernel/src/arch/aarch64/arch.c similarity index 100% rename from src/starkernel/arch/aarch64/arch.c rename to kernel/src/arch/aarch64/arch.c diff --git a/src/starkernel/arch/aarch64/boot.S b/kernel/src/arch/aarch64/boot.S similarity index 100% rename from src/starkernel/arch/aarch64/boot.S rename to kernel/src/arch/aarch64/boot.S diff --git a/src/starkernel/arch/aarch64/interrupts.c b/kernel/src/arch/aarch64/interrupts.c similarity index 100% rename from src/starkernel/arch/aarch64/interrupts.c rename to kernel/src/arch/aarch64/interrupts.c diff --git a/src/starkernel/arch/aarch64/isr.S b/kernel/src/arch/aarch64/isr.S similarity index 100% rename from src/starkernel/arch/aarch64/isr.S rename to kernel/src/arch/aarch64/isr.S diff --git a/src/starkernel/arch/aarch64/native_rpi5_entry.S b/kernel/src/arch/aarch64/native_rpi5_entry.S similarity index 68% rename from src/starkernel/arch/aarch64/native_rpi5_entry.S rename to kernel/src/arch/aarch64/native_rpi5_entry.S index 728c443e..7260ce9a 100644 --- a/src/starkernel/arch/aarch64/native_rpi5_entry.S +++ b/kernel/src/arch/aarch64/native_rpi5_entry.S @@ -26,16 +26,19 @@ * exists only so this file's own control flow has somewhere defined to * go if that contract is ever violated. * - * Build-system note: `Makefile.starkernel`'s `KERNEL_ASM` wildcards every - * `*.S` file in this directory into the monolithic kernel ELF build (not - * the PE/COFF loader build -- that list is explicit, boot.S/isr.S only, - * see the Makefile), so this file *does* compile and link into the - * existing ARCH=aarch64 QEMU/UEFI acceptance build. Nothing there ever - * branches to `rpi5_native_start` -- it is dead code in that build by - * design, exactly like `rpi5_dtb.c`/`rpi5_mailbox.c` before it. A real, - * separately-linked Pi 5 native boot image (its own linker script placing - * this code at 0x80000) does not exist yet -- that is a build-system task, - * not scoped into this item. + * Build-system note: `kernel/Makefile`'s `KERNEL_ASM` wildcards every + * `*.S` file in this directory into the kernel ELF build (not the PE/COFF + * loader build -- that list is explicit, boot.S/isr.S/switch.S only), so + * this file links into the ARCH=aarch64 QEMU/UEFI kernel ELF as dead + * code, and is the entry point of the separately-linked Pi 5 native + * image (`make boot_image TARGET=RASPI`): + * `kernel/linker/starkernel-native-rpi5.ld` places `.text.entry` first + * at 0x80000 and the image is flattened to `kernel_2712.img`. + * + * Pi 5 firmware loads only the file's bytes; `.bss` (NOLOAD) is whatever + * was in RAM. It is zeroed here, before anything in it -- including + * `g_rpi5_dtb_ptr` and this stub's own stack -- is used. x0 (the DTB + * pointer) is preserved across the loop; only x4-x6 are touched. */ .section .bss @@ -51,7 +54,7 @@ g_rpi5_native_stack: * BSS stacks */ g_rpi5_native_stack_top: - .section .text + .section .text.entry, "ax" .global rpi5_native_start rpi5_native_start: /* Mask x0 to its documented 32-bit DTB-pointer range (§IV.1: the @@ -60,6 +63,19 @@ rpi5_native_start: mov x1, #0xffffffff and x0, x0, x1 + /* Zero .bss: [__bss_start, __bss_end), both 16-byte aligned by the + * native linker script. */ + adrp x4, __bss_start + add x4, x4, :lo12:__bss_start + adrp x5, __bss_end + add x5, x5, :lo12:__bss_end +.Lbss_zero: + cmp x4, x5 + b.hs .Lbss_done + stp xzr, xzr, [x4], #16 + b .Lbss_zero +.Lbss_done: + adrp x2, g_rpi5_dtb_ptr add x2, x2, :lo12:g_rpi5_dtb_ptr str x0, [x2] diff --git a/src/starkernel/arch/aarch64/rpi5_dtb.c b/kernel/src/arch/aarch64/rpi5_dtb.c similarity index 100% rename from src/starkernel/arch/aarch64/rpi5_dtb.c rename to kernel/src/arch/aarch64/rpi5_dtb.c diff --git a/src/starkernel/arch/aarch64/rpi5_mailbox.c b/kernel/src/arch/aarch64/rpi5_mailbox.c similarity index 100% rename from src/starkernel/arch/aarch64/rpi5_mailbox.c rename to kernel/src/arch/aarch64/rpi5_mailbox.c diff --git a/src/starkernel/arch/aarch64/rpi5_native_boot.c b/kernel/src/arch/aarch64/rpi5_native_boot.c similarity index 100% rename from src/starkernel/arch/aarch64/rpi5_native_boot.c rename to kernel/src/arch/aarch64/rpi5_native_boot.c diff --git a/src/starkernel/arch/aarch64/switch.S b/kernel/src/arch/aarch64/switch.S similarity index 100% rename from src/starkernel/arch/aarch64/switch.S rename to kernel/src/arch/aarch64/switch.S diff --git a/src/starkernel/arch/aarch64/timer.c b/kernel/src/arch/aarch64/timer.c similarity index 100% rename from src/starkernel/arch/aarch64/timer.c rename to kernel/src/arch/aarch64/timer.c diff --git a/src/starkernel/arch/amd64/README.md b/kernel/src/arch/amd64/README.md similarity index 100% rename from src/starkernel/arch/amd64/README.md rename to kernel/src/arch/amd64/README.md diff --git a/src/starkernel/arch/amd64/apic.c b/kernel/src/arch/amd64/apic.c similarity index 100% rename from src/starkernel/arch/amd64/apic.c rename to kernel/src/arch/amd64/apic.c diff --git a/src/starkernel/arch/amd64/arch.c b/kernel/src/arch/amd64/arch.c similarity index 100% rename from src/starkernel/arch/amd64/arch.c rename to kernel/src/arch/amd64/arch.c diff --git a/src/starkernel/arch/amd64/boot.S b/kernel/src/arch/amd64/boot.S similarity index 100% rename from src/starkernel/arch/amd64/boot.S rename to kernel/src/arch/amd64/boot.S diff --git a/src/starkernel/arch/amd64/i8042.c b/kernel/src/arch/amd64/i8042.c similarity index 100% rename from src/starkernel/arch/amd64/i8042.c rename to kernel/src/arch/amd64/i8042.c diff --git a/src/starkernel/arch/amd64/interrupts.c b/kernel/src/arch/amd64/interrupts.c similarity index 100% rename from src/starkernel/arch/amd64/interrupts.c rename to kernel/src/arch/amd64/interrupts.c diff --git a/src/starkernel/arch/amd64/ioapic.c b/kernel/src/arch/amd64/ioapic.c similarity index 100% rename from src/starkernel/arch/amd64/ioapic.c rename to kernel/src/arch/amd64/ioapic.c diff --git a/src/starkernel/arch/amd64/isr.S b/kernel/src/arch/amd64/isr.S similarity index 100% rename from src/starkernel/arch/amd64/isr.S rename to kernel/src/arch/amd64/isr.S diff --git a/src/starkernel/arch/amd64/kernel_entry.S b/kernel/src/arch/amd64/kernel_entry.S similarity index 100% rename from src/starkernel/arch/amd64/kernel_entry.S rename to kernel/src/arch/amd64/kernel_entry.S diff --git a/src/starkernel/arch/amd64/switch.S b/kernel/src/arch/amd64/switch.S similarity index 100% rename from src/starkernel/arch/amd64/switch.S rename to kernel/src/arch/amd64/switch.S diff --git a/src/starkernel/arch/amd64/timer.c b/kernel/src/arch/amd64/timer.c similarity index 100% rename from src/starkernel/arch/amd64/timer.c rename to kernel/src/arch/amd64/timer.c diff --git a/src/starkernel/arch/riscv64/README.md b/kernel/src/arch/riscv64/README.md similarity index 100% rename from src/starkernel/arch/riscv64/README.md rename to kernel/src/arch/riscv64/README.md diff --git a/src/starkernel/arch/riscv64/apic.c b/kernel/src/arch/riscv64/apic.c similarity index 100% rename from src/starkernel/arch/riscv64/apic.c rename to kernel/src/arch/riscv64/apic.c diff --git a/src/starkernel/arch/riscv64/arch.c b/kernel/src/arch/riscv64/arch.c similarity index 100% rename from src/starkernel/arch/riscv64/arch.c rename to kernel/src/arch/riscv64/arch.c diff --git a/src/starkernel/arch/riscv64/boot.S b/kernel/src/arch/riscv64/boot.S similarity index 100% rename from src/starkernel/arch/riscv64/boot.S rename to kernel/src/arch/riscv64/boot.S diff --git a/src/starkernel/arch/riscv64/interrupts.c b/kernel/src/arch/riscv64/interrupts.c similarity index 100% rename from src/starkernel/arch/riscv64/interrupts.c rename to kernel/src/arch/riscv64/interrupts.c diff --git a/src/starkernel/arch/riscv64/isr.S b/kernel/src/arch/riscv64/isr.S similarity index 100% rename from src/starkernel/arch/riscv64/isr.S rename to kernel/src/arch/riscv64/isr.S diff --git a/src/starkernel/arch/riscv64/kernel_entry.S b/kernel/src/arch/riscv64/kernel_entry.S similarity index 100% rename from src/starkernel/arch/riscv64/kernel_entry.S rename to kernel/src/arch/riscv64/kernel_entry.S diff --git a/src/starkernel/arch/riscv64/plic.c b/kernel/src/arch/riscv64/plic.c similarity index 100% rename from src/starkernel/arch/riscv64/plic.c rename to kernel/src/arch/riscv64/plic.c diff --git a/src/starkernel/arch/riscv64/switch.S b/kernel/src/arch/riscv64/switch.S similarity index 100% rename from src/starkernel/arch/riscv64/switch.S rename to kernel/src/arch/riscv64/switch.S diff --git a/src/starkernel/arch/riscv64/timer.c b/kernel/src/arch/riscv64/timer.c similarity index 100% rename from src/starkernel/arch/riscv64/timer.c rename to kernel/src/arch/riscv64/timer.c diff --git a/src/starkernel/artemis_sig.c b/kernel/src/artemis_sig.c similarity index 100% rename from src/starkernel/artemis_sig.c rename to kernel/src/artemis_sig.c diff --git a/src/starkernel/boot/README.md b/kernel/src/boot/README.md similarity index 100% rename from src/starkernel/boot/README.md rename to kernel/src/boot/README.md diff --git a/src/starkernel/boot/cmdline.c b/kernel/src/boot/cmdline.c similarity index 100% rename from src/starkernel/boot/cmdline.c rename to kernel/src/boot/cmdline.c diff --git a/src/starkernel/boot/elf_loader.c b/kernel/src/boot/elf_loader.c similarity index 100% rename from src/starkernel/boot/elf_loader.c rename to kernel/src/boot/elf_loader.c diff --git a/src/starkernel/boot/reloc.S b/kernel/src/boot/reloc.S similarity index 100% rename from src/starkernel/boot/reloc.S rename to kernel/src/boot/reloc.S diff --git a/src/starkernel/boot/reloc_stub.c b/kernel/src/boot/reloc_stub.c similarity index 100% rename from src/starkernel/boot/reloc_stub.c rename to kernel/src/boot/reloc_stub.c diff --git a/src/starkernel/boot/uefi_loader.c b/kernel/src/boot/uefi_loader.c similarity index 100% rename from src/starkernel/boot/uefi_loader.c rename to kernel/src/boot/uefi_loader.c diff --git a/src/starkernel/capsule/README.md b/kernel/src/capsule/README.md similarity index 100% rename from src/starkernel/capsule/README.md rename to kernel/src/capsule/README.md diff --git a/src/starkernel/capsule/capsule_birth.c b/kernel/src/capsule/capsule_birth.c similarity index 100% rename from src/starkernel/capsule/capsule_birth.c rename to kernel/src/capsule/capsule_birth.c diff --git a/src/starkernel/capsule/capsule_console.c b/kernel/src/capsule/capsule_console.c similarity index 100% rename from src/starkernel/capsule/capsule_console.c rename to kernel/src/capsule/capsule_console.c diff --git a/src/starkernel/capsule/capsule_find.c b/kernel/src/capsule/capsule_find.c similarity index 100% rename from src/starkernel/capsule/capsule_find.c rename to kernel/src/capsule/capsule_find.c diff --git a/src/starkernel/capsule/capsule_loader.c b/kernel/src/capsule/capsule_loader.c similarity index 100% rename from src/starkernel/capsule/capsule_loader.c rename to kernel/src/capsule/capsule_loader.c diff --git a/src/starkernel/capsule/capsule_mint.c b/kernel/src/capsule/capsule_mint.c similarity index 100% rename from src/starkernel/capsule/capsule_mint.c rename to kernel/src/capsule/capsule_mint.c diff --git a/src/starkernel/capsule/capsule_run.c b/kernel/src/capsule/capsule_run.c similarity index 100% rename from src/starkernel/capsule/capsule_run.c rename to kernel/src/capsule/capsule_run.c diff --git a/src/starkernel/capsule/capsule_runcap.c b/kernel/src/capsule/capsule_runcap.c similarity index 100% rename from src/starkernel/capsule/capsule_runcap.c rename to kernel/src/capsule/capsule_runcap.c diff --git a/src/starkernel/capsule/capsule_sig.c b/kernel/src/capsule/capsule_sig.c similarity index 100% rename from src/starkernel/capsule/capsule_sig.c rename to kernel/src/capsule/capsule_sig.c diff --git a/src/starkernel/capsule/capsule_validate.c b/kernel/src/capsule/capsule_validate.c similarity index 100% rename from src/starkernel/capsule/capsule_validate.c rename to kernel/src/capsule/capsule_validate.c diff --git a/src/starkernel/capsule/capsule_vm_hooks.c b/kernel/src/capsule/capsule_vm_hooks.c similarity index 100% rename from src/starkernel/capsule/capsule_vm_hooks.c rename to kernel/src/capsule/capsule_vm_hooks.c diff --git a/src/starkernel/capsule/capsule_vm_physics.c b/kernel/src/capsule/capsule_vm_physics.c similarity index 100% rename from src/starkernel/capsule/capsule_vm_physics.c rename to kernel/src/capsule/capsule_vm_physics.c diff --git a/src/starkernel/capsule/capsule_vm_switch_signal.c b/kernel/src/capsule/capsule_vm_switch_signal.c similarity index 100% rename from src/starkernel/capsule/capsule_vm_switch_signal.c rename to kernel/src/capsule/capsule_vm_switch_signal.c diff --git a/src/starkernel/capsule/capsule_wirebind.c b/kernel/src/capsule/capsule_wirebind.c similarity index 100% rename from src/starkernel/capsule/capsule_wirebind.c rename to kernel/src/capsule/capsule_wirebind.c diff --git a/src/starkernel/capsule/capsule_zuse_boot.c b/kernel/src/capsule/capsule_zuse_boot.c similarity index 100% rename from src/starkernel/capsule/capsule_zuse_boot.c rename to kernel/src/capsule/capsule_zuse_boot.c diff --git a/src/starkernel/capsule/mama_forth_words.c b/kernel/src/capsule/mama_forth_words.c similarity index 99% rename from src/starkernel/capsule/mama_forth_words.c rename to kernel/src/capsule/mama_forth_words.c index 900885f8..404cf5f2 100644 --- a/src/starkernel/capsule/mama_forth_words.c +++ b/kernel/src/capsule/mama_forth_words.c @@ -54,7 +54,7 @@ #include "starkernel/capsule_run.h" #include "starkernel/capsule_loader.h" #include "starkernel/capsule_vm_physics.h" -#include "starkernel/vm/vm_internal.h" +#include "../vm/vm_internal.h" #include "starkernel/vm/stadium.h" /* item 4.2 -- STADIUM-* words */ #include "starkernel/capsule_vm_switch_signal.h" /* FABRIC-3.md §XXVIII Stage 3 follow-on -- SWITCH-MARK-WORK */ #include "starkernel/vm/stadium_words.h" /* item 4.2 -- stadium_words_resident_heat() */ diff --git a/src/starkernel/capsule/vm_identity.c b/kernel/src/capsule/vm_identity.c similarity index 100% rename from src/starkernel/capsule/vm_identity.c rename to kernel/src/capsule/vm_identity.c diff --git a/src/starkernel/capsule/vm_uuid.c b/kernel/src/capsule/vm_uuid.c similarity index 100% rename from src/starkernel/capsule/vm_uuid.c rename to kernel/src/capsule/vm_uuid.c diff --git a/src/starkernel/capsule/zuse_eligibility.c b/kernel/src/capsule/zuse_eligibility.c similarity index 100% rename from src/starkernel/capsule/zuse_eligibility.c rename to kernel/src/capsule/zuse_eligibility.c diff --git a/src/starkernel/crypto/ed25519.c b/kernel/src/crypto/ed25519.c similarity index 100% rename from src/starkernel/crypto/ed25519.c rename to kernel/src/crypto/ed25519.c diff --git a/src/starkernel/crypto/fe25519.c b/kernel/src/crypto/fe25519.c similarity index 100% rename from src/starkernel/crypto/fe25519.c rename to kernel/src/crypto/fe25519.c diff --git a/src/starkernel/crypto/scalar25519.c b/kernel/src/crypto/scalar25519.c similarity index 100% rename from src/starkernel/crypto/scalar25519.c rename to kernel/src/crypto/scalar25519.c diff --git a/src/starkernel/crypto/sha512.c b/kernel/src/crypto/sha512.c similarity index 100% rename from src/starkernel/crypto/sha512.c rename to kernel/src/crypto/sha512.c diff --git a/src/starkernel/crypto/x509_ed25519.c b/kernel/src/crypto/x509_ed25519.c similarity index 100% rename from src/starkernel/crypto/x509_ed25519.c rename to kernel/src/crypto/x509_ed25519.c diff --git a/src/starkernel/doe_log.c b/kernel/src/doe_log.c similarity index 100% rename from src/starkernel/doe_log.c rename to kernel/src/doe_log.c diff --git a/src/starkernel/hal/README.md b/kernel/src/hal/README.md similarity index 100% rename from src/starkernel/hal/README.md rename to kernel/src/hal/README.md diff --git a/src/starkernel/hal/console.c b/kernel/src/hal/console.c similarity index 100% rename from src/starkernel/hal/console.c rename to kernel/src/hal/console.c diff --git a/src/starkernel/hal/fdt.c b/kernel/src/hal/fdt.c similarity index 100% rename from src/starkernel/hal/fdt.c rename to kernel/src/hal/fdt.c diff --git a/src/starkernel/hal/font_8x16.c b/kernel/src/hal/font_8x16.c similarity index 100% rename from src/starkernel/hal/font_8x16.c rename to kernel/src/hal/font_8x16.c diff --git a/src/starkernel/hal/framebuffer.c b/kernel/src/hal/framebuffer.c similarity index 100% rename from src/starkernel/hal/framebuffer.c rename to kernel/src/hal/framebuffer.c diff --git a/src/starkernel/hal/hal.c b/kernel/src/hal/hal.c similarity index 100% rename from src/starkernel/hal/hal.c rename to kernel/src/hal/hal.c diff --git a/src/starkernel/hal/host_services.c b/kernel/src/hal/host_services.c similarity index 100% rename from src/starkernel/hal/host_services.c rename to kernel/src/hal/host_services.c diff --git a/src/starkernel/hal/memory.c b/kernel/src/hal/memory.c similarity index 100% rename from src/starkernel/hal/memory.c rename to kernel/src/hal/memory.c diff --git a/src/starkernel/hal/ttf.c b/kernel/src/hal/ttf.c similarity index 100% rename from src/starkernel/hal/ttf.c rename to kernel/src/hal/ttf.c diff --git a/src/starkernel/hal/vt100.c b/kernel/src/hal/vt100.c similarity index 100% rename from src/starkernel/hal/vt100.c rename to kernel/src/hal/vt100.c diff --git a/src/starkernel/hash/README.md b/kernel/src/hash/README.md similarity index 100% rename from src/starkernel/hash/README.md rename to kernel/src/hash/README.md diff --git a/src/starkernel/hash/xxhash64.c b/kernel/src/hash/xxhash64.c similarity index 100% rename from src/starkernel/hash/xxhash64.c rename to kernel/src/hash/xxhash64.c diff --git a/src/starkernel/heartbeat.c b/kernel/src/heartbeat.c similarity index 100% rename from src/starkernel/heartbeat.c rename to kernel/src/heartbeat.c diff --git a/src/starkernel/homeblocks_sig.c b/kernel/src/homeblocks_sig.c similarity index 100% rename from src/starkernel/homeblocks_sig.c rename to kernel/src/homeblocks_sig.c diff --git a/src/starkernel/kernel_main.c b/kernel/src/kernel_main.c similarity index 100% rename from src/starkernel/kernel_main.c rename to kernel/src/kernel_main.c diff --git a/src/starkernel/log_region.c b/kernel/src/log_region.c similarity index 100% rename from src/starkernel/log_region.c rename to kernel/src/log_region.c diff --git a/src/starkernel/math/README.md b/kernel/src/math/README.md similarity index 100% rename from src/starkernel/math/README.md rename to kernel/src/math/README.md diff --git a/src/starkernel/math/q48_16.c b/kernel/src/math/q48_16.c similarity index 100% rename from src/starkernel/math/q48_16.c rename to kernel/src/math/q48_16.c diff --git a/src/starkernel/memory/README.md b/kernel/src/memory/README.md similarity index 100% rename from src/starkernel/memory/README.md rename to kernel/src/memory/README.md diff --git a/src/starkernel/memory/kmalloc.c b/kernel/src/memory/kmalloc.c similarity index 100% rename from src/starkernel/memory/kmalloc.c rename to kernel/src/memory/kmalloc.c diff --git a/src/starkernel/memory/pmm.c b/kernel/src/memory/pmm.c similarity index 100% rename from src/starkernel/memory/pmm.c rename to kernel/src/memory/pmm.c diff --git a/src/starkernel/memory/vmm.c b/kernel/src/memory/vmm.c similarity index 100% rename from src/starkernel/memory/vmm.c rename to kernel/src/memory/vmm.c diff --git a/src/starkernel/pci/README.md b/kernel/src/pci/README.md similarity index 100% rename from src/starkernel/pci/README.md rename to kernel/src/pci/README.md diff --git a/src/starkernel/pci/pci.c b/kernel/src/pci/pci.c similarity index 100% rename from src/starkernel/pci/pci.c rename to kernel/src/pci/pci.c diff --git a/src/starkernel/repl.c b/kernel/src/repl.c similarity index 100% rename from src/starkernel/repl.c rename to kernel/src/repl.c diff --git a/src/starkernel/rng/rng.c b/kernel/src/rng/rng.c similarity index 100% rename from src/starkernel/rng/rng.c rename to kernel/src/rng/rng.c diff --git a/src/starkernel/usb/blkio_usb.c b/kernel/src/usb/blkio_usb.c similarity index 100% rename from src/starkernel/usb/blkio_usb.c rename to kernel/src/usb/blkio_usb.c diff --git a/src/starkernel/usb/xhci.c b/kernel/src/usb/xhci.c similarity index 100% rename from src/starkernel/usb/xhci.c rename to kernel/src/usb/xhci.c diff --git a/src/starkernel/virtio/README.md b/kernel/src/virtio/README.md similarity index 100% rename from src/starkernel/virtio/README.md rename to kernel/src/virtio/README.md diff --git a/src/starkernel/virtio/virtio_blk.c b/kernel/src/virtio/virtio_blk.c similarity index 100% rename from src/starkernel/virtio/virtio_blk.c rename to kernel/src/virtio/virtio_blk.c diff --git a/src/starkernel/virtio/virtio_input.c b/kernel/src/virtio/virtio_input.c similarity index 100% rename from src/starkernel/virtio/virtio_input.c rename to kernel/src/virtio/virtio_input.c diff --git a/src/starkernel/virtio/virtio_rng.c b/kernel/src/virtio/virtio_rng.c similarity index 100% rename from src/starkernel/virtio/virtio_rng.c rename to kernel/src/virtio/virtio_rng.c diff --git a/src/starkernel/vm/README.md b/kernel/src/vm/README.md similarity index 100% rename from src/starkernel/vm/README.md rename to kernel/src/vm/README.md diff --git a/src/starkernel/vm/alloc_kernel.c b/kernel/src/vm/alloc_kernel.c similarity index 100% rename from src/starkernel/vm/alloc_kernel.c rename to kernel/src/vm/alloc_kernel.c diff --git a/src/starkernel/vm/arena.c b/kernel/src/vm/arena.c similarity index 100% rename from src/starkernel/vm/arena.c rename to kernel/src/vm/arena.c diff --git a/src/starkernel/vm/bootstrap/README.md b/kernel/src/vm/bootstrap/README.md similarity index 100% rename from src/starkernel/vm/bootstrap/README.md rename to kernel/src/vm/bootstrap/README.md diff --git a/src/starkernel/vm/bootstrap/sk_vm_bootstrap.c b/kernel/src/vm/bootstrap/sk_vm_bootstrap.c similarity index 100% rename from src/starkernel/vm/bootstrap/sk_vm_bootstrap.c rename to kernel/src/vm/bootstrap/sk_vm_bootstrap.c diff --git a/src/starkernel/vm/host/README.md b/kernel/src/vm/host/README.md similarity index 100% rename from src/starkernel/vm/host/README.md rename to kernel/src/vm/host/README.md diff --git a/src/starkernel/vm/host/shim.c b/kernel/src/vm/host/shim.c similarity index 100% rename from src/starkernel/vm/host/shim.c rename to kernel/src/vm/host/shim.c diff --git a/src/starkernel/vm/kernel_hermes.c b/kernel/src/vm/kernel_hermes.c similarity index 100% rename from src/starkernel/vm/kernel_hermes.c rename to kernel/src/vm/kernel_hermes.c diff --git a/src/starkernel/vm/parity.c b/kernel/src/vm/parity.c similarity index 100% rename from src/starkernel/vm/parity.c rename to kernel/src/vm/parity.c diff --git a/src/starkernel/vm/q48_stubs.c b/kernel/src/vm/q48_stubs.c similarity index 100% rename from src/starkernel/vm/q48_stubs.c rename to kernel/src/vm/q48_stubs.c diff --git a/src/starkernel/vm/session.c b/kernel/src/vm/session.c similarity index 100% rename from src/starkernel/vm/session.c rename to kernel/src/vm/session.c diff --git a/src/starkernel/vm/stadium.c b/kernel/src/vm/stadium.c similarity index 100% rename from src/starkernel/vm/stadium.c rename to kernel/src/vm/stadium.c diff --git a/src/starkernel/vm/stadium_blocks.c b/kernel/src/vm/stadium_blocks.c similarity index 100% rename from src/starkernel/vm/stadium_blocks.c rename to kernel/src/vm/stadium_blocks.c diff --git a/src/starkernel/vm/stadium_words.c b/kernel/src/vm/stadium_words.c similarity index 100% rename from src/starkernel/vm/stadium_words.c rename to kernel/src/vm/stadium_words.c diff --git a/src/starkernel/vm/switch.c b/kernel/src/vm/switch.c similarity index 100% rename from src/starkernel/vm/switch.c rename to kernel/src/vm/switch.c diff --git a/src/starkernel/vm/vm_bootstrap.c b/kernel/src/vm/vm_bootstrap.c similarity index 96% rename from src/starkernel/vm/vm_bootstrap.c rename to kernel/src/vm/vm_bootstrap.c index 961bd192..2c2f0ec5 100644 --- a/src/starkernel/vm/vm_bootstrap.c +++ b/kernel/src/vm/vm_bootstrap.c @@ -44,14 +44,14 @@ * vm_bootstrap.c - VM initialization and bootstrap logic */ -#include "../include/vm.h" -#include "../include/log.h" -#include "../include/word_registry.h" -#include "../include/vm_debug.h" -#include "../include/physics_hotwords_cache.h" -#include "../include/rolling_window_of_truth.h" -#include "../include/dictionary_heat_optimization.h" -#include "../include/ssm_jacquard.h" +#include "../../../v3/include/vm.h" +#include "../../../v3/include/log.h" +#include "../../../v3/include/word_registry.h" +#include "../../../v3/include/vm_debug.h" +#include "../../../v3/include/physics_hotwords_cache.h" +#include "../../../v3/include/rolling_window_of_truth.h" +#include "../../../v3/include/dictionary_heat_optimization.h" +#include "../../../v3/include/ssm_jacquard.h" #include "word_source/include/vocabulary_words.h" #include "vm_internal.h" #ifdef __STARKERNEL__ diff --git a/src/starkernel/vm/vm_core.c b/kernel/src/vm/vm_core.c similarity index 98% rename from src/starkernel/vm/vm_core.c rename to kernel/src/vm/vm_core.c index 238c2a75..c8debd2c 100644 --- a/src/starkernel/vm/vm_core.c +++ b/kernel/src/vm/vm_core.c @@ -40,20 +40,20 @@ */ -#include "../include/vm.h" -#include "../include/inference_engine.h" -#include "../include/log.h" -#include "../include/word_registry.h" -#include "../include/vm_debug.h" -#include "../include/profiler.h" -#include "../include/platform_time.h" -#include "../include/physics_metadata.h" -#include "../include/physics_hotwords_cache.h" -#include "../include/physics_pipelining_metrics.h" -#include "../include/rolling_window_of_truth.h" -#include "../include/dictionary_heat_optimization.h" -#include "../include/ssm_jacquard.h" -#include "../include/vm_host.h" +#include "../../../v3/include/vm.h" +#include "../../../v3/include/inference_engine.h" +#include "../../../v3/include/log.h" +#include "../../../v3/include/word_registry.h" +#include "../../../v3/include/vm_debug.h" +#include "../../../v3/include/profiler.h" +#include "../../../v3/include/platform_time.h" +#include "../../../v3/include/physics_metadata.h" +#include "../../../v3/include/physics_hotwords_cache.h" +#include "../../../v3/include/physics_pipelining_metrics.h" +#include "../../../v3/include/rolling_window_of_truth.h" +#include "../../../v3/include/dictionary_heat_optimization.h" +#include "../../../v3/include/ssm_jacquard.h" +#include "../../../v3/include/vm_host.h" #ifdef __STARKERNEL__ #include "starkernel/vm/arena.h" #include "starkernel/log_attrib.h" /* vm_log_attributed_vm() */ diff --git a/src/starkernel/vm/vm_internal.h b/kernel/src/vm/vm_internal.h similarity index 97% rename from src/starkernel/vm/vm_internal.h rename to kernel/src/vm/vm_internal.h index 29dd1bf8..24504bdf 100644 --- a/src/starkernel/vm/vm_internal.h +++ b/kernel/src/vm/vm_internal.h @@ -43,8 +43,8 @@ #ifndef VM_INTERNAL_H #define VM_INTERNAL_H -#include "../include/vm.h" -#include "../include/vm_host.h" +#include "../../../v3/include/vm.h" +#include "../../../v3/include/vm_host.h" #ifndef PARITY_MODE #define PARITY_MODE 0 diff --git a/src/starkernel/vm/vm_runtime.c b/kernel/src/vm/vm_runtime.c similarity index 98% rename from src/starkernel/vm/vm_runtime.c rename to kernel/src/vm/vm_runtime.c index 04a8d11b..a6cb8b7a 100644 --- a/src/starkernel/vm/vm_runtime.c +++ b/kernel/src/vm/vm_runtime.c @@ -40,15 +40,15 @@ */ -#include "../include/vm.h" -#include "../include/log.h" -#include "../include/rolling_window_of_truth.h" -#include "../include/dictionary_heat_optimization.h" -#include "../include/inference_engine.h" -#include "../include/physics_metadata.h" -#include "../include/physics_hotwords_cache.h" +#include "../../../v3/include/vm.h" +#include "../../../v3/include/log.h" +#include "../../../v3/include/rolling_window_of_truth.h" +#include "../../../v3/include/dictionary_heat_optimization.h" +#include "../../../v3/include/inference_engine.h" +#include "../../../v3/include/physics_metadata.h" +#include "../../../v3/include/physics_hotwords_cache.h" #include "starkernel/doe_log.h" -#include "../include/ssm_jacquard.h" +#include "../../../v3/include/ssm_jacquard.h" #include "vm_internal.h" #include "starkernel/capsule_vm_physics.h" #include "starkernel/timer.h" diff --git a/lfs/amd64/starforth b/lfs/amd64/starforth index 979d248b..4ca07dde 100755 Binary files a/lfs/amd64/starforth and b/lfs/amd64/starforth differ diff --git a/logs2/.gitkeep b/logs2/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/logs2/README.md b/logs2/README.md deleted file mode 100644 index 8af4e21f..00000000 --- a/logs2/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# logs2/ - -A second, flatter archive of QEMU serial captures and screenshots (159 -loose files: `qemu-amd64-*.log`, `qemu-aarch64-*.log`, -`qemu-riscv64-*.log`, `qemu-screenshot-*`), predating or running parallel -to the timestamped-subdirectory convention used in `logs/`. Historical — -no per-file index; browse by timestamp in the filename. diff --git a/logs2/qemu-aarch64-20260609-192112.log b/logs2/qemu-aarch64-20260609-192112.log deleted file mode 100644 index 2f7c953a..00000000 --- a/logs2/qemu-aarch64-20260609-192112.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:83592610388794eaebdb48599b9b5029fc05031283d56ee3842f86a4c9ddefa6 -size 445259 diff --git a/logs2/qemu-aarch64-20260611-002443.log b/logs2/qemu-aarch64-20260611-002443.log deleted file mode 100644 index 63e80052..00000000 --- a/logs2/qemu-aarch64-20260611-002443.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3bfe27c8e32cd3e1af32ebc053f858ba75eca8c160b960aec6a2ca7e5425f2a6 -size 453599 diff --git a/logs2/qemu-aarch64-20260611-024456.log b/logs2/qemu-aarch64-20260611-024456.log deleted file mode 100644 index 0e82fb19..00000000 --- a/logs2/qemu-aarch64-20260611-024456.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2dc5080cfa9bfa8451cc868393e2db67d7c8660a5b7c923575e4b493229d2b8a -size 5286367 diff --git a/logs2/qemu-aarch64-20260611-173737.log b/logs2/qemu-aarch64-20260611-173737.log deleted file mode 100644 index d75f8f63..00000000 --- a/logs2/qemu-aarch64-20260611-173737.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd881909023f366709be8dbc472f2242b036e3b525e36f444f2bd46b3c81eb7c -size 2860321 diff --git a/logs2/qemu-aarch64-20260611-174951.log b/logs2/qemu-aarch64-20260611-174951.log deleted file mode 100644 index db0d847f..00000000 --- a/logs2/qemu-aarch64-20260611-174951.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2600af8c22e63034d608813b31c8e26dfb591126f41f5024668b5ca53a5f815c -size 444849 diff --git a/logs2/qemu-aarch64-20260611-175257.log b/logs2/qemu-aarch64-20260611-175257.log deleted file mode 100644 index 69556556..00000000 --- a/logs2/qemu-aarch64-20260611-175257.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:548df876d4fd35678a1635f035134aabd50bfc4f94834c7f1954b32ca43ebd6a -size 444396 diff --git a/logs2/qemu-aarch64-20260611-190822.log b/logs2/qemu-aarch64-20260611-190822.log deleted file mode 100644 index db0f610d..00000000 --- a/logs2/qemu-aarch64-20260611-190822.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1e3a8fe80891d91d4969965414f9ac788d7a39bf85374f62f9c385f6f88e01d1 -size 24550579 diff --git a/logs2/qemu-aarch64-20260611-202955.log b/logs2/qemu-aarch64-20260611-202955.log deleted file mode 100644 index 56e2d5c1..00000000 --- a/logs2/qemu-aarch64-20260611-202955.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2ec3b597aef2c9c692b9825ef822d77b61bad209aae74e9d4a730c5c012c392e -size 2860331 diff --git a/logs2/qemu-aarch64-20260612-132412.log b/logs2/qemu-aarch64-20260612-132412.log deleted file mode 100644 index 369178ef..00000000 --- a/logs2/qemu-aarch64-20260612-132412.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b7bcfd56a593b7dc7e94f1ee546ab482c2b7a0d6b0ef6031b52e2ab7591bdb9b -size 24547039 diff --git a/logs2/qemu-aarch64-20260612-141722.log b/logs2/qemu-aarch64-20260612-141722.log deleted file mode 100644 index dbebd8ea..00000000 --- a/logs2/qemu-aarch64-20260612-141722.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b049b883a58d66c646e20df02e5d931477901339ddf27c2d0d00ec73f62a0b48 -size 24571257 diff --git a/logs2/qemu-aarch64-20260612-160132.log b/logs2/qemu-aarch64-20260612-160132.log deleted file mode 100644 index 9d0e760c..00000000 --- a/logs2/qemu-aarch64-20260612-160132.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9c1543e8f781c0ffda150e68a473b436ef0611ae8ec0c3c57e838d82fbda99c5 -size 24557311 diff --git a/logs2/qemu-aarch64-20260614-164017.log b/logs2/qemu-aarch64-20260614-164017.log deleted file mode 100644 index c613be51..00000000 --- a/logs2/qemu-aarch64-20260614-164017.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e9f0a5be56112b6e6ccdc6760c3e0cfff35a1575f76dbd8481b0943b38a1e3e5 -size 445798 diff --git a/logs2/qemu-aarch64-20260614-164043.log b/logs2/qemu-aarch64-20260614-164043.log deleted file mode 100644 index 7155bc6c..00000000 --- a/logs2/qemu-aarch64-20260614-164043.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59c913bd5cafa83a930be572322946d54250f3e627ed3c7bb98479f0fbc073f7 -size 445830 diff --git a/logs2/qemu-aarch64-20260614-182154.log b/logs2/qemu-aarch64-20260614-182154.log deleted file mode 100644 index 5b14e80b..00000000 --- a/logs2/qemu-aarch64-20260614-182154.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74fd6eab5924ba58deb1530223267a70316d651420709eeedbeae1ba5c09a780 -size 445940 diff --git a/logs2/qemu-aarch64-20260614-190109.log b/logs2/qemu-aarch64-20260614-190109.log deleted file mode 100644 index c3579842..00000000 --- a/logs2/qemu-aarch64-20260614-190109.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ec60bcb52390ce385697baa07c4188630be60227d606edf5f5df3281071443e1 -size 446081 diff --git a/logs2/qemu-aarch64-20260614-230803.log b/logs2/qemu-aarch64-20260614-230803.log deleted file mode 100644 index c02c03fd..00000000 --- a/logs2/qemu-aarch64-20260614-230803.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e785237ae55ff3327eb7f68aa262abada47614704f06be316c069d0b1a71da6b -size 24762825 diff --git a/logs2/qemu-aarch64-20260615-003908.log b/logs2/qemu-aarch64-20260615-003908.log deleted file mode 100644 index 0b81ce4f..00000000 --- a/logs2/qemu-aarch64-20260615-003908.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b00954cc3f39dcc4cdd8133baaa20f71e9b4a708138b41f2243a79e0c83759b4 -size 24791976 diff --git a/logs2/qemu-aarch64-20260615-005301.log b/logs2/qemu-aarch64-20260615-005301.log deleted file mode 100644 index 7c0dfa2b..00000000 --- a/logs2/qemu-aarch64-20260615-005301.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6fef1dd6edd20ac9f32396e449be401579be2165840d5a17df8763a880de1f78 -size 24810271 diff --git a/logs2/qemu-aarch64-20260615-020020.log b/logs2/qemu-aarch64-20260615-020020.log deleted file mode 100644 index 2f385fe3..00000000 --- a/logs2/qemu-aarch64-20260615-020020.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6809d86a1b7eae40c2c8ad42c10854e3e22ac96ccb2f8b50cc7d07da3d196ea1 -size 24798283 diff --git a/logs2/qemu-aarch64-20260615-103253.log b/logs2/qemu-aarch64-20260615-103253.log deleted file mode 100644 index b47ff0cb..00000000 --- a/logs2/qemu-aarch64-20260615-103253.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c79dd37830259c5988c36de5fc6d3cb0be96efe405b8bfb215685558aa69acd8 -size 446176 diff --git a/logs2/qemu-aarch64-20260615-103655.log b/logs2/qemu-aarch64-20260615-103655.log deleted file mode 100644 index 70cfd266..00000000 --- a/logs2/qemu-aarch64-20260615-103655.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8d752ffb4307e3b822788f64f55ce959a72de251ab0a8a35870ee32b47ce5402 -size 446096 diff --git a/logs2/qemu-aarch64-20260615-121103.log b/logs2/qemu-aarch64-20260615-121103.log deleted file mode 100644 index 7d342f68..00000000 --- a/logs2/qemu-aarch64-20260615-121103.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9398bee6c2494a07c23d1250814427236cbfe72881cf79387f1360b5105d2f97 -size 39524558 diff --git a/logs2/qemu-aarch64-20260615-123814.log b/logs2/qemu-aarch64-20260615-123814.log deleted file mode 100644 index 551b18a5..00000000 --- a/logs2/qemu-aarch64-20260615-123814.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b69188e7704e3f2dda83ae30f72220aa3b6edb6940c26e5d9f901263bfa3e859 -size 40407590 diff --git a/logs2/qemu-aarch64-20260615-160204.log b/logs2/qemu-aarch64-20260615-160204.log deleted file mode 100644 index 7a3317e0..00000000 --- a/logs2/qemu-aarch64-20260615-160204.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8702707f3ff9558294139bbeeee25e1a1993c2cafdecaa81b8c621611af5e0aa -size 40382353 diff --git a/logs2/qemu-aarch64-20260615-183010.log b/logs2/qemu-aarch64-20260615-183010.log deleted file mode 100644 index 311e1b25..00000000 --- a/logs2/qemu-aarch64-20260615-183010.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:af8042f75f58308aeefcaaeac464b0b571b27b6ba559923fd2df35693e76e37a -size 445915 diff --git a/logs2/qemu-aarch64-20260615-192747.log b/logs2/qemu-aarch64-20260615-192747.log deleted file mode 100644 index 45d7e8dc..00000000 --- a/logs2/qemu-aarch64-20260615-192747.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a62df6904fff8e5a31790475d2121d91cf09ae1483122a9b237dde6ad6f0d8e9 -size 25720612 diff --git a/logs2/qemu-aarch64-20260615-194133.log b/logs2/qemu-aarch64-20260615-194133.log deleted file mode 100644 index e0d37b7a..00000000 --- a/logs2/qemu-aarch64-20260615-194133.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9e78c199ae0dc052016a86c4478e7194d7ed2a26a400de58e37812fc300c7ca -size 25728577 diff --git a/logs2/qemu-aarch64-20260615-204232.log b/logs2/qemu-aarch64-20260615-204232.log deleted file mode 100644 index d81bd935..00000000 --- a/logs2/qemu-aarch64-20260615-204232.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a97c07ff0ad676c5d59b9b724ea6f3be785fec5167f06950be5107a2b47391bf -size 25730370 diff --git a/logs2/qemu-aarch64-20260615-223549.log b/logs2/qemu-aarch64-20260615-223549.log deleted file mode 100644 index 86841a74..00000000 --- a/logs2/qemu-aarch64-20260615-223549.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f10800135a26e0131326a9831d55315ad39ef194d912e4ce046d1519f9dd7fcb -size 446759 diff --git a/logs2/qemu-aarch64-20260615-235720.log b/logs2/qemu-aarch64-20260615-235720.log deleted file mode 100644 index 1109cfa0..00000000 --- a/logs2/qemu-aarch64-20260615-235720.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4df71446c9efe65f799d14f42672542570cd5f305e2b212fde2693e0347e1509 -size 24826180 diff --git a/logs2/qemu-aarch64-20260616-000920.log b/logs2/qemu-aarch64-20260616-000920.log deleted file mode 100644 index 4ea3f40b..00000000 --- a/logs2/qemu-aarch64-20260616-000920.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e93a8ca1550f57abc3f7622bef06944de1c10fece7671a58a64d6086f86885b -size 24826961 diff --git a/logs2/qemu-aarch64-20260616-011049.log b/logs2/qemu-aarch64-20260616-011049.log deleted file mode 100644 index d96286e9..00000000 --- a/logs2/qemu-aarch64-20260616-011049.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:27a0cf152b499f395d50627028ea0e7d4d1a8a79a14794d46952c0eed7bcbd52 -size 24818835 diff --git a/logs2/qemu-aarch64-20260616-112907.log b/logs2/qemu-aarch64-20260616-112907.log deleted file mode 100644 index de788d20..00000000 --- a/logs2/qemu-aarch64-20260616-112907.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba61d2da7c79df29001522ad883f89013c4ee6fd2456f6aadacb44be1b95c022 -size 2861725 diff --git a/logs2/qemu-aarch64-20260616-155223.log b/logs2/qemu-aarch64-20260616-155223.log deleted file mode 100644 index e93447d2..00000000 --- a/logs2/qemu-aarch64-20260616-155223.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c3e133f3d8863c737ed9a9122c5dec2d5b0550795fa364646801c60d44e5588d -size 2861637 diff --git a/logs2/qemu-aarch64-20260616-175845.log b/logs2/qemu-aarch64-20260616-175845.log deleted file mode 100644 index 29bd15a6..00000000 --- a/logs2/qemu-aarch64-20260616-175845.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fade9151f59cbd3268d1ce00f2e82dfb8e593b42000f95a5ce854a92d954f4f -size 446777 diff --git a/logs2/qemu-aarch64-20260620-222449.log b/logs2/qemu-aarch64-20260620-222449.log deleted file mode 100644 index f0931a54..00000000 --- a/logs2/qemu-aarch64-20260620-222449.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:33a2129c7b81183f63e83709fedfabb6918611e3c6af7cc5315da0ab8af952e0 -size 446938 diff --git a/logs2/qemu-aarch64-20260621-004736.log b/logs2/qemu-aarch64-20260621-004736.log deleted file mode 100644 index 8417c1d8..00000000 --- a/logs2/qemu-aarch64-20260621-004736.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cb60e03b9837f6f4301668c98abf9ec5b6c87d953531e4bdd3a92913d892599 -size 455373 diff --git a/logs2/qemu-amd64-20260609-184750.log b/logs2/qemu-amd64-20260609-184750.log deleted file mode 100644 index 395e0868..00000000 --- a/logs2/qemu-amd64-20260609-184750.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:de8b3b76a479fdd3b80d8e678b3ffeacfbee6bceba39458889c7a59ef83d496d -size 124750043 diff --git a/logs2/qemu-amd64-20260609-193717.log b/logs2/qemu-amd64-20260609-193717.log deleted file mode 100644 index 49eac741..00000000 --- a/logs2/qemu-amd64-20260609-193717.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:264da04e9961b71db4ec4f41a6142b7a91dbe652c5a77b363a4b5ba42c9444f4 -size 452546 diff --git a/logs2/qemu-amd64-20260611-002301.log b/logs2/qemu-amd64-20260611-002301.log deleted file mode 100644 index fcf1c42a..00000000 --- a/logs2/qemu-amd64-20260611-002301.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:700b82c28e7871cc91e2dcaff02bfc8f9067671293e4d56c20e7eefa18fb0c15 -size 459031 diff --git a/logs2/qemu-amd64-20260611-012412.log b/logs2/qemu-amd64-20260611-012412.log deleted file mode 100644 index 2dd16200..00000000 --- a/logs2/qemu-amd64-20260611-012412.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a0aacf2887944ca026af06807220dc950c8d451bbd1c3a3d315e6a062e29558 -size 25304213 diff --git a/logs2/qemu-amd64-20260611-013401.log b/logs2/qemu-amd64-20260611-013401.log deleted file mode 100644 index a54d891d..00000000 --- a/logs2/qemu-amd64-20260611-013401.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cc7c9205fb2fcba2a3d4b7816189e092234c6becf5061962fe8e1ce777dd1da9 -size 51847478 diff --git a/logs2/qemu-amd64-20260611-023023.log b/logs2/qemu-amd64-20260611-023023.log deleted file mode 100644 index dfe07389..00000000 --- a/logs2/qemu-amd64-20260611-023023.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36ad81e9c25263496226870600ec7045a634709bfe34d559fa19c2bfa79af1f9 -size 1229048 diff --git a/logs2/qemu-amd64-20260611-023818.log b/logs2/qemu-amd64-20260611-023818.log deleted file mode 100644 index e33dfe25..00000000 --- a/logs2/qemu-amd64-20260611-023818.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c6c8f18746be9320b887e647aa718665b93cdabc7a83cbcd1e4f5652e36ea51c -size 5437912 diff --git a/logs2/qemu-amd64-20260611-172713.log b/logs2/qemu-amd64-20260611-172713.log deleted file mode 100644 index 657bfaa9..00000000 --- a/logs2/qemu-amd64-20260611-172713.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bb922c9a54f2652ce1a583e77094458e60c65b6df3b30ef478f3ea371be1835a -size 2986532 diff --git a/logs2/qemu-amd64-20260611-174904.log b/logs2/qemu-amd64-20260611-174904.log deleted file mode 100644 index 8eb20203..00000000 --- a/logs2/qemu-amd64-20260611-174904.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ea16d957689e30ecff83b93f8596d1b87e784fd735971db3ef84ce7f14eb0b4c -size 452793 diff --git a/logs2/qemu-amd64-20260611-175217.log b/logs2/qemu-amd64-20260611-175217.log deleted file mode 100644 index 4836f432..00000000 --- a/logs2/qemu-amd64-20260611-175217.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a6cbf185529b069e76b4a803facc6d7f8c7ed86426d0687d893253434186d76a -size 452229 diff --git a/logs2/qemu-amd64-20260611-180750.log b/logs2/qemu-amd64-20260611-180750.log deleted file mode 100644 index 6ad85163..00000000 --- a/logs2/qemu-amd64-20260611-180750.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:026efae6d5ee2af7ff980b45aae7a7b01ac8ef65aee9da7e5c4c44cd904e48d9 -size 16809778 diff --git a/logs2/qemu-amd64-20260611-192015.log b/logs2/qemu-amd64-20260611-192015.log deleted file mode 100644 index 70ce7925..00000000 --- a/logs2/qemu-amd64-20260611-192015.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4ca1094d0b8b819711a348159ea1a222192972985780b432f3ab235c8008cd2 -size 15873920 diff --git a/logs2/qemu-amd64-20260611-201951.log b/logs2/qemu-amd64-20260611-201951.log deleted file mode 100644 index 28de5f03..00000000 --- a/logs2/qemu-amd64-20260611-201951.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b9481705be52280fa8bd2462de213c82813f0898e04944b51856ed6d7f1fc20 -size 2990826 diff --git a/logs2/qemu-amd64-20260611-204126.log b/logs2/qemu-amd64-20260611-204126.log deleted file mode 100644 index bf608125..00000000 --- a/logs2/qemu-amd64-20260611-204126.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:600a1199e2c4d87ff564082bdcbbb2a2e34a54c6d1bfc4e2656ae42dfb3937c6 -size 16994750 diff --git a/logs2/qemu-amd64-20260611-223613.log b/logs2/qemu-amd64-20260611-223613.log deleted file mode 100644 index 47e14582..00000000 --- a/logs2/qemu-amd64-20260611-223613.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:53fd8da927e76fbc0c15b0596bab99a09f7e301e5f057428020c3a11dad67972 -size 24296628 diff --git a/logs2/qemu-amd64-20260612-110212.log b/logs2/qemu-amd64-20260612-110212.log deleted file mode 100644 index 4594ee43..00000000 --- a/logs2/qemu-amd64-20260612-110212.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58d2f47e95d24705ddef7fea8c8ea34b522141e60b0a4c029d88d5a982654247 -size 26655843 diff --git a/logs2/qemu-amd64-20260612-142323.log b/logs2/qemu-amd64-20260612-142323.log deleted file mode 100644 index 6db15b98..00000000 --- a/logs2/qemu-amd64-20260612-142323.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:76a6a7af9c49d54a4ff812ff4cbd0d61ccd3d9444d093d4e23474669b9002082 -size 26814590 diff --git a/logs2/qemu-amd64-20260612-160656.log b/logs2/qemu-amd64-20260612-160656.log deleted file mode 100644 index d4c37437..00000000 --- a/logs2/qemu-amd64-20260612-160656.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:11f3c49d85895d547add1cd1a465479103b82d46bee48784e0f11ea7126fb167 -size 26787619 diff --git a/logs2/qemu-amd64-20260614-163853.log b/logs2/qemu-amd64-20260614-163853.log deleted file mode 100644 index a2f3714a..00000000 --- a/logs2/qemu-amd64-20260614-163853.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79768405c5684fdbe3a37a0a20d10455f9a71689b2de19747bfc2a4e2f96ecdc -size 452449 diff --git a/logs2/qemu-amd64-20260614-182034.log b/logs2/qemu-amd64-20260614-182034.log deleted file mode 100644 index f7033f5d..00000000 --- a/logs2/qemu-amd64-20260614-182034.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91ab796a2962f55f083225ec016df2d993a157f4c7ffdff0297e8fdca96f44dc -size 454035 diff --git a/logs2/qemu-amd64-20260614-182119.log b/logs2/qemu-amd64-20260614-182119.log deleted file mode 100644 index 1601438f..00000000 --- a/logs2/qemu-amd64-20260614-182119.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d575a3d5e65e08e83dd9ffafe823afbe6461397944c87fe550d0894639428e24 -size 454035 diff --git a/logs2/qemu-amd64-20260614-183302.log b/logs2/qemu-amd64-20260614-183302.log deleted file mode 100644 index f0638900..00000000 --- a/logs2/qemu-amd64-20260614-183302.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28b0858d6ff05c8c7e3f43bac46abc1c999e89d341ab81cc54a8995be8731b5b -size 454084 diff --git a/logs2/qemu-amd64-20260614-185942.log b/logs2/qemu-amd64-20260614-185942.log deleted file mode 100644 index 9d69ae2e..00000000 --- a/logs2/qemu-amd64-20260614-185942.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f528c79f5107275bd0e1a4e4d7dfbea814e12d52ad1c664e596bde47f99df11 -size 454111 diff --git a/logs2/qemu-amd64-20260614-190244.log b/logs2/qemu-amd64-20260614-190244.log deleted file mode 100644 index ee25f576..00000000 --- a/logs2/qemu-amd64-20260614-190244.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d703df3557bdd25026e54230a3d91e47849001f78331b09754e00eecd8b132c8 -size 454093 diff --git a/logs2/qemu-amd64-20260614-212929.log b/logs2/qemu-amd64-20260614-212929.log deleted file mode 100644 index 83deedb1..00000000 --- a/logs2/qemu-amd64-20260614-212929.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3d625ea9b5712bb569182f6e69be834d944ddc4c337d160a948131c8be94ba8 -size 26750601 diff --git a/logs2/qemu-amd64-20260614-233623.log b/logs2/qemu-amd64-20260614-233623.log deleted file mode 100644 index 727f18bf..00000000 --- a/logs2/qemu-amd64-20260614-233623.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c64cef6aa7612c046f55596d4303cd93f52def9b229c1978db686eb3ac0c68a6 -size 26653964 diff --git a/logs2/qemu-amd64-20260615-005725.log b/logs2/qemu-amd64-20260615-005725.log deleted file mode 100644 index dfe9b396..00000000 --- a/logs2/qemu-amd64-20260615-005725.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:535c12b23a1d1f555475283784ee3a80442379752c946ebe391e8e179aa18a6b -size 26678736 diff --git a/logs2/qemu-amd64-20260615-020446.log b/logs2/qemu-amd64-20260615-020446.log deleted file mode 100644 index b99dbe33..00000000 --- a/logs2/qemu-amd64-20260615-020446.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:951797fcd00093a2ff1f9aaff10cacbb0697d83ad33bdd4052aa59b716b2d8f7 -size 26669147 diff --git a/logs2/qemu-amd64-20260615-103154.log b/logs2/qemu-amd64-20260615-103154.log deleted file mode 100644 index 8bce7da7..00000000 --- a/logs2/qemu-amd64-20260615-103154.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36244198d4ea8df9153d36bf317aa460b9891a1a8f23a112c04e3a96596cc419 -size 454240 diff --git a/logs2/qemu-amd64-20260615-103619.log b/logs2/qemu-amd64-20260615-103619.log deleted file mode 100644 index 34078166..00000000 --- a/logs2/qemu-amd64-20260615-103619.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c0b7c167eed3efb9c6eddd434dbf34f42599c62c2229af469ad6c1841b293f7 -size 453990 diff --git a/logs2/qemu-amd64-20260615-103843.log b/logs2/qemu-amd64-20260615-103843.log deleted file mode 100644 index cfe6e37f..00000000 --- a/logs2/qemu-amd64-20260615-103843.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:391f8438be7e7d8db94a27aa2206c508310ec96c6d8c445f218ea8bcae2cf026 -size 26759728 diff --git a/logs2/qemu-amd64-20260615-124956.log b/logs2/qemu-amd64-20260615-124956.log deleted file mode 100644 index 9dcdaa58..00000000 --- a/logs2/qemu-amd64-20260615-124956.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e5d57b7581a046460ad6f7916b572f88e908f9f255a9736f7ef64243ceea8d8b -size 1310694 diff --git a/logs2/qemu-amd64-20260615-125017.log b/logs2/qemu-amd64-20260615-125017.log deleted file mode 100644 index b4176e99..00000000 --- a/logs2/qemu-amd64-20260615-125017.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:862d1ae1c84781c78ccd637761c22065a9277d104b3e48a1de18dc648f29b2e8 -size 1220938 diff --git a/logs2/qemu-amd64-20260615-125335.log b/logs2/qemu-amd64-20260615-125335.log deleted file mode 100644 index 1f089ad3..00000000 --- a/logs2/qemu-amd64-20260615-125335.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6206230729075784373806c4e194ae45c46af6dbef4807f1603b40c91d7fd962 -size 26459082 diff --git a/logs2/qemu-amd64-20260615-142839.log b/logs2/qemu-amd64-20260615-142839.log deleted file mode 100644 index 6fa32cc6..00000000 --- a/logs2/qemu-amd64-20260615-142839.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7cdd0225e3eb4516a7cba323664b95aff5f00bb070d207e3e4dc3cffa1fd441b -size 26804029 diff --git a/logs2/qemu-amd64-20260615-161023.log b/logs2/qemu-amd64-20260615-161023.log deleted file mode 100644 index 492cc9bd..00000000 --- a/logs2/qemu-amd64-20260615-161023.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0cd6e72e44a976d342e13c7b20c84a9a25386a29e2ede68facdf1facc5d45b8c -size 26781098 diff --git a/logs2/qemu-amd64-20260615-180252.log b/logs2/qemu-amd64-20260615-180252.log deleted file mode 100644 index 293121b9..00000000 --- a/logs2/qemu-amd64-20260615-180252.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3f60516570b2de42393232c7129e0db94bd02985109b9cff0315c34a5ab8c1f0 -size 1155561 diff --git a/logs2/qemu-amd64-20260615-182339.log b/logs2/qemu-amd64-20260615-182339.log deleted file mode 100644 index e8bde4e7..00000000 --- a/logs2/qemu-amd64-20260615-182339.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04957e8778b0b4160143b83865d21cfc79e0a8d9b97095fb040b1a93a18e68e5 -size 2977576 diff --git a/logs2/qemu-amd64-20260615-182946.log b/logs2/qemu-amd64-20260615-182946.log deleted file mode 100644 index 0e0ee3c8..00000000 --- a/logs2/qemu-amd64-20260615-182946.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39b1c2e88bba99a54b4473eeb1c24281cadea9376a03f575f76386d541bf1dba -size 138597 diff --git a/logs2/qemu-amd64-20260615-183023.log b/logs2/qemu-amd64-20260615-183023.log deleted file mode 100644 index a2ad21ec..00000000 --- a/logs2/qemu-amd64-20260615-183023.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28de2fff2c4e0103afa17e382b11c09587de7634766887f9bd2fb1cbbc1f24b2 -size 26627477 diff --git a/logs2/qemu-amd64-20260615-194545.log b/logs2/qemu-amd64-20260615-194545.log deleted file mode 100644 index 710af523..00000000 --- a/logs2/qemu-amd64-20260615-194545.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ae003125d32ae45ace427117fc72799ca3265e38e22a4bb87c500aba471bddc -size 26619977 diff --git a/logs2/qemu-amd64-20260615-204632.log b/logs2/qemu-amd64-20260615-204632.log deleted file mode 100644 index d23880c1..00000000 --- a/logs2/qemu-amd64-20260615-204632.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a2315ce9165ed63d041be4f69fbfad30ed01bddc156ef34ee8ffac498a21291b -size 26624536 diff --git a/logs2/qemu-amd64-20260615-223531.log b/logs2/qemu-amd64-20260615-223531.log deleted file mode 100644 index e69de29b..00000000 diff --git a/logs2/qemu-amd64-20260615-223607.log b/logs2/qemu-amd64-20260615-223607.log deleted file mode 100644 index 35ff0116..00000000 --- a/logs2/qemu-amd64-20260615-223607.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:74ce1bcfe28e9f9a7dc2b4f2059822b646d668eb87ed8a603eff66c08c888c69 -size 6149285 diff --git a/logs2/qemu-amd64-20260615-230419.log b/logs2/qemu-amd64-20260615-230419.log deleted file mode 100644 index d3e06b9b..00000000 --- a/logs2/qemu-amd64-20260615-230419.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:975395f039c9cf72a8e4345f52eb4ad1b460f12ac9e590aa18a4b28c86f2a1d3 -size 26585196 diff --git a/logs2/qemu-amd64-20260616-001614.log b/logs2/qemu-amd64-20260616-001614.log deleted file mode 100644 index d85fec71..00000000 --- a/logs2/qemu-amd64-20260616-001614.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fdca033d07fb2060c65d6b5fee3d6f0d561be8851a23aa269f574915a599b73a -size 26589065 diff --git a/logs2/qemu-amd64-20260616-011447.log b/logs2/qemu-amd64-20260616-011447.log deleted file mode 100644 index fa1b717f..00000000 --- a/logs2/qemu-amd64-20260616-011447.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8663beb8f2d885ff9230f7a33acd87bec353bc8ab9aae0d6cf9024eec4aba54f -size 26594760 diff --git a/logs2/qemu-amd64-20260616-111913.log b/logs2/qemu-amd64-20260616-111913.log deleted file mode 100644 index a2bb3131..00000000 --- a/logs2/qemu-amd64-20260616-111913.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54e64439fc6838e884e5963c225eaf596e1ef297e4b1e915e0aac0e569269de7 -size 2989365 diff --git a/logs2/qemu-amd64-20260616-154608.log b/logs2/qemu-amd64-20260616-154608.log deleted file mode 100644 index 95c95fa6..00000000 --- a/logs2/qemu-amd64-20260616-154608.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a925f3e693496963a135dd0a26bff73f96b9d52748b7789e1163291ba3d20f61 -size 2979714 diff --git a/logs2/qemu-amd64-20260616-175829.log b/logs2/qemu-amd64-20260616-175829.log deleted file mode 100644 index 6045e214..00000000 --- a/logs2/qemu-amd64-20260616-175829.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:748ec87f38fe3ee754e56f64c2d35d1a1fa52fe9c7363a260431765117c60fc8 -size 454128 diff --git a/logs2/qemu-amd64-20260620-222036.log b/logs2/qemu-amd64-20260620-222036.log deleted file mode 100644 index 7d0d760e..00000000 --- a/logs2/qemu-amd64-20260620-222036.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2d88a222232a42b27d41bef5852ac44351f2a076625b495a2b6c747edda11e7 -size 454888 diff --git a/logs2/qemu-amd64-20260621-002830.log b/logs2/qemu-amd64-20260621-002830.log deleted file mode 100644 index 4cd23e23..00000000 --- a/logs2/qemu-amd64-20260621-002830.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b48635e970f3d19331d075386cd793bbc2069cd073ed962d272970cb1fd290c6 -size 463427 diff --git a/logs2/qemu-amd64-20260621-004710.log b/logs2/qemu-amd64-20260621-004710.log deleted file mode 100644 index f385ef3d..00000000 --- a/logs2/qemu-amd64-20260621-004710.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:60a9c348ace7155d195ad47acabbbfc314fc20b2a353435423f7f0bedc79cd87 -size 463389 diff --git a/logs2/qemu-riscv64-20260609-192223.log b/logs2/qemu-riscv64-20260609-192223.log deleted file mode 100644 index f3f5113a..00000000 --- a/logs2/qemu-riscv64-20260609-192223.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:13265fd92a595a4ecf253c4bb6461d5ae284b31c6565e6d9053d85f38a110082 -size 454533 diff --git a/logs2/qemu-riscv64-20260611-002548.log b/logs2/qemu-riscv64-20260611-002548.log deleted file mode 100644 index 81ed5b7e..00000000 --- a/logs2/qemu-riscv64-20260611-002548.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c3a24074ce39f43c81052c2ce1cddf0794d8ceec07b3195cd96acad9b6d5a7d7 -size 3656 diff --git a/logs2/qemu-riscv64-20260611-003502.log b/logs2/qemu-riscv64-20260611-003502.log deleted file mode 100644 index 5c4fa2a2..00000000 --- a/logs2/qemu-riscv64-20260611-003502.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1982b748e57fe8c302c83fe804e55e6437e505e748405e5c7d32cb7b710b4c3e -size 3656 diff --git a/logs2/qemu-riscv64-20260611-003801.log b/logs2/qemu-riscv64-20260611-003801.log deleted file mode 100644 index 276d9df0..00000000 --- a/logs2/qemu-riscv64-20260611-003801.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5d39b719c48058e3d903bc92d121ac446772f177d05bdbf3a9bfa519e30da119 -size 461796 diff --git a/logs2/qemu-riscv64-20260611-024624.log b/logs2/qemu-riscv64-20260611-024624.log deleted file mode 100644 index e1099f32..00000000 --- a/logs2/qemu-riscv64-20260611-024624.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3a8ad9c1bb22efb837c9a7b9646832a688cca6710177155f3ee7a8f4c96699ea -size 5246437 diff --git a/logs2/qemu-riscv64-20260611-173903.log b/logs2/qemu-riscv64-20260611-173903.log deleted file mode 100644 index 19d4411f..00000000 --- a/logs2/qemu-riscv64-20260611-173903.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e3bbd31797d0b4ad4f22622f4c15c9b2e4f2a0b68841b540a775d0ac1d6ea8d -size 2869662 diff --git a/logs2/qemu-riscv64-20260611-175348.log b/logs2/qemu-riscv64-20260611-175348.log deleted file mode 100644 index 472e8a1a..00000000 --- a/logs2/qemu-riscv64-20260611-175348.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b6379b501b237f23888354d49f01775a6361162af5c6cc3252a721ac4a1db1c4 -size 453754 diff --git a/logs2/qemu-riscv64-20260611-191335.log b/logs2/qemu-riscv64-20260611-191335.log deleted file mode 100644 index be5a74fb..00000000 --- a/logs2/qemu-riscv64-20260611-191335.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:424044bf92ab72748724fe3432e7cf09720cf64834dc0c9d4502b9daf0b18fd5 -size 24461243 diff --git a/logs2/qemu-riscv64-20260611-203104.log b/logs2/qemu-riscv64-20260611-203104.log deleted file mode 100644 index f39af689..00000000 --- a/logs2/qemu-riscv64-20260611-203104.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdc8f152b9c1216ebfc5aaa3bddeefe53462485de887ba2bbc0109554905e0af -size 2869665 diff --git a/logs2/qemu-riscv64-20260612-135612.log b/logs2/qemu-riscv64-20260612-135612.log deleted file mode 100644 index 12487e24..00000000 --- a/logs2/qemu-riscv64-20260612-135612.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a6ba3e43f91ef13cbafe6d288930d2e7a9d1a065421403f6b12ed50ec9fbf489 -size 24461719 diff --git a/logs2/qemu-riscv64-20260612-141129.log b/logs2/qemu-riscv64-20260612-141129.log deleted file mode 100644 index 06ced14b..00000000 --- a/logs2/qemu-riscv64-20260612-141129.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fedc2623db6780b04521c478657f700f7eb6d5d2d46d86d718f602bbc8ba98d9 -size 24487550 diff --git a/logs2/qemu-riscv64-20260612-174414.log b/logs2/qemu-riscv64-20260612-174414.log deleted file mode 100644 index be3f2930..00000000 --- a/logs2/qemu-riscv64-20260612-174414.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:672ec58e1c3395a7c2ecd3324ff3772699b6423737576e37ce9fa651b6cb10cc -size 24470192 diff --git a/logs2/qemu-riscv64-20260614-164140.log b/logs2/qemu-riscv64-20260614-164140.log deleted file mode 100644 index 1f4d81c6..00000000 --- a/logs2/qemu-riscv64-20260614-164140.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:68de4275e8a5d79d049870690cb6ae80872a619176a724ff26189d27e2e43951 -size 3478 diff --git a/logs2/qemu-riscv64-20260614-165900.log b/logs2/qemu-riscv64-20260614-165900.log deleted file mode 100644 index ea6c6cf0..00000000 --- a/logs2/qemu-riscv64-20260614-165900.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8e09f737f70ee5d08d85c4548cef334215b30c31d1b51938913eaa1737414a70 -size 3484 diff --git a/logs2/qemu-riscv64-20260614-170926.log b/logs2/qemu-riscv64-20260614-170926.log deleted file mode 100644 index c5aca9dd..00000000 --- a/logs2/qemu-riscv64-20260614-170926.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7bda12cfc05493e20f42ebba91e207d0ae1ae8190035f352617ebd59ac127f3f -size 4746 diff --git a/logs2/qemu-riscv64-20260614-171955.log b/logs2/qemu-riscv64-20260614-171955.log deleted file mode 100644 index 8de4f3ef..00000000 --- a/logs2/qemu-riscv64-20260614-171955.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a16185d8e5cdcb302637af85b6c8a66d73cbd7c8f983aba88cb73981957d02a0 -size 454514 diff --git a/logs2/qemu-riscv64-20260614-182235.log b/logs2/qemu-riscv64-20260614-182235.log deleted file mode 100644 index fa8d972a..00000000 --- a/logs2/qemu-riscv64-20260614-182235.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e545d0827cff65a7f125590a27583a163f248b484b0a333d3015cdd826db0b5f -size 455326 diff --git a/logs2/qemu-riscv64-20260614-190152.log b/logs2/qemu-riscv64-20260614-190152.log deleted file mode 100644 index 1cfdb783..00000000 --- a/logs2/qemu-riscv64-20260614-190152.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:94f39f57529b464ae62455f9df5d204b2fcb2a4b0f72efbd5b77d3d05681c064 -size 455396 diff --git a/logs2/qemu-riscv64-20260614-230220.log b/logs2/qemu-riscv64-20260614-230220.log deleted file mode 100644 index 308170f4..00000000 --- a/logs2/qemu-riscv64-20260614-230220.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9252d099af5aae9ba861e96f4e28b52ed6acf1b36714883f5dc4b721084a3d4 -size 24721249 diff --git a/logs2/qemu-riscv64-20260615-004335.log b/logs2/qemu-riscv64-20260615-004335.log deleted file mode 100644 index 01f0508d..00000000 --- a/logs2/qemu-riscv64-20260615-004335.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e266bf0ab69591c30071e90b59eb4f2394e7c75c54897a2ac78e4b1a78610cc -size 24715944 diff --git a/logs2/qemu-riscv64-20260615-004822.log b/logs2/qemu-riscv64-20260615-004822.log deleted file mode 100644 index 0ad56fcc..00000000 --- a/logs2/qemu-riscv64-20260615-004822.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afa30fafd39d23078b484fd0a876e706307800c7e894a8e466595a1d58f856bd -size 24742087 diff --git a/logs2/qemu-riscv64-20260615-031059.log b/logs2/qemu-riscv64-20260615-031059.log deleted file mode 100644 index 209a8aaa..00000000 --- a/logs2/qemu-riscv64-20260615-031059.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b54e988ed8fff287a1ea4f2f6390a8ddf9bf1f08c7cb4a2f690d13a3039fc66b -size 24726338 diff --git a/logs2/qemu-riscv64-20260615-103741.log b/logs2/qemu-riscv64-20260615-103741.log deleted file mode 100644 index c199af61..00000000 --- a/logs2/qemu-riscv64-20260615-103741.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:889f022a9a9b4f835d8b1cb3b9a31aaf63982f43e871b569fec347a61ceea121 -size 455449 diff --git a/logs2/qemu-riscv64-20260615-122026.log b/logs2/qemu-riscv64-20260615-122026.log deleted file mode 100644 index 23990740..00000000 --- a/logs2/qemu-riscv64-20260615-122026.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba68fb8c137c5db04ee89d8355a18dbccaf6cc533fc65f558ad339194aa2c69d -size 40469576 diff --git a/logs2/qemu-riscv64-20260615-122930.log b/logs2/qemu-riscv64-20260615-122930.log deleted file mode 100644 index d21ea928..00000000 --- a/logs2/qemu-riscv64-20260615-122930.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8cdaafbdc7baae96e6cc5e6f8f0522ee4dbef2a02692c6c3fc88bf276290bbf1 -size 40707313 diff --git a/logs2/qemu-riscv64-20260615-174420.log b/logs2/qemu-riscv64-20260615-174420.log deleted file mode 100644 index 3e92765a..00000000 --- a/logs2/qemu-riscv64-20260615-174420.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8de0e7cfbdbe9f1b764778019095962bdb83961c18da79ec77c4bd12fce9f67 -size 40970797 diff --git a/logs2/qemu-riscv64-20260615-183017.log b/logs2/qemu-riscv64-20260615-183017.log deleted file mode 100644 index 35eadadf..00000000 --- a/logs2/qemu-riscv64-20260615-183017.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f7093abe9e9ebca406ca4ee0f13ab0c44c1aab6dd362162422c450c934866dd3 -size 454565 diff --git a/logs2/qemu-riscv64-20260615-193223.log b/logs2/qemu-riscv64-20260615-193223.log deleted file mode 100644 index 58e23cf5..00000000 --- a/logs2/qemu-riscv64-20260615-193223.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ab2d39c04e76e34ad66606adfb5cba94edad5f4268fe221f4186e02e90cf4b9 -size 25739252 diff --git a/logs2/qemu-riscv64-20260615-193711.log b/logs2/qemu-riscv64-20260615-193711.log deleted file mode 100644 index 8b2add39..00000000 --- a/logs2/qemu-riscv64-20260615-193711.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a92d3d9d1dea81945339edfde95ea96fafd671adee5aff4fdcc5780956dc694 -size 25753142 diff --git a/logs2/qemu-riscv64-20260615-214335.log b/logs2/qemu-riscv64-20260615-214335.log deleted file mode 100644 index 544abeca..00000000 --- a/logs2/qemu-riscv64-20260615-214335.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f3fb8b4c9e3cd3d4c93c9a8edd5ff127f8c493bdc399f8daa90df213e62af36e -size 25766622 diff --git a/logs2/qemu-riscv64-20260615-223550.log b/logs2/qemu-riscv64-20260615-223550.log deleted file mode 100644 index 4273f514..00000000 --- a/logs2/qemu-riscv64-20260615-223550.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f12ca988cc5b7df213b9bc36d1ced1a3b972f26b6a6e5cb8c09ac585494a6727 -size 456148 diff --git a/logs2/qemu-riscv64-20260616-000114.log b/logs2/qemu-riscv64-20260616-000114.log deleted file mode 100644 index c8514038..00000000 --- a/logs2/qemu-riscv64-20260616-000114.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:583e5a555c3c47d551b5c310cd0efe7156b8510d40c6144da379a60f7b42adf0 -size 24732863 diff --git a/logs2/qemu-riscv64-20260616-000522.log b/logs2/qemu-riscv64-20260616-000522.log deleted file mode 100644 index 56e055d7..00000000 --- a/logs2/qemu-riscv64-20260616-000522.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:20003eacea2508d339b62eb1283943212bc1053424e2ccaea9cb6c7fde94bd9c -size 24740552 diff --git a/logs2/qemu-riscv64-20260616-021123.log b/logs2/qemu-riscv64-20260616-021123.log deleted file mode 100644 index 49c2f30f..00000000 --- a/logs2/qemu-riscv64-20260616-021123.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22833409d3f85b78bfdd04dabff0178009ebdefea664c021c91940035fa5fe6f -size 24738045 diff --git a/logs2/qemu-riscv64-20260616-113103.log b/logs2/qemu-riscv64-20260616-113103.log deleted file mode 100644 index 0acf79db..00000000 --- a/logs2/qemu-riscv64-20260616-113103.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8afb3224c857e35b36a733406c5582f0725b274d767e5c0755cd4a2d15e0a3c -size 2871138 diff --git a/logs2/qemu-riscv64-20260616-155324.log b/logs2/qemu-riscv64-20260616-155324.log deleted file mode 100644 index 35f42dad..00000000 --- a/logs2/qemu-riscv64-20260616-155324.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ea73709d6cb5d9dd2c6917832a0f584a71a97aae402706a1d2ca542c3a3cc13 -size 2870243 diff --git a/logs2/qemu-riscv64-20260616-175915.log b/logs2/qemu-riscv64-20260616-175915.log deleted file mode 100644 index 57df4bc8..00000000 --- a/logs2/qemu-riscv64-20260616-175915.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d9b5fcaf0a7fc241170023df5cf64052b569eb43848b262d3fe3446925b6728 -size 456125 diff --git a/logs2/qemu-riscv64-20260620-231806.log b/logs2/qemu-riscv64-20260620-231806.log deleted file mode 100644 index e56f120b..00000000 --- a/logs2/qemu-riscv64-20260620-231806.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a5d8473c973399578f544e0570190d1ecf4b168a71ed9825338f071059d02334 -size 456336 diff --git a/logs2/qemu-riscv64-20260621-004843.log b/logs2/qemu-riscv64-20260621-004843.log deleted file mode 100644 index 57c4b485..00000000 --- a/logs2/qemu-riscv64-20260621-004843.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8094140433a197527fe5c462cb5d386f04d3acef87a1e690d8faf93b433ec45b -size 464944 diff --git a/logs2/qemu-screenshot-20260609-105458.png b/logs2/qemu-screenshot-20260609-105458.png deleted file mode 100644 index 47ebf099..00000000 Binary files a/logs2/qemu-screenshot-20260609-105458.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-130717.png b/logs2/qemu-screenshot-20260609-130717.png deleted file mode 100644 index 88526cc4..00000000 Binary files a/logs2/qemu-screenshot-20260609-130717.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-181200.png b/logs2/qemu-screenshot-20260609-181200.png deleted file mode 100644 index 46748d8b..00000000 Binary files a/logs2/qemu-screenshot-20260609-181200.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-193724.log b/logs2/qemu-screenshot-20260609-193724.log deleted file mode 100644 index 58987244..00000000 --- a/logs2/qemu-screenshot-20260609-193724.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c9c87048a095a22f62092b734a48c0b27e41946f433f023132b6bae3dbda3ac8 -size 452582 diff --git a/logs2/qemu-screenshot-20260609-193724.png b/logs2/qemu-screenshot-20260609-193724.png deleted file mode 100644 index c0fa4639..00000000 Binary files a/logs2/qemu-screenshot-20260609-193724.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-194549.png b/logs2/qemu-screenshot-20260609-194549.png deleted file mode 100644 index 57bba522..00000000 Binary files a/logs2/qemu-screenshot-20260609-194549.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-194812.png b/logs2/qemu-screenshot-20260609-194812.png deleted file mode 100644 index 0397151d..00000000 Binary files a/logs2/qemu-screenshot-20260609-194812.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-222537.png b/logs2/qemu-screenshot-20260609-222537.png deleted file mode 100644 index fd5705ac..00000000 Binary files a/logs2/qemu-screenshot-20260609-222537.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-225958.png b/logs2/qemu-screenshot-20260609-225958.png deleted file mode 100644 index 81a4b0d4..00000000 Binary files a/logs2/qemu-screenshot-20260609-225958.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260609-232904.png b/logs2/qemu-screenshot-20260609-232904.png deleted file mode 100644 index 8a1a841f..00000000 Binary files a/logs2/qemu-screenshot-20260609-232904.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260610-005734.png b/logs2/qemu-screenshot-20260610-005734.png deleted file mode 100644 index e9be55f6..00000000 Binary files a/logs2/qemu-screenshot-20260610-005734.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260610-134732.png b/logs2/qemu-screenshot-20260610-134732.png deleted file mode 100644 index c15cfc8e..00000000 Binary files a/logs2/qemu-screenshot-20260610-134732.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260610-145902.png b/logs2/qemu-screenshot-20260610-145902.png deleted file mode 100644 index 94f3cf5d..00000000 Binary files a/logs2/qemu-screenshot-20260610-145902.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260610-213714.png b/logs2/qemu-screenshot-20260610-213714.png deleted file mode 100644 index f4694fbc..00000000 Binary files a/logs2/qemu-screenshot-20260610-213714.png and /dev/null differ diff --git a/logs2/qemu-screenshot-20260611-002306.log b/logs2/qemu-screenshot-20260611-002306.log deleted file mode 100644 index aff53f54..00000000 --- a/logs2/qemu-screenshot-20260611-002306.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:199e9f695072ae75c77b893a73b6a7382fe94782bc78e1f32bdb67b9e97400ae -size 459201 diff --git a/logs2/qemu-screenshot-20260611-004156.log b/logs2/qemu-screenshot-20260611-004156.log deleted file mode 100644 index 7affce54..00000000 --- a/logs2/qemu-screenshot-20260611-004156.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba128e200b7f3d691f1eeae1a924f37522f7ee162041716f383eef2b4d57af30 -size 459018 diff --git a/logs2/qemu-screenshot-20260611-012817.log b/logs2/qemu-screenshot-20260611-012817.log deleted file mode 100644 index 2347d6e7..00000000 --- a/logs2/qemu-screenshot-20260611-012817.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0712969ca14c5963b7499d5afa4252578f1fe78131f1a17fe405122c88895b08 -size 25304214 diff --git a/logs2/qemu-screenshot-20260611-023758.log b/logs2/qemu-screenshot-20260611-023758.log deleted file mode 100644 index 42970cdc..00000000 --- a/logs2/qemu-screenshot-20260611-023758.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7714a174fbb9793b69d1898fa5ac98ef9bcb6d48ec38cdea3c3a90e00f6f1565 -size 604233 diff --git a/logs2/qemu-screenshot-20260611-024401.log b/logs2/qemu-screenshot-20260611-024401.log deleted file mode 100644 index 7209e51f..00000000 --- a/logs2/qemu-screenshot-20260611-024401.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bebab938202d4aa165b10f57995cadf09381f0fccf7ec076fb9f3feb4f42d76a -size 2866250 diff --git a/logs2/qemu-screenshot-20260611-173657.log b/logs2/qemu-screenshot-20260611-173657.log deleted file mode 100644 index c60e60bd..00000000 --- a/logs2/qemu-screenshot-20260611-173657.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c06d0476ea2356dce906c9d5fb6fb92bdd63d40449bef71fc56e4cf2e38c67c -size 452560 diff --git a/logs2/qemu-screenshot-20260611-174914.log b/logs2/qemu-screenshot-20260611-174914.log deleted file mode 100644 index 68fb3be5..00000000 --- a/logs2/qemu-screenshot-20260611-174914.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fa5498124fe32dfafdebf6357953bf0c984302be801c3de8a5892a5716212ac8 -size 452631 diff --git a/logs2/qemu-screenshot-20260611-175224.log b/logs2/qemu-screenshot-20260611-175224.log deleted file mode 100644 index 6ae2e0a1..00000000 --- a/logs2/qemu-screenshot-20260611-175224.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cee76955a92b5cb596c9b151127800e39a3e27014566c564c35938f4edee0abb -size 452264 diff --git a/logs2/qemu-screenshot-20260611-190757.log b/logs2/qemu-screenshot-20260611-190757.log deleted file mode 100644 index 8676f52f..00000000 --- a/logs2/qemu-screenshot-20260611-190757.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ccd417963fa0ba7df6837e024585f7cde5fd9d9590731566415396b40bab786a -size 452625 diff --git a/logs2/qemu-screenshot-20260611-202932.log b/logs2/qemu-screenshot-20260611-202932.log deleted file mode 100644 index 4318c6eb..00000000 --- a/logs2/qemu-screenshot-20260611-202932.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39778c1b2c0305f5cca9a5721f32e6acfc62cc1061a045b211231e4ca984a81f -size 452591 diff --git a/logs2/qemu-screenshot-20260612-115354.log b/logs2/qemu-screenshot-20260612-115354.log deleted file mode 100644 index d2677734..00000000 --- a/logs2/qemu-screenshot-20260612-115354.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70965feaf792b1c68be9ad045ab3927fb19761a6fb094cdd17b08fa737287e51 -size 450345 diff --git a/logs2/qemu-screenshot-20260612-160054.log b/logs2/qemu-screenshot-20260612-160054.log deleted file mode 100644 index 8ee35b46..00000000 --- a/logs2/qemu-screenshot-20260612-160054.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab2fb5c928eccdaf8ffe880b56cc58e1d48b5c8cc1432ee86acf3c1716a226d0 -size 452714 diff --git a/logs2/qemu-screenshot-20260612-174331.log b/logs2/qemu-screenshot-20260612-174331.log deleted file mode 100644 index 93393887..00000000 --- a/logs2/qemu-screenshot-20260612-174331.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bfb85553d48568163408c013ad76dfe3d6b2ef633517a3bbcd0dc1366f0d5c78 -size 452712 diff --git a/logs2/qemu-screenshot-20260614-163902.log b/logs2/qemu-screenshot-20260614-163902.log deleted file mode 100644 index 7968ffa0..00000000 --- a/logs2/qemu-screenshot-20260614-163902.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9cfedb98dd49805599db38c2d8f7d974399c2adc4f18719d2514148369ad8d9c -size 452394 diff --git a/logs2/qemu-screenshot-20260614-182044.log b/logs2/qemu-screenshot-20260614-182044.log deleted file mode 100644 index e69de29b..00000000 diff --git a/logs2/qemu-screenshot-20260614-182127.log b/logs2/qemu-screenshot-20260614-182127.log deleted file mode 100644 index 89d3a041..00000000 --- a/logs2/qemu-screenshot-20260614-182127.log +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1105c2be14434743bc2ab87c17e362523c02be36ea29beaa2d66d49bcce1d076 -size 453849 diff --git a/mk/Kconfig.mk b/mk/Kconfig.mk index 4d2bfc08..a5575e78 100644 --- a/mk/Kconfig.mk +++ b/mk/Kconfig.mk @@ -1,5 +1,5 @@ # ============================================================================== -# mk/Kconfig.mk — shared Kconfig bridge for Makefile and Makefile.starkernel +# mk/Kconfig.mk — shared Kconfig bridge for Makefile and kernel/Makefile # ============================================================================== # # Included by both build systems, after each has finished resolving its own @@ -101,7 +101,7 @@ savedefconfig: $(KCONFIG_CONF) # dispatching any -jN jobs" behavior fully serializes "regenerate config" # before "compile anything" -- for free, with no hand-maintained # prerequisite list. Deliberately not the include/version.h-style -# order-only pattern (Makefile.starkernel:49-53/656-658), which needed its +# order-only pattern (kernel/Makefile:49-53/656-658), which needed its # own special-cased -j/clean workaround once already. # # Guarded on the config file already existing: until a developer opts in via diff --git a/mk/README.md b/mk/README.md index 98155bfe..74fd285f 100644 --- a/mk/README.md +++ b/mk/README.md @@ -1,7 +1,7 @@ # mk/ - `Kconfig.mk` — shared Kconfig bridge included by both `Makefile` and - `Makefile.starkernel`. Each Makefile canonicalizes its own `ARCH` and + `kernel/Makefile`. Each Makefile canonicalizes its own `ARCH` and sets `KCONFIG_ARCH_DIR` before including this file, since the hosted and kernel builds map `aarch64` to different object-directory names. Config lives per-architecture under `build/$(KCONFIG_ARCH_DIR)/` rather diff --git a/scripts/mkdiskimage.sh b/scripts/mkdiskimage.sh new file mode 100644 index 00000000..f0bb89c7 --- /dev/null +++ b/scripts/mkdiskimage.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# mkdiskimage.sh -- build a single-partition FAT32 boot disk image. +# +# Used by `make boot_image TARGET=` (kernel/Makefile). One script for +# every board so the geometry rules live in one place: +# - partition 1 starts at 1 MiB (sector 2048) and runs to the last usable +# sector; the FAT32 filesystem is sized to the partition exactly (a +# larger filesystem overruns the partition -- the bug that made early +# SER5 thumbdrive images unbootable, see kernel/Makefile `thumbdrive`); +# - GPT tables reserve 33 sectors at the end of the disk for the backup +# header, MBR tables do not. +# +# Usage: +# mkdiskimage.sh --out IMG --table gpt|mbr --size-mib N --label LABEL \ +# SRC:DEST [SRC:DEST ...] +# +# --table gpt -> partition type "EFI System" (UEFI firmware, U-Boot bootefi) +# --table mbr -> partition type 0x0c FAT32 (LBA) (Raspberry Pi firmware) +# DEST is an absolute path inside the FAT filesystem; parent directories are +# created as needed. +# +# Needs only sfdisk (util-linux), mkfs.fat (dosfstools) and mtools -- no +# root, no loop devices. +set -euo pipefail + +OUT="" TABLE="" SIZE_MIB="" LABEL="" +while [ $# -gt 0 ]; do + case "$1" in + --out) OUT="$2"; shift 2 ;; + --table) TABLE="$2"; shift 2 ;; + --size-mib) SIZE_MIB="$2"; shift 2 ;; + --label) LABEL="$2"; shift 2 ;; + --) shift; break ;; + -*) echo "mkdiskimage.sh: unknown option $1" >&2; exit 2 ;; + *) break ;; + esac +done + +[ -n "$OUT" ] && [ -n "$TABLE" ] && [ -n "$SIZE_MIB" ] && [ -n "$LABEL" ] || { + echo "mkdiskimage.sh: --out, --table, --size-mib and --label are required" >&2; exit 2; } +[ $# -gt 0 ] || { echo "mkdiskimage.sh: no SRC:DEST files given" >&2; exit 2; } + +for tool in sfdisk mkfs.fat mmd mcopy; do + command -v "$tool" >/dev/null 2>&1 || PATH="$PATH:/usr/sbin:/sbin" + command -v "$tool" >/dev/null 2>&1 || { + echo "mkdiskimage.sh: $tool not found (install util-linux, dosfstools, mtools)" >&2; exit 1; } +done + +TOTAL_SECTORS=$(( SIZE_MIB * 2048 )) +START=2048 +case "$TABLE" in + gpt) LAST=$(( TOTAL_SECTORS - 34 )); PTYPE="C12A7328-F81F-11D2-BA4B-00A0C93EC93B" ;; + mbr) LAST=$(( TOTAL_SECTORS - 1 )); PTYPE="c" ;; + *) echo "mkdiskimage.sh: --table must be gpt or mbr" >&2; exit 2 ;; +esac +PART_SECTORS=$(( LAST - START + 1 )) + +ESP="$OUT.part1" +rm -f "$OUT" "$ESP" +mkdir -p "$(dirname "$OUT")" + +truncate -s $(( TOTAL_SECTORS * 512 )) "$OUT" +if [ "$TABLE" = gpt ]; then + printf 'label: gpt\nstart=%d, size=%d, type=%s, name="EFI System"\n' \ + "$START" "$PART_SECTORS" "$PTYPE" | sfdisk --quiet "$OUT" +else + printf 'label: dos\nstart=%d, size=%d, type=%s, bootable\n' \ + "$START" "$PART_SECTORS" "$PTYPE" | sfdisk --quiet "$OUT" +fi + +truncate -s $(( PART_SECTORS * 512 )) "$ESP" +mkfs.fat -F 32 -n "$LABEL" "$ESP" >/dev/null + +for spec in "$@"; do + src="${spec%%:*}" + dest="${spec#*:}" + [ -f "$src" ] || { echo "mkdiskimage.sh: missing input $src" >&2; rm -f "$OUT" "$ESP"; exit 1; } + dir="$(dirname "$dest")" + path="" + IFS=/ read -r -a parts <<< "${dir#/}" + for p in "${parts[@]}"; do + [ -n "$p" ] || continue + path="$path/$p" + mmd -D s -i "$ESP" "::$path" 2>/dev/null || true + done + mcopy -o -i "$ESP" "$src" "::$dest" +done + +dd if="$ESP" of="$OUT" bs=512 seek="$START" conv=notrunc status=none +rm -f "$ESP" +echo " IMAGE $OUT ($TABLE, ${SIZE_MIB} MiB, FAT32 '$LABEL')" diff --git a/scripts/perf-profile.sh b/scripts/perf-profile.sh index 4953aee7..c38c489d 100755 --- a/scripts/perf-profile.sh +++ b/scripts/perf-profile.sh @@ -50,7 +50,7 @@ ARGS=(--log-error --run-tests) # We need to run specific control word tests echo "[CLEAN]"; make clean echo "[BUILD performance w/ symbols for profiling]" -make CFLAGS="-std=c99 -O3 -g -fno-omit-frame-pointer -DSTARFORTH_PERFORMANCE -DNDEBUG -march=native -Wall -Werror -Iinclude -Isrc/word_source -Isrc/test_runner/include -DSTRICT_PTR=1" LDFLAGS="" +make -f v3/Makefile CFLAGS="-std=c99 -O3 -g -fno-omit-frame-pointer -DSTARFORTH_PERFORMANCE -DNDEBUG -march=native -Wall -Werror -Iv3/include -Ikernel/include -Iv3/src/word_source -Iv3/src/test_runner/include -DSTRICT_PTR=1" LDFLAGS="" [[ -x "$EXE" ]] || { echo "ERROR: $EXE missing/not executable"; exit 2; } diff --git a/scripts/perf-profile_control.sh b/scripts/perf-profile_control.sh index bc685855..7d6874e5 100755 --- a/scripts/perf-profile_control.sh +++ b/scripts/perf-profile_control.sh @@ -48,7 +48,7 @@ set -euo pipefail EXE="./build/starforth" echo "[CLEAN]"; make clean echo "[BUILD for control words profiling]" -make CFLAGS="-std=c99 -O3 -g -fno-omit-frame-pointer -DSTARFORTH_PERFORMANCE -DNDEBUG -march=native -Wall -Werror -Iinclude -Isrc/word_source -Isrc/test_runner/include -DSTRICT_PTR=1" LDFLAGS="" +make -f v3/Makefile CFLAGS="-std=c99 -O3 -g -fno-omit-frame-pointer -DSTARFORTH_PERFORMANCE -DNDEBUG -march=native -Wall -Werror -Iv3/include -Ikernel/include -Iv3/src/word_source -Iv3/src/test_runner/include -DSTRICT_PTR=1" LDFLAGS="" [[ -x "$EXE" ]] || { echo "ERROR: $EXE missing/not executable"; exit 2; } diff --git a/scripts/remove_loop_conditionals.sh b/scripts/remove_loop_conditionals.sh index 50c9e6bb..7070b0a0 100755 --- a/scripts/remove_loop_conditionals.sh +++ b/scripts/remove_loop_conditionals.sh @@ -50,9 +50,9 @@ echo "Removing ENABLE_LOOP conditional compilation directives..." # Files to process FILES=( - "src/vm.c" - "src/inference_engine.c" - "src/doe_metrics.c" + "v3/src/vm.c" + "v3/src/inference_engine.c" + "v3/src/doe_metrics.c" ) for file in "${FILES[@]}"; do diff --git a/tools/README.md b/tools/README.md index 2799879f..272fdd21 100644 --- a/tools/README.md +++ b/tools/README.md @@ -7,7 +7,7 @@ toolchain. | File | Purpose | |------|---------| -| `mkcapsule.c` | Assembles `.4th` capsule files into `capsule_generated.c` baked into the kernel image. Invoked automatically by `Makefile.starkernel`. | +| `mkcapsule.c` | Assembles `.4th` capsule files into `capsule_generated.c` baked into the kernel image. Invoked automatically by `kernel/Makefile`. | | `mkcapsule` | Compiled host binary (rebuilt on demand). | | `ttftest.c` | Host TTF glyph-rendering test — font rasterization unit tests, no QEMU needed. | | `pe_reloc_gen.py` | Generates PE32+ relocation tables for the UEFI loader. | @@ -21,7 +21,7 @@ toolchain. ```bash # Invoked automatically by the kernel build: -make -f Makefile.starkernel ARCH=amd64 clean qemu +make -f kernel/Makefile ARCH=amd64 clean qemu # Manual invocation (for inspection): ./tools/mkcapsule capsules/ build/amd64/kernel/capsule_generated.c @@ -33,5 +33,5 @@ type `(m)` to `init.4th` and `(p)` to everything else. ## See also - [`capsules/README.md`](../capsules/README.md) — capsule file format and block namespace -- [`Makefile.starkernel`](../Makefile.starkernel) — kernel build system +- [`kernel/Makefile`](../kernel/Makefile) — kernel build system - [Project root](../README.md) diff --git a/tools/ttftest.c b/tools/ttftest.c index 756298b3..ed93aabc 100644 --- a/tools/ttftest.c +++ b/tools/ttftest.c @@ -25,7 +25,7 @@ #include #include -#include "../include/starkernel/ttf.h" +#include "../kernel/include/starkernel/ttf.h" typedef struct { uint32_t codepoint; diff --git a/v3/Makefile b/v3/Makefile new file mode 100644 index 00000000..930d6253 --- /dev/null +++ b/v3/Makefile @@ -0,0 +1,1340 @@ +# ============================================================================== +# StarForth Build System - The Fastest Forth in the West! +# ============================================================================== +# +# Quick Start: +# make - Standard optimized build (auto ARCH, TARGET=standard) +# make TARGET=fastest - Maximum performance build +# make ARCH=arm64 TARGET=fastest - Build for arm64 (e.g., Raspberry Pi 4) +# make help - Show all available targets +# +# ============================================================================== + +# ============================================================================== +# CONFIGURATION +# ============================================================================== + +VERSION ?= 3.2.0 +CC = gcc + +# Isabelle configuration +# NOTE: Isabelle must be installed separately and available on PATH +# See docs/DEVELOPER.md for installation instructions +ISABELLE ?= isabelle + +# Architecture / target selection +ARCH ?= $(shell uname -m) +ARCH := $(strip $(ARCH)) +TARGET ?= standard +TARGET := $(strip $(TARGET)) + +# Friendly guardrail: 32-bit builds are not supported +unsupported_32bit_arches := i386 i486 i586 i686 x86 armv6 armv7 armv7l arm +ifneq ($(filter $(ARCH),$(unsupported_32bit_arches)),) + $(error StarForth targets 64-bit platforms only. ARCH='$(ARCH)' is unsupported. Please build on amd64/arm64/raspi/riscv64.) +endif + +# Canonical architecture normalization (x86_64→amd64, aarch64→arm64, etc.) +canon_arch = $(strip $(if $(filter x86_64,$1),amd64,$(if $(filter amd64,$1),amd64,$(if $(filter aarch64 arm64,$1),arm64,$(if $(filter riscv riscv64,$1),riscv64,$1))))) +ARCH_DIR := $(call canon_arch,$(ARCH)) +# Normalize ARCH for consistent ifeq matching +ARCH := $(call canon_arch,$(ARCH)) + +# Kconfig bridge (menuconfig/xconfig/config/oldconfig/*_defconfig). See +# mk/Kconfig.mk for why KCONFIG_ARCH_DIR must be set here, before include. +# .DEFAULT_GOAL is pinned explicitly because mk/Kconfig.mk's first rule +# would otherwise silently become Make's default goal, since it's included +# before this Makefile's own `all:` target is defined below. +.DEFAULT_GOAL := all +KCONFIG_ARCH_DIR := $(ARCH_DIR) +include mk/Kconfig.mk + +# Kconfig platform-mode choice (Phase 5): PLATFORM_DEFAULT/PLATFORM_MINIMAL +# in Kconfig.variant (PLATFORM_L4RE removed -- L4Re support is historical, +# see the "Platform support" section below). Must run this early -- before +# anything below that branches on MINIMAL -- since Make evaluates a Makefile +# top-to-bottom and a variable's value at the point an `ifdef` is reached is +# whatever it resolved to *so far*, not its final value. Only applies when a +# developer hasn't already set MINIMAL explicitly (command line or +# environment) -- `ifdef` in the "Platform support" section below cares +# about definedness, not value, so this can't reuse the kconfig_bool/ +# kconfig_int pattern (those always define their target variable once +# active). Checked with $(origin ...) so an explicit `make MINIMAL=1` (or +# unset) always wins over whatever .config says. +ifeq ($(KCONFIG_ACTIVE),1) +ifeq ($(origin MINIMAL),undefined) +ifeq ($(CONFIG_PLATFORM_MINIMAL),y) +MINIMAL := 1 +endif +endif +endif + +ifeq ($(ARCH),amd64) + ARCH_NAME = x86_64 + ARCH_FLAGS = -march=native + ARCH_DEFINES = -DARCH_X86_64=1 + ASM_SYNTAX = -masm=intel +else ifeq ($(ARCH),arm64) + ARCH_NAME = ARM64 + ARCH_FLAGS = -march=armv8-a+crc+simd -mtune=cortex-a72 + ARCH_DEFINES = -DARCH_ARM64=1 + ASM_SYNTAX = +else ifeq ($(ARCH),raspi) + ARCH_NAME = Raspberry Pi 4 (ARM64) + ARCH_FLAGS = -march=armv8-a+crc+simd -mtune=cortex-a72 + ARCH_DEFINES = -DARCH_ARM64=1 -DRASPBERRY_PI_BUILD=1 + ASM_SYNTAX = +else ifeq ($(ARCH),riscv64) + ARCH_NAME = RISC-V 64 (QEMU) + ARCH_FLAGS = -march=rv64gc -mabi=lp64d -mcmodel=medany + ARCH_DEFINES = -DARCH_RISCV64=1 + ASM_SYNTAX = +else ifeq ($(ARCH),riscv) + ARCH_NAME = RISC-V 64 (QEMU) + ARCH_FLAGS = -march=rv64gc -mabi=lp64d -mcmodel=medany + ARCH_DEFINES = -DARCH_RISCV64=1 + ASM_SYNTAX = +else + $(warning Unknown architecture: $(ARCH), using generic flags) + ARCH_NAME = generic + ARCH_FLAGS = + ARCH_DEFINES = + ASM_SYNTAX = +endif + +# Compiler flags +# Feature switches (default: enabled) +# Physics/SSM knob family: repointed through the Kconfig bridge (see +# mk/Kconfig.mk's kconfig_bool/kconfig_int) as of the Kconfig migration's +# Phase 3. Each call below is a drop-in replacement for a bare `?=`: when +# no build/$(ARCH)/.config exists (KCONFIG_ACTIVE unset), it's exactly +# `VAR ?= default`, identical to before; once a .config exists, the +# Kconfig-fed value takes over. `make VAR=x` on the command line always +# wins regardless of which branch fires. +# +# STRICT_PTR: VM memory bounds checking on every pointer access +# Default: 1 (enabled). Disable only for raw benchmarking comparisons. +$(eval $(call kconfig_bool,STRICT_PTR,1)) + +# ENABLE_HOTWORDS_CACHE: Physics-driven hot-words cache (1.78× speedup on dictionary lookups) +# Default: 1 (enabled - experiments show cache is optimal) +# Set ENABLE_HOTWORDS_CACHE=0 to disable (for research comparison only) +$(eval $(call kconfig_bool,ENABLE_HOTWORDS_CACHE,0)) + +# ENABLE_PIPELINING: Speculative execution via word transition prediction +# Default: 1 (enabled - experiments show pipelining is optimal) +# Set ENABLE_PIPELINING=0 to disable (for research comparison only) +# NOTE: As of 2025-11-19, all future experiments use both cache and pipelining enabled +$(eval $(call kconfig_bool,ENABLE_PIPELINING,0)) + +# EMERGENCY_CONSOLE_ENABLED: 1 = REPL recovers from errors and continues (interactive fallthrough) +# 0 = errors are non-recoverable; REPL exits and vm_fault_handler() is called instead +# Default: 1 (dev/recovery builds) +# Set EMERGENCY_CONSOLE_ENABLED=0 for production, embedded, or high-security builds +# where no interactive fallthrough surface should exist. +# Heartbeat family: repointed through the Kconfig bridge (Phase 4). Same +# drop-in-replacement-for-`?=` behavior as the physics/SSM family (Phase 3). +$(eval $(call kconfig_bool,EMERGENCY_CONSOLE_ENABLED,1)) + +# Heartbeat configuration +# HEARTBEAT_THREAD_ENABLED: 1 = run vm_tick() in background thread (OPTIMAL), 0 = inline (legacy) +# Default: 1 (experiments show threaded heartbeat is optimal for adaptive tuning) +# NOTE: As of 2025-11-19, all future experiments use heartbeat enabled +$(eval $(call kconfig_bool,HEARTBEAT_THREAD_ENABLED,1)) + +# HEARTBEAT_TICK_NS: Wake frequency for heartbeat thread (default 1ms) +$(eval $(call kconfig_int,HEARTBEAT_TICK_NS,10000)) + +# HEARTBEAT_CHECK_FREQUENCY / HEARTBEAT_WINDOW_TUNING_FREQUENCY / +# HEARTBEAT_SLOPE_VALIDATION_FREQUENCY: previously unwired in the hosted +# Makefile -- no `?=` and no -D forwarding existed for any of these three +# before Phase 4, so hosted builds always got starforth_config.h's bare +# defaults (256/1000/5000) with no override mechanism at all. The kernel +# Makefile has always had opt-in forwarding for them (VM_FEATURE_FLAG_VARS). +# Promoted here for parity, same treatment as Phase 3's SSM_* knobs. +$(eval $(call kconfig_int,HEARTBEAT_CHECK_FREQUENCY,256)) +$(eval $(call kconfig_int,HEARTBEAT_WINDOW_TUNING_FREQUENCY,1000)) +$(eval $(call kconfig_int,HEARTBEAT_SLOPE_VALIDATION_FREQUENCY,5000)) + +# HISTORICAL: L4Re had no pthreads, so this forced HEARTBEAT_THREAD_ENABLED +# off whenever L4RE=1 was set. L4Re support is no longer an active target; +# see "Platform support" below. +# ifeq ($(L4RE),1) +# HEARTBEAT_THREAD_ENABLED := 0 +# endif + +# Feedback Loop Toggle Switches (for systematic performance measurement) +# ============================================================================ +# These allow turning each feedback loop on/off to measure additive performance gains +# EXP_00-BASELINE: all loops OFF (plain FORTH-79) +# EXP_01: Loop #1 ON +# EXP_02: Loops #1-2 ON +# ... etc, building cumulatively to measure each loop's contribution + +# ============================================================================== +# SSM (Steady State Machine) Configuration - Data-Driven Architecture +# ============================================================================== +# Based on 2^7 DoE with 300 reps (128 configs, 38,400 runs). +# Top 5% analysis (speed + stability) reveals optimal loop combinations. +# +# Experimentally Validated Architecture: +# L1 (heat_tracking): DISABLED (harmful in 86% of top configs) +# L4 (pipelining_metrics): DISABLED (harmful in 100% of top configs) +# L7 (adaptive_heartrate): ALWAYS ON (beneficial in 71% of top configs) +# L2, L3, L5, L6: Runtime-controlled by L8 (workload-dependent) +# L8 (Jacquard): 4-bit mode selector (16 modes: C0-C15) +# +# L8 dynamically controls L2/L3/L5/L6 based on entropy, CV, and temporal metrics. +# Top 5% validated modes: C4, C7, C9, C11, C12 (see v3/src/ssm_jacquard.c) + +# Tuning Knobs (Physics-driven Optimization System) +# ============================================================================ +# Knob #7: ROLLING_WINDOW_SIZE (Initial execution history capture) +# - Default: 4096 (conservative, ensures statistical significance at cold start) +# - Usage: make ROLLING_WINDOW_SIZE=8192 (larger for complex workloads) +# or ROLLING_WINDOW_SIZE=2048 (smaller for memory constraints) +# - System AUTOMATICALLY shrinks during execution if diminishing returns detected +# - Window starts conservative, self-tunes down if pattern diversity plateaus +# - Window becomes "warm" (representative) after N executions, then adapts +$(eval $(call kconfig_int,ROLLING_WINDOW_SIZE,4096)) + +# Knob #6: TRANSITION_WINDOW_SIZE (Pipelining context depth) +# - Default: 8 (see starforth_config.h for the exact shipped value) +# - Usage: make TRANSITION_WINDOW_SIZE=1 (or 2, 4 for shallower context) +# - Empirically tuned via binary chop: 1 vs 2 vs 4 vs 8 +$(eval $(call kconfig_int,TRANSITION_WINDOW_SIZE,8)) + +# SPECULATION_THRESHOLD_Q48 / SPECULATION_DEPTH / MIN_SAMPLES_FOR_SPECULATION / +# MISPREDICTION_COST_Q48 / MINIMUM_PREFETCH_ROI: previously hardcoded, +# non-overridable #define in physics_pipelining_metrics.h -- no Makefile +# knob or -D forwarding existed for any of these five before Phase 5. +# Promoted here for parity, same treatment as Phase 3/4's other +# previously-unwired constants. All five are Q48.16-fixed-point or plain +# counts meaningful only when ENABLE_PIPELINING is on; see Kconfig.physics +# for the exact hex/decimal defaults. MINIMUM_PREFETCH_ROI's default was +# corrected from the long-shipped 0x11999A to 0x1199A (rev y) -- the +# former was ~17.6 in Q48.16, not the documented 1.10. +$(eval $(call kconfig_int,SPECULATION_THRESHOLD_Q48,0x8000)) +$(eval $(call kconfig_int,SPECULATION_DEPTH,1)) +$(eval $(call kconfig_int,MIN_SAMPLES_FOR_SPECULATION,10)) +$(eval $(call kconfig_int,MISPREDICTION_COST_Q48,0x190000)) +$(eval $(call kconfig_int,MINIMUM_PREFETCH_ROI,0x1199A)) + +# Knobs #8-11: Adaptive Window Shrinking Control +# ============================================================================ +# These control how aggressively the rolling window learns and adapts +# (NOT the initial window size - that's ROLLING_WINDOW_SIZE above) + +# Knob #8: ADAPTIVE_SHRINK_RATE (percentage to retain when shrinking) +# - Default: 50 (shrink to 50% = discard 50% each cycle) +# - Range: 50-95 (lower = more aggressive, higher = more conservative) +# - Usage: make ADAPTIVE_SHRINK_RATE=75 (slower learning) or 90 (slow learning) +$(eval $(call kconfig_int,ADAPTIVE_SHRINK_RATE,50)) + +# Knob #9: ADAPTIVE_MIN_WINDOW_SIZE (floor to prevent over-shrinking) +# - Default: 256 (never shrink below 256 word IDs) +# - Range: 64-1024 (smaller = leaner, larger = safer) +# - Usage: make ADAPTIVE_MIN_WINDOW_SIZE=512 (conservative) or 128 (lean) +$(eval $(call kconfig_int,ADAPTIVE_MIN_WINDOW_SIZE,256)) + +# Knob #10: ADAPTIVE_CHECK_FREQUENCY (how often to measure diversity) +# - Default: 512 (check after every 512 executions) +# - Range: 32-1024 (more = faster response, less = less overhead) +# - Usage: make ADAPTIVE_CHECK_FREQUENCY=128 (responsive) or 256 (default of comparable knobs) +$(eval $(call kconfig_int,ADAPTIVE_CHECK_FREQUENCY,512)) + +# Knob #11: ADAPTIVE_GROWTH_THRESHOLD (growth rate that signals saturation) +# - Default: 5 (shrink when growth < 5%) +# - Range: 0-10 (lower = eager shrinking, higher = cautious) +# - Usage: make ADAPTIVE_GROWTH_THRESHOLD=0 (aggressive) or 1 (less conservative) +$(eval $(call kconfig_int,ADAPTIVE_GROWTH_THRESHOLD,5)) + +# Knob #11a: INITIAL_DECAY_SLOPE_Q48 (Starting decay slope for inference engine) +# - Default: 21845 (1/3 in Q48.16 format, = 0.333... starting slope) +# - Range: 13107-43691 (0.2 to 0.67 in Q48.16) +# - Usage: make INITIAL_DECAY_SLOPE_Q48=13107 (0.2) or 32768 (0.5) or 43691 (0.67) +# - DoE: OPP #3 tests 0.2, 0.33, 0.5, 0.67 to find optimal starting point for convergence +# - Note: Inference engine adapts this value at runtime; this is just the cold-start value +$(eval $(call kconfig_int,INITIAL_DECAY_SLOPE_Q48,21845)) + +# Knob #11b: DECAY_MIN_INTERVAL (Minimum time before decay applies) +# - Default: 500 (nanoseconds) +# - Range: 500-5000 (balance between decay sensitivity and overhead) +# - Usage: make DECAY_MIN_INTERVAL=1000 (slower decay) or 2000 (slower still) +# - NOTE: as of the tick-based Loop #3 decay conversion (rev t, see +# docs/working/architecture/VM-FLEET-ATTRACTOR-DESIGN-20260705.md), +# Loop #3 no longer consults this value at all -- decay is gated on +# elapsed heartbeat ticks, not elapsed nanoseconds. Kept only because +# doe_metrics.c still reports it as a metrics field; informational, +# not load-bearing. +$(eval $(call kconfig_int,DECAY_MIN_INTERVAL,500)) + +# Knob #11d: HEARTBEAT_INFERENCE_FREQUENCY (How often to run inference engine) +# - Default: 1000 (ticks between inference runs) +# - Set VERY HIGH (999999) to effectively disable inference (static mode) +# - Set LOW for frequent inference (adaptive mode) +# - DoE: OPP #3 tests 999999 (static, no Loop #6) vs 1000 (adaptive, with Loop #6) +# - Measures: Inference engine cost vs benefit in optimized performance +$(eval $(call kconfig_int,HEARTBEAT_INFERENCE_FREQUENCY,1000)) + +# Knob #12: DECAY_RATE_PER_US_Q16 (Heat decay rate in Q16 fixed-point) +# - Default: 1 (1/65536 heat units decayed per microsecond) +# - Range: 0-65536 (0 = no decay, 65536 = 1 heat/µs) +# - Half-life: ~6.5 seconds at default (100-heat word → 50-heat in 6.5s) +# - Usage: make DECAY_RATE_PER_US_Q16=2 (faster decay) or 0 (no decay for baseline) +# - DoE: Vary this to measure impact of heat decay on performance +$(eval $(call kconfig_int,DECAY_RATE_PER_US_Q16,1)) + +# L8 Jacquard mode selector thresholds (ssm_jacquard.h). Previously unwired -- +# no Makefile knob or -D forwarding existed for these before the Kconfig +# migration's Phase 3; ssm_jacquard.h's own #ifndef fallback was the only +# place any of these five values lived. See Kconfig.physics for the +# rationale behind modeling the four float thresholds as Kconfig `string` +# symbols (Kconfig has no native float type). +$(eval $(call kconfig_int,SSM_ENTROPY_HIGH_THRESHOLD,0.75)) +$(eval $(call kconfig_int,SSM_CV_HIGH_THRESHOLD,0.15)) +$(eval $(call kconfig_int,SSM_TEMPORAL_DECAY_THRESHOLD,0.5)) +$(eval $(call kconfig_int,SSM_TEMPORAL_DECAY_LOW_THRESHOLD,0.3)) +$(eval $(call kconfig_int,SSM_HYSTERESIS_TICKS,5)) + +# Build the CFLAGS with tuning knobs +# L8 FINAL INTEGRATION: All experimental loop flags removed. +# L1-L7 are now always-on internal physics layers. +# L8 Jacquard mode selector is the sole policy engine. +BASE_CFLAGS = -std=c99 -Wall -Werror -Iv3/include -Ikernel/include -Iv3/src/word_source -Iv3/src/test_runner/include \ + -DSTRICT_PTR=$(STRICT_PTR) \ + -DENABLE_HOTWORDS_CACHE=$(ENABLE_HOTWORDS_CACHE) \ + -DENABLE_PIPELINING=$(ENABLE_PIPELINING) \ + -DROLLING_WINDOW_SIZE=$(ROLLING_WINDOW_SIZE) \ + -DTRANSITION_WINDOW_SIZE=$(TRANSITION_WINDOW_SIZE) \ + -DSPECULATION_THRESHOLD_Q48=$(SPECULATION_THRESHOLD_Q48) \ + -DSPECULATION_DEPTH=$(SPECULATION_DEPTH) \ + -DMIN_SAMPLES_FOR_SPECULATION=$(MIN_SAMPLES_FOR_SPECULATION) \ + -DMISPREDICTION_COST_Q48=$(MISPREDICTION_COST_Q48) \ + -DMINIMUM_PREFETCH_ROI=$(MINIMUM_PREFETCH_ROI) \ + -DADAPTIVE_SHRINK_RATE=$(ADAPTIVE_SHRINK_RATE) \ + -DADAPTIVE_MIN_WINDOW_SIZE=$(ADAPTIVE_MIN_WINDOW_SIZE) \ + -DADAPTIVE_CHECK_FREQUENCY=$(ADAPTIVE_CHECK_FREQUENCY) \ + -DADAPTIVE_GROWTH_THRESHOLD=$(ADAPTIVE_GROWTH_THRESHOLD) \ + -DINITIAL_DECAY_SLOPE_Q48=$(INITIAL_DECAY_SLOPE_Q48) \ + -DDECAY_RATE_PER_US_Q16=$(DECAY_RATE_PER_US_Q16) \ + -DHEARTBEAT_THREAD_ENABLED=$(HEARTBEAT_THREAD_ENABLED) \ + -DHEARTBEAT_TICK_NS=$(HEARTBEAT_TICK_NS) \ + -DHEARTBEAT_INFERENCE_FREQUENCY=$(HEARTBEAT_INFERENCE_FREQUENCY) \ + -DHEARTBEAT_CHECK_FREQUENCY=$(HEARTBEAT_CHECK_FREQUENCY) \ + -DHEARTBEAT_WINDOW_TUNING_FREQUENCY=$(HEARTBEAT_WINDOW_TUNING_FREQUENCY) \ + -DHEARTBEAT_SLOPE_VALIDATION_FREQUENCY=$(HEARTBEAT_SLOPE_VALIDATION_FREQUENCY) \ + -DEMERGENCY_CONSOLE_ENABLED=$(EMERGENCY_CONSOLE_ENABLED) \ + -DSSM_ENTROPY_HIGH_THRESHOLD=$(SSM_ENTROPY_HIGH_THRESHOLD) \ + -DSSM_CV_HIGH_THRESHOLD=$(SSM_CV_HIGH_THRESHOLD) \ + -DSSM_TEMPORAL_DECAY_THRESHOLD=$(SSM_TEMPORAL_DECAY_THRESHOLD) \ + -DSSM_TEMPORAL_DECAY_LOW_THRESHOLD=$(SSM_TEMPORAL_DECAY_LOW_THRESHOLD) \ + -DSSM_HYSTERESIS_TICKS=$(SSM_HYSTERESIS_TICKS) + +ifeq ($(HEARTBEAT_THREAD_ENABLED),1) +# HISTORICAL: this used to branch on L4RE (no pthreads there) -- +# THREAD_FLAGS := if L4RE else -pthread. L4Re support is no longer an +# active target; see "Platform support" below. +THREAD_FLAGS := -pthread +else +THREAD_FLAGS := +endif + +BASE_CFLAGS += $(THREAD_FLAGS) + +# Build profiles (TARGET values) +SUPPORTED_TARGETS := standard fast fastest turbo asan + +TARGET_DESCRIPTION_standard := Standard optimized build +TARGET_CFLAGS_standard := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O2 -flto=auto -fuse-linker-plugin -DNDEBUG \ + -DUSE_ASM_OPT=1 \ + -ffunction-sections -fdata-sections -fomit-frame-pointer \ + -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-strict-aliasing +TARGET_LDFLAGS_standard := -Wl,--gc-sections -s -flto=auto -fuse-linker-plugin -static $(THREAD_FLAGS) + +TARGET_DESCRIPTION_fast := Fast optimized build (no LTO, easier debugging) +TARGET_CFLAGS_fast := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG +TARGET_LDFLAGS_fast := -s $(THREAD_FLAGS) + +TARGET_DESCRIPTION_fastest := Maximum performance build (ASM + LTO + direct threading) +TARGET_CFLAGS_fastest := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG \ + -flto=auto -fuse-linker-plugin -funroll-loops -finline-functions -fomit-frame-pointer -fno-plt -fno-semantic-interposition +TARGET_LDFLAGS_fastest := -flto=auto -fuse-linker-plugin -s -Wl,--gc-sections $(THREAD_FLAGS) + +TARGET_DESCRIPTION_turbo := Assembly-optimized build (no direct threading) +TARGET_CFLAGS_turbo := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DNDEBUG -flto +TARGET_LDFLAGS_turbo := -flto -s $(THREAD_FLAGS) + +TARGET_DESCRIPTION_asan := ASan/UBSan instrumented build for memory error detection +TARGET_CFLAGS_asan := $(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O1 -g \ + -fsanitize=address,undefined -fno-omit-frame-pointer +TARGET_LDFLAGS_asan := -fsanitize=address,undefined $(THREAD_FLAGS) + +define TARGET_POST_fastest + @echo "" + @echo "🎯 You've built the FASTEST FORTH IN THE WEST!" + @echo "" + @echo "Quick-draw benchmark:" + @time -f " ⏱️ Time: %E seconds" ./$(BINARY) -c ": BENCH 1000000 0 DO 1 2 + DROP LOOP ; BENCH BYE" 2>/dev/null || true +endef + +TARGET_DESCRIPTION := $(TARGET_DESCRIPTION_$(TARGET)) +ifeq ($(strip $(TARGET_DESCRIPTION)),) + $(error Unknown TARGET '$(TARGET)'. Supported targets: $(SUPPORTED_TARGETS)) +endif + +TARGET_CFLAGS_SELECTED := $(TARGET_CFLAGS_$(TARGET)) +TARGET_LDFLAGS_SELECTED := $(TARGET_LDFLAGS_$(TARGET)) +TARGET_POST := $(or $(TARGET_POST_$(TARGET)),@:) + +CFLAGS ?= $(TARGET_CFLAGS_SELECTED) +LDFLAGS ?= $(TARGET_LDFLAGS_SELECTED) + +CFLAGS += $(EXTRA_CFLAGS) +LDFLAGS += $(EXTRA_LDFLAGS) + +USE_ASM_OPT := $(if $(findstring -DUSE_ASM_OPT=1,$(CFLAGS)),1,0) +USE_LTO := $(if $(or $(findstring -flto,$(CFLAGS)),$(findstring -flto,$(LDFLAGS))),1,0) + +# Platform support +# +# HISTORICAL: L4Re/Fiasco.OC was a supported platform target (`make L4RE=1`) +# through mid-2026. Removed as an active target; v3/src/platform/l4re/time.c +# is retained for reference but no longer wired into any build. To restore: +# reinstate the `else ifdef L4RE` branch below and the L4RE-conditional +# logic marked HISTORICAL elsewhere in this Makefile (search "L4RE"/"L4Re"). +# +# ifdef MINIMAL +# ... +# else ifdef L4RE +# CFLAGS += -D__l4__=1 +# PLATFORM_TIME_SRC = v3/src/platform/l4re/time.c v3/src/platform/platform_init.c +# PLATFORM_ALLOC_SRC = v3/src/platform/alloc_kernel.c +# else +# ... +# endif +ifdef MINIMAL +# DISABLED 2026-07-08: this was never a finished feature, not a small bug. +# v3/src/platform/starforth_minimal.c (referenced below) does not exist +# anywhere in the repo, and only 5 of ~90 source files under v3/src/ have any +# STARFORTH_MINIMAL awareness despite -nostdlib -ffreestanding applying to +# the entire tree. Confirmed by trying it: even a throwaway empty stub for +# the missing file lets the build report "success" while linking a binary +# with no _start entry point (this build's specific -nostdlib/-static/ +# -pthread/-flto flag combination doesn't actually exclude libc, so most +# calls silently resolve anyway -- the illusion of success is the trap). +# Reviving this needs an actual freestanding platform layer written from +# scratch, not a quick fix -- failing loudly here instead of letting +# anyone hit a confusing compile error or, worse, a binary that "builds" +# but can't run. See .claude/CLAUDE.md's punch list for status. +$(error MINIMAL=1 build is disabled: incomplete freestanding platform layer, not currently supported. See the comment immediately above this line for why) +CFLAGS += -DSTARFORTH_MINIMAL=1 -nostdlib -ffreestanding +LDFLAGS += -nostdlib +PLATFORM_SRC = v3/src/platform/starforth_minimal.c +PLATFORM_ALLOC_SRC = v3/src/platform/alloc_kernel.c +else +PLATFORM_TIME_SRC = v3/src/platform/linux/time.c v3/src/platform/linux/io.c v3/src/platform/platform_init.c +PLATFORM_ALLOC_SRC = v3/src/platform/alloc_host.c +endif + +PLATFORM_COMMON_SRC = v3/src/platform/threading.c $(PLATFORM_ALLOC_SRC) + +# Source and object files +SRC = $(wildcard v3/src/*.c v3/src/word_source/*.c v3/src/test_runner/*.c v3/src/test_runner/modules/*.c) $(PLATFORM_SRC) $(PLATFORM_TIME_SRC) $(PLATFORM_COMMON_SRC) +BUILD_ROOT ?= build +build_dir = $(BUILD_ROOT)/$(call canon_arch,$(or $2,$(ARCH)))/$1 +binary_path = $(call build_dir,$1,$2)/starforth +BUILD_DIR = $(call build_dir,$(TARGET),$(ARCH)) +BINARY = $(call binary_path,$(TARGET),$(ARCH)) +OBJ = $(patsubst v3/src/%.c,$(BUILD_DIR)/%.o,$(SRC)) +ASM_FILES = $(patsubst v3/src/%.c,$(BUILD_DIR)/%.s,$(SRC)) + +# Profiler support for test targets +PROFILE_LEVEL := $(strip $(PROFILE)) +ifeq ($(PROFILE_LEVEL),) +PROFILE_ARGS := +else +PROFILE_ARGS := --profile $(PROFILE_LEVEL) +PROFILE_REPORT ?= 1 +ifneq ($(strip $(PROFILE_REPORT)),0) +PROFILE_ARGS += --profile-report +endif +endif + +# Installation directories +PREFIX ?= . +BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)/share/man/man1 +INFODIR = $(PREFIX)/share/info +DOCDIR = $(PREFIX)/share/doc/starforth +CONFDIR = $(PREFIX)/etc/starforth + +# ============================================================================== +# PHONY TARGETS +# ============================================================================== + +.PHONY: all banner help clean clean-obj clean-docs starkernel mkcapsule capsule-gen capsule-manifest +.PHONY: fastest fast turbo +.PHONY: rpi4 rpi4-cross rpi4-fastest riscv64-clang +.PHONY: minimal debug profile performance +.PHONY: test bench benchmark +.PHONY: asm sbom +.PHONY: docs api-docs docs-latex docs-isabelle isabelle-build isabelle-check info math-companion math-companion-clean +.PHONY: refinement-status refinement-init refinement-phase1 verify-defect refinement-annotate-check refinement-report +.PHONY: install uninstall package deb rpm +.PHONY: quality compile_commands clang_tidy cppcheck gcc_analyzer +.PHONY: FORCE version-info build-manifest + +# ============================================================================== +# MAIN TARGETS +# ============================================================================== + +all: banner $(BINARY) + @echo "" + @echo "✓ Build complete: $(BINARY)" + @echo " Architecture: $(ARCH_NAME)" + @echo " Profile: $(TARGET_DESCRIPTION) ($(TARGET))" + @echo " Output directory: $(BUILD_DIR)" + @echo " Optimizations: $(if $(findstring USE_ASM_OPT,$(CFLAGS)),Enabled,Disabled)" + @echo " Direct Threading: $(if $(findstring USE_DIRECT_THREADING,$(CFLAGS)),Enabled,Disabled)" + @mkdir -p lfs/$(ARCH_DIR) + @cp $(BINARY) lfs/$(ARCH_DIR)/starforth + @echo " LFS copy: lfs/$(ARCH_DIR)/starforth" + $(TARGET_POST) + +banner: + @echo "════════════════════════════════════════════════════════════" + @echo " ⚡ Building the Fastest Forth in the West! ⚡" + @echo "════════════════════════════════════════════════════════════" + @echo " Target Architecture: $(ARCH_NAME) ($(ARCH_DIR))" + @echo " Build Profile: $(TARGET_DESCRIPTION) ($(TARGET))" + @echo "" + +# ============================================================================== +# OPTIMIZATION BUILDS - The Fastest in the West +# ============================================================================== + +# Maximum performance - no compromises +fastest: + @echo "🏆 Building FASTEST configuration..." + @echo " - Architecture: $(ARCH_NAME)" + @echo " - Assembly optimizations: ENABLED" + @echo " - Direct threading: ENABLED" + @echo "" + @$(MAKE) -f v3/Makefile TARGET=fastest all + +# Fast without LTO (easier debugging) +fast: + @echo "⚡ Building FAST configuration (no LTO for debugging)..." + @$(MAKE) -f v3/Makefile TARGET=fast all + +# Assembly optimizations only (no direct threading) +turbo: + @echo "🚀 Building TURBO configuration (ASM only)..." + @$(MAKE) -f v3/Makefile TARGET=turbo all + +# ============================================================================== +# PLATFORM-SPECIFIC BUILDS +# ============================================================================== + +# Raspberry Pi 4 - native build +rpi4: + @echo "🥧 Building for Raspberry Pi 4 (native)..." + @$(MAKE) -f v3/Makefile ARCH=raspi TARGET=fastest CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto" LDFLAGS="-flto -s" all + @echo "✓ Raspberry Pi build ready: $(call binary_path,fastest,raspi)" + +# Raspberry Pi 4 - cross-compile from x86_64 +rpi4-cross: + @echo "🥧 Cross-compiling for Raspberry Pi 4..." + @$(MAKE) -f v3/Makefile ARCH=raspi TARGET=fastest CC=aarch64-linux-gnu-gcc \ + CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -static" \ + LDFLAGS="-flto -s -static" \ + all + @echo "✓ Cross-compiled binary ready: $(call binary_path,fastest,raspi)" + @echo " Copy to RPi4: scp $(call binary_path,fastest,raspi) pi@raspberrypi.local:~/" + +# Raspberry Pi 4 - maximum optimization +rpi4-fastest: + @echo "🥧⚡ Building FASTEST for Raspberry Pi 4..." + @$(MAKE) -f v3/Makefile ARCH=raspi TARGET=fastest CC=aarch64-linux-gnu-gcc \ + CFLAGS="$(BASE_CFLAGS) -march=armv8-a+crc+simd+crypto -mtune=cortex-a72 -DARCH_ARM64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -funroll-loops -finline-functions" \ + LDFLAGS="-flto -s -static" \ + all + @echo "✓ Raspberry Pi FASTEST build ready: $(call binary_path,fastest,raspi)" + +# RISC-V 64 - cross-compile via clang (GCC fails to build this tree under +# -std=c99: a nanosleep visibility failure, not yet root-caused — see +# docs/lithosananke/hosted-acceptance-test/README.md and +# docs/working/archive/session-logs/2026-07-24-punch-list.md item #3). +# CFLAGS deliberately does NOT reuse $(BASE_CFLAGS): BASE_CFLAGS hardcodes +# -std=c99, and clang needs -std=c11 -pthread here. This mirrors the exact +# recipe verified in the hosted-acceptance-test doc, kept in sync with it. +riscv64-clang: + @echo "🦀 Cross-compiling for RISC-V 64 (clang)..." + @$(MAKE) -f v3/Makefile ARCH=riscv64 TARGET=fastest \ + CC="clang-18 --target=riscv64-linux-gnu --sysroot=/usr/riscv64-linux-gnu" \ + CFLAGS="-std=c11 -pthread -Wall -Werror -Iv3/include -Ikernel/include -Iv3/src/word_source -Iv3/src/test_runner/include -DSTRICT_PTR=1 -march=rv64gc -mabi=lp64d -mcmodel=medany -DARCH_RISCV64=1 -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1 -DNDEBUG -flto -static" \ + LDFLAGS="-flto -s -static -fuse-ld=lld" \ + all + @echo "✓ Cross-compiled binary ready: $(call binary_path,fastest,riscv64)" + @echo " Run: qemu-riscv64 $(call binary_path,fastest,riscv64)" + +# Minimal/embedded build +minimal: + $(MAKE) -f v3/Makefile MINIMAL=1 + +# HISTORICAL: L4Re support removed as an active target (see "Platform +# support" above). This target cross-compiled a minimal build with the +# L4Re toolchain (l4-gcc) for smoke-testing without real L4Re headers. +# fake-l4re: +# $(MAKE) -f v3/Makefile MINIMAL=1 CC=l4-gcc CFLAGS="$(BASE_CFLAGS) -DL4RE_TARGET=1" + +# ============================================================================== +# DEBUG & DEVELOPMENT BUILDS +# ============================================================================== + +# Debug build with symbols +debug: banner + @echo "🐛 Building DEBUG configuration..." + $(MAKE) -f v3/Makefile CFLAGS="$(BASE_CFLAGS) -O0 -g -DDEBUG" LDFLAGS="" $(BINARY) + +# Build with profiler support +profile: + $(MAKE) -f v3/Makefile CFLAGS="$(BASE_CFLAGS) -g -O1" $(BINARY) + +# Performance build (legacy alias - redirects to 'fastest') +performance: fastest + +# ============================================================================== +# BUILD RULES +# ============================================================================== + +# Generate version header from Makefile VERSION, ARCH, TARGET, and timestamp +v3/include/version.h: FORCE + @mkdir -p v3/include + @echo "Generating version header..." + @BUILD_TS=$$(date -Iseconds 2>/dev/null || echo "unknown"); \ + printf '#ifndef STARFORTH_VERSION_H\n#define STARFORTH_VERSION_H\n\n' > $@; \ + printf '#define STARFORTH_VERSION "%s"\n' "$(VERSION)" >> $@; \ + printf '#define STARFORTH_ARCH "%s"\n' "$(ARCH_NAME)" >> $@; \ + printf '#define STARFORTH_TARGET "%s"\n' "$(TARGET)" >> $@; \ + printf '#define STARFORTH_TIMESTAMP "%s"\n' "$$BUILD_TS" >> $@; \ + printf '#define STARFORTH_VERSION_FULL "StarForth v%s %s %s %s"\n\n' "$(VERSION)" "$(ARCH_NAME)" "$(TARGET)" "$$BUILD_TS" >> $@; \ + printf '#endif /* STARFORTH_VERSION_H */\n' >> $@ + +# Ensure version.h exists and is up-to-date before compilation +FORCE: + +# ============================================================================== +# CAPSULE SUBSYSTEM +# ============================================================================== + +CAPSULES_DIR ?= capsules +MKCAPSULE_SRC = tools/mkcapsule.c +MKCAPSULE_BIN = $(BUILD_DIR)/tools/mkcapsule +CAPSULE_GENERATED = $(BUILD_DIR)/capsule_generated.c +CAPSULE_GENERATED_OBJ = $(BUILD_DIR)/capsule_generated.o +CAPSULE_MANIFEST = $(CAPSULES_DIR)/MANIFEST_AUTO.md + +# Build the mkcapsule host tool +$(MKCAPSULE_BIN): $(MKCAPSULE_SRC) + @mkdir -p $(dir $@) + @echo " HOSTCC $<" + @$(CC) -O2 -Wall -o $@ $< + +# Run mkcapsule to generate the capsule directory C source +$(CAPSULE_GENERATED): $(MKCAPSULE_BIN) $(CAPSULES_DIR) + @mkdir -p $(dir $@) + @echo " MKCAP $(CAPSULES_DIR) -> $@" + @$(MKCAPSULE_BIN) $(CAPSULES_DIR) $@ + +# Compile the generated capsule directory +$(CAPSULE_GENERATED_OBJ): $(CAPSULE_GENERATED) | v3/include/version.h + @mkdir -p $(dir $@) + @echo " CC $<" + @$(CC) $(CFLAGS) -c $< -o $@ + +.PHONY: mkcapsule capsule-gen capsule-manifest +mkcapsule: $(MKCAPSULE_BIN) +capsule-manifest: $(MKCAPSULE_BIN) + @echo " MANIFEST $(CAPSULES_DIR) -> $(CAPSULE_MANIFEST)" + @$(MKCAPSULE_BIN) --manifest $(CAPSULES_DIR) $(CAPSULE_MANIFEST) +capsule-gen: $(CAPSULE_GENERATED) capsule-manifest + +# starkernel: full capsule-aware build +# 1. Build mkcapsule tool +# 2. Generate capsule_generated.c from capsules/ +# 3. Compile StarForth with __STARKERNEL__ and capsule_generated.o linked in +starkernel: $(MKCAPSULE_BIN) $(CAPSULE_GENERATED_OBJ) + @$(MAKE) -f v3/Makefile $(BINARY) \ + EXTRA_CFLAGS="-D__STARKERNEL__=1 -Iv3/include -Ikernel/include" \ + EXTRA_OBJ="$(CAPSULE_GENERATED_OBJ)" + +# ============================================================================== +# Main executable +$(BINARY): $(OBJ) $(EXTRA_OBJ) + @echo "🔗 Linking $(BINARY)..." + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +# Pattern rule for all C files (consolidates 5 repetitive rules) +# Order-only dependency: version.h must exist before compilation, but changes don't trigger rebuild +$(BUILD_DIR)/%.o: v3/src/%.c | v3/include/version.h + @mkdir -p $(dir $@) + @echo " CC $<" + @$(CC) $(CFLAGS) -c $< -o $@ +ifdef ASM + @$(CC) $(CFLAGS) -S $(ASM_SYNTAX) $< -o $(patsubst %.o,%.s,$@) +endif + +# Files that include version.h - rebuild when timestamp changes +$(BUILD_DIR)/main.o: v3/include/version.h +$(BUILD_DIR)/cli.o: v3/include/version.h +$(BUILD_DIR)/word_source/starforth_words.o: v3/include/version.h + +# ============================================================================== +# TESTING & BENCHMARKING +# ============================================================================== + +# Quick benchmark +bench: $(BINARY) + @echo "" + @echo "🏇 Running quick-draw benchmark..." + @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + @echo "Test: 1 million stack operations" + @time -f "Time: %E seconds" ./$(BINARY) -c ": BENCH 1000000 0 DO 1 2 + DROP LOOP ; BENCH BYE" 2>/dev/null || echo "Benchmark complete" + @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +# Full benchmark suite +benchmark: $(BINARY) + @echo "" + @echo "🎯 Full Benchmark Suite - Fastest Forth in the West" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @echo "📊 Stack Operations (1M iterations):" + @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-STACK 1000000 0 DO 1 2 3 DROP DROP DROP LOOP ; BENCH-STACK BYE" 2>/dev/null || true + @echo "" + @echo "📊 Arithmetic Operations (1M iterations):" + @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-MATH 1000000 0 DO 10 20 + 5 * 100 / DROP LOOP ; BENCH-MATH BYE" 2>/dev/null || true + @echo "" + @echo "📊 Logic Operations (1M iterations):" + @time -f " ⏱️ %E seconds" ./$(BINARY) -c ": BENCH-LOGIC 1000000 0 DO 255 DUP AND DUP OR XOR DROP LOOP ; BENCH-LOGIC BYE" 2>/dev/null || true + @echo "" + @echo "════════════════════════════════════════════════════════════" + +# ============================================================================== +# ASSEMBLY OUTPUT & ANALYSIS +# ============================================================================== + +# Generate assembly files for inspection +asm: banner + @echo "📝 Generating assembly output..." + @echo " Cleaning to force rebuild..." + @$(MAKE) -f v3/Makefile clean-obj > /dev/null 2>&1 + $(MAKE) -f v3/Makefile ASM=1 CFLAGS="$(BASE_CFLAGS) $(ARCH_FLAGS) $(ARCH_DEFINES) -O3 -DUSE_ASM_OPT=1 -DUSE_DIRECT_THREADING=1" LDFLAGS="" $(BINARY) + @echo "✓ Assembly files generated in $(BUILD_DIR)/" + @echo " Files generated: $$(find $(BUILD_DIR) -name '*.s' | wc -l)" + @echo " Example: less $(BUILD_DIR)/stack_management.s" + +# Generate Software Bill of Materials (SBOM) in SPDX format +sbom: + @echo "📋 Generating SBOM (Software Bill of Materials)..." + @if ! which syft >/dev/null 2>&1; then \ + echo "Error: syft not found. Install from https://github.com/anchore/syft"; \ + exit 1; \ + fi + @syft dir:. -o spdx-json=sbom.spdx.json -o spdx=sbom.spdx \ + --source-name LithosAnanke \ + --source-version $(VERSION) \ + --exclude './build/**' --exclude './tools/**' --exclude './.git/**' + @echo "✅ SBOM generated:" + @echo " SPDX JSON: sbom.spdx.json" + @echo " SPDX: sbom.spdx" + @echo " Version: $(VERSION)" + +# ============================================================================== +# DOCUMENTATION +# ============================================================================== + +# Generate API documentation (Doxygen XML → AsciiDoc) +api-docs: + @echo "📚 Generating API documentation from Doxygen..." + @if [ ! -f scripts/generate-doxygen-appendix.sh ]; then \ + echo "Error: scripts/generate-doxygen-appendix.sh not found"; \ + exit 1; \ + fi + @./scripts/generate-doxygen-appendix.sh + @echo "✅ API documentation generated: docs/src/appendix/" + +# ---------------------------------------------------------------------------- +# Math companion to the SSRN paper. +# Builds docs/SSRN_companion/Math_Companion_SSRN.pdf from the LaTeX source. +# Requires: pdflatex (texlive-latex-base, texlive-latex-extra, texlive-science). +# ---------------------------------------------------------------------------- +math-companion: + @echo "Building SSRN math companion (docs/SSRN_companion/Math_Companion_SSRN.pdf)..." + @if ! command -v pdflatex >/dev/null 2>&1; then \ + echo "Error: pdflatex not found."; \ + echo " Install with: apt-get install texlive-latex-base texlive-latex-extra texlive-science"; \ + exit 1; \ + fi + @cd docs/SSRN_companion && \ + pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null && \ + pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null && \ + pdflatex -interaction=nonstopmode -halt-on-error Math_Companion_SSRN.tex >/dev/null + @echo "Built: docs/SSRN_companion/Math_Companion_SSRN.pdf" + @cd docs/SSRN_companion && ls -lh Math_Companion_SSRN.pdf | awk '{print " Size:", $$5, " Pages: see pdfinfo"}' + +math-companion-clean: + @rm -f docs/SSRN_companion/Math_Companion_SSRN.{aux,log,out,toc,lof,lot,nav,snm,vrb} + @rm -f docs/SSRN_companion/Math_Companion_SSRN.pdf + @echo "Cleaned math companion build artifacts." + +# Convert all AsciiDoc to LaTeX +docs-latex: + @echo "📄 Converting AsciiDoc to LaTeX..." + @if [ ! -f scripts/asciidoc-to-latex.sh ]; then \ + echo "Error: scripts/asciidoc-to-latex.sh not found"; \ + exit 1; \ + fi + @./scripts/asciidoc-to-latex.sh + @echo "✅ LaTeX files generated: docs/latex/" + +# Build and verify Isabelle theories +isabelle-build: + @echo "🔬 Building Isabelle formal verification theories..." + @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ + echo "Error: Isabelle not found: $(ISABELLE)"; \ + echo " Install Isabelle or set ISABELLE variable"; \ + exit 1; \ + fi + @echo " Using: $$(command -v $(ISABELLE))" + @echo " Building StarForth_Formal session (VM + Physics)..." + @cd docs/src/internal/formal && $(ISABELLE) build -v -d . StarForth_Formal + @echo "✅ Isabelle theories verified successfully" + +# Quick check of Isabelle theories (faster than full build) +isabelle-check: + @echo "🔬 Quick-checking Isabelle theories..." + @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ + echo "Error: Isabelle not found: $(ISABELLE)"; \ + exit 1; \ + fi + @cd docs/src/internal/formal && \ + for thy in *.thy; do \ + echo " Checking $$thy..."; \ + $(ISABELLE) process -T "$$thy" 2>&1 | head -5; \ + done + @echo "✅ Quick check complete" + +# Generate comprehensive Isabelle documentation (for auditing & CI/CD) +# This generates documentation and verification reports regardless of proof status +# Suitable for Jenkinsfile pipelines - shows complete state including errors +docs-isabelle: + @echo "📚 Generating comprehensive Isabelle documentation (audit mode)..." + @mkdir -p docs/src/isabelle + @echo "" + @echo "Step 1: Attempting to verify Isabelle theories..." + @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + @cd docs/src/internal/formal && \ + if $(ISABELLE) build -v -d . StarForth_Formal > "$(CURDIR)/docs/src/isabelle/build.log" 2>&1; then \ + echo "✅ All theories verified successfully"; \ + else \ + echo "⚠️ Some theories have incomplete proofs (see build.log for details)"; \ + fi + @echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + @echo "" + @echo "Step 2: Generating documentation from theory source..." + @if [ ! -f scripts/isabelle-to-adoc.sh ]; then \ + echo "⚠️ Warning: scripts/isabelle-to-adoc.sh not found"; \ + echo " Creating default script..."; \ + mkdir -p scripts; \ + echo '#!/bin/bash' > scripts/isabelle-to-adoc.sh; \ + echo 'echo "Generating Isabelle theory reports to AsciiDoc..."' >> scripts/isabelle-to-adoc.sh; \ + echo 'cd docs/src/internal/formal' >> scripts/isabelle-to-adoc.sh; \ + echo 'for thy in *.thy; do' >> scripts/isabelle-to-adoc.sh; \ + echo ' base=$$(basename "$$thy" .thy)' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "= $$base Theory" > "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "Formal verification theory for StarForth VM." >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "== Theory Source" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "[source,isabelle]" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "----" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' cat "$$thy" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo ' echo "----" >> "../../../isabelle/$$base.adoc"' >> scripts/isabelle-to-adoc.sh; \ + echo 'done' >> scripts/isabelle-to-adoc.sh; \ + chmod +x scripts/isabelle-to-adoc.sh; \ + fi + @bash scripts/isabelle-to-adoc.sh + @echo "" + @echo "Step 3: Creating audit summary..." + @echo "✅ Comprehensive Isabelle documentation generated: docs/src/isabelle/" + @echo "" + @echo "📂 Documentation includes:" + @echo " • index.adoc - Master index of all theories" + @echo " • VERIFICATION_REPORT.adoc - Audit report" + @echo " • .adoc - Individual theory documentation with source" + @echo " • build.log - Isabelle build output (verification status)" + +# ============================================================================== +# REFINEMENT VERIFICATION (C ⊑ Isabelle) +# ============================================================================== + +# Refinement status dashboard +refinement-status: + @echo "════════════════════════════════════════════════════════════" + @echo " StarForth C ⊑ Isabelle Refinement Status" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @if [ ! -f docs/REFINEMENT_CAPA.adoc ]; then \ + echo "⚠️ No REFINEMENT_CAPA.adoc found. Initialize with: make refinement-init"; \ + echo ""; \ + echo "Refinement infrastructure status: UNINITIALIZED"; \ + else \ + echo "📋 Defect Summary:"; \ + echo ""; \ + echo -n " Total Defects: "; grep -c "^== DEFECT-" docs/REFINEMENT_CAPA.adoc || echo "0"; \ + echo -n " OPEN: "; grep "| OPEN" docs/REFINEMENT_CAPA.adoc | wc -l; \ + echo -n " IN-PROGRESS: "; grep "| IN-PROGRESS" docs/REFINEMENT_CAPA.adoc | wc -l; \ + echo -n " CLOSED: "; grep "| CLOSED" docs/REFINEMENT_CAPA.adoc | wc -l; \ + fi + @echo "" + @echo "🏆 Phase Status:" + @echo " Phase 1: vm.c core .............. NOT STARTED" + @echo " Phase 2: Root utilities ......... NOT STARTED" + @echo " Phase 3: Test harness .......... NOT STARTED" + @echo " Phase 4: Primitive dictionary .. NOT STARTED" + @echo " Phase 5: VM expansion .......... NOT STARTED" + @echo "" + @echo "📂 Documentation:" + @echo " • docs/REFINEMENT_CAPA.adoc - Defect tracking" + @echo " • docs/REFINEMENT_ANNOTATIONS.adoc - Code annotation guide" + @echo "" + @echo "Next steps: make refinement-phase1 (to start Phase 1 proofs)" + @echo "════════════════════════════════════════════════════════════" + +# Initialize refinement tracking +refinement-init: + @echo "Initializing refinement tracking..." + @if [ -f docs/REFINEMENT_CAPA.adoc ]; then \ + echo "✅ docs/REFINEMENT_CAPA.adoc already exists"; \ + else \ + echo "📋 Creating REFINEMENT_CAPA.adoc"; \ + fi + @if [ -f docs/REFINEMENT_ANNOTATIONS.adoc ]; then \ + echo "✅ docs/REFINEMENT_ANNOTATIONS.adoc already exists"; \ + else \ + echo "📋 Creating REFINEMENT_ANNOTATIONS.adoc"; \ + fi + @echo "✅ Refinement infrastructure ready" + @echo "" + @echo "Next: Review docs/REFINEMENT_ANNOTATIONS.adoc" + @echo " Then: make refinement-phase1" + +# Phase 1: VM Core refinement +refinement-phase1: + @echo "════════════════════════════════════════════════════════════" + @echo " ⚙️ PHASE 1: VM Core Refinement (C ⊑ Isabelle)" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @echo "Building refinement proofs for:" + @echo " • stack_push / stack_pop (DEFECT-001, DEFECT-002)" + @echo " • execute_call / execute_return (DEFECT-002)" + @echo " • instruction_dispatch (DEFECT-003)" + @echo "" + @echo "Proof target: StarForth_Refinement (Isabelle theory)" + @if ! command -v $(ISABELLE) >/dev/null 2>&1; then \ + echo "Error: Isabelle not found. Install or set ISABELLE variable"; \ + exit 1; \ + fi + @echo "" + @echo "Step 1: Creating StarForth_Refinement.thy if needed..." + @if [ ! -f docs/src/internal/formal/StarForth_Refinement.thy ]; then \ + echo "Creating template..."; \ + mkdir -p docs/src/internal/formal; \ + touch docs/src/internal/formal/StarForth_Refinement.thy; \ + echo "TODO: Add refinement proofs here" > docs/src/internal/formal/StarForth_Refinement.thy; \ + fi + @echo "" + @echo "Step 2: Attempting to build refinement proofs..." + @echo "(This will fail until proofs are written)" + @cd docs/src/internal/formal && \ + $(ISABELLE) build -v -d . StarForth_Formal 2>&1 | tail -20 + @echo "" + @echo "📋 Next steps:" + @echo " 1. Review open defects: grep 'OPEN' docs/REFINEMENT_CAPA.adoc" + @echo " 2. Start working on DEFECT-001 (stack_push)" + @echo " 3. Add refinement proofs to StarForth_Refinement.thy" + @echo " 4. Run: make verify-defect DEFECT=001" + +# Verify specific defect resolution +verify-defect: + @if [ -z "$(DEFECT)" ]; then \ + echo "Usage: make verify-defect DEFECT=001"; \ + echo ""; \ + echo "Available defects:"; \ + grep "== DEFECT-" docs/REFINEMENT_CAPA.adoc | sed 's/== / /'; \ + exit 1; \ + fi + @echo "════════════════════════════════════════════════════════════" + @echo " 🔍 Verifying Resolution: $(DEFECT)" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @if ! grep -q "== DEFECT-$(DEFECT):" docs/REFINEMENT_CAPA.adoc; then \ + echo "❌ DEFECT-$(DEFECT) not found in REFINEMENT_CAPA.adoc"; \ + exit 1; \ + fi + @echo "Defect Details:" + @grep -A 30 "== DEFECT-$(DEFECT):" docs/REFINEMENT_CAPA.adoc | head -35 + @echo "" + @echo "Next: Implement corrective action, then run this again" + +# Check code annotation coverage +refinement-annotate-check: + @echo "════════════════════════════════════════════════════════════" + @echo " 📝 Checking Code Annotation Coverage" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @echo "Phase 1 target functions:" + @echo "" + @for func in stack_push stack_pop execute_instruction execute_call execute_return; do \ + if grep -q "REFINEMENT.*$$func\|void $$func" v3/src/vm.c; then \ + if grep -q "REFINEMENT:" v3/src/vm.c | grep -q "$$func"; then \ + echo " ✅ $$func - ANNOTATED"; \ + else \ + echo " ❌ $$func - MISSING ANNOTATION"; \ + fi; \ + else \ + echo " ⚠️ $$func - NOT FOUND"; \ + fi; \ + done + @echo "" + @echo "Guide: docs/REFINEMENT_ANNOTATIONS.adoc" + +# Generate refinement report +refinement-report: + @echo "🔄 Generating refinement status report..." + @mkdir -p docs/reports + @echo "# StarForth Refinement Status" > docs/reports/refinement-status.md + @echo "" >> docs/reports/refinement-status.md + @echo "Generated: $$(date)" >> docs/reports/refinement-status.md + @echo "" >> docs/reports/refinement-status.md + @echo "## Summary" >> docs/reports/refinement-status.md + @echo "" >> docs/reports/refinement-status.md + @grep -c "== DEFECT-" docs/REFINEMENT_CAPA.adoc | xargs -I {} echo "Total Defects: {}" >> docs/reports/refinement-status.md + @echo "" >> docs/reports/refinement-status.md + @echo "See docs/REFINEMENT_CAPA.adoc for details" >> docs/reports/refinement-status.md + @echo "✅ Report: docs/reports/refinement-status.md" + +# Generate GNU info documentation +docs/starforth.info: + @if [ ! -f docs/starforth.texi ]; then \ + echo "⚠️ Skipping info docs: docs/starforth.texi not present"; \ + touch docs/starforth.info; \ + else \ + echo "📖 Building GNU info documentation..."; \ + if ! command -v makeinfo >/dev/null 2>&1; then \ + echo "Warning: makeinfo not found. Install with: sudo apt-get install texinfo"; \ + touch docs/starforth.info; \ + else \ + makeinfo docs/starforth.texi -o docs/starforth.info && \ + echo "✅ Info documentation: docs/starforth.info"; \ + fi; \ + fi + +# Generate all documentation +docs: api-docs docs-isabelle + @echo "✅ All documentation generated!" + @echo "" + @echo "📂 Documentation locations:" + @echo " • API docs: docs/src/appendix/" + @echo " • Isabelle docs: docs/src/isabelle/" + @echo " • LaTeX: docs/latex/" + +# Clean generated documentation +clean-docs: + @echo "🗑️ Cleaning generated documentation..." + @rm -rf docs/src/appendix/ docs/latex/ docs/src/isabelle/ + @echo "✅ Documentation cleaned" + +# ============================================================================== +# INSTALLATION +# ============================================================================== + +install: $(BINARY) + @echo "📦 Installing StarForth to $(PREFIX)..." + @install -d $(BINDIR) + @install -m 755 $(BINARY) $(BINDIR)/starforth + @echo " ✓ Binary installed: $(BINDIR)/starforth" + @if [ -f capsules/init.4th ]; then \ + install -d $(CONFDIR); \ + install -m 644 capsules/init.4th $(CONFDIR)/init.4th; \ + echo " ✓ Config installed: $(CONFDIR)/init.4th"; \ + fi + @if [ -f man/starforth.1 ]; then \ + install -d $(MANDIR); \ + install -m 644 man/starforth.1 $(MANDIR)/starforth.1; \ + echo " ✓ Man page installed: $(MANDIR)/starforth.1"; \ + fi + @if [ -f docs/starforth.info ]; then \ + install -d $(INFODIR); \ + install -m 644 docs/starforth.info $(INFODIR)/starforth.info; \ + install-info --info-dir=$(INFODIR) $(INFODIR)/starforth.info 2>/dev/null || true; \ + echo " ✓ Info docs installed: $(INFODIR)/starforth.info"; \ + fi + @install -d $(DOCDIR) + @if [ -f README.md ]; then install -m 644 README.md $(DOCDIR)/; fi + @if [ -f QUICKSTART.md ]; then install -m 644 QUICKSTART.md $(DOCDIR)/; fi + @if ls docs/*.md >/dev/null 2>&1; then install -m 644 docs/*.md $(DOCDIR)/ 2>/dev/null || true; fi + @echo " ✓ Documentation installed: $(DOCDIR)/" + @echo "✅ Installation complete!" + +uninstall: + @echo "🗑️ Uninstalling StarForth from $(PREFIX)..." + @rm -f $(BINDIR)/starforth + @rm -f $(MANDIR)/starforth.1 + @install-info --delete --info-dir=$(INFODIR) $(INFODIR)/starforth.info 2>/dev/null || true + @rm -f $(INFODIR)/starforth.info + @rm -rf $(DOCDIR) + @rm -rf $(CONFDIR) + @echo "✅ Uninstall complete!" + +# ============================================================================== +# PACKAGING +# ============================================================================== + +# Build Debian package +deb: $(BINARY) + @echo "📦 Building Debian package..." + @if ! command -v fpm >/dev/null 2>&1; then \ + echo "Error: fpm not found. Install with: gem install fpm"; \ + echo " or: sudo apt-get install ruby-dev && gem install fpm"; \ + exit 1; \ + fi + @mkdir -p package/deb + @fpm -s dir -t deb \ + -n starforth \ + -v $(VERSION) \ + -a native \ + --description "StarForth - The Fastest Forth in the West" \ + --url "https://github.com/yourusername/starforth" \ + --maintainer "StarForth Team" \ + --license "MIT" \ + --category "devel" \ + --package package/deb/ \ + --deb-compression xz \ + $(BINARY)=/usr/bin/starforth \ + capsules/init.4th=/etc/starforth/init.4th \ + README.md=/usr/share/doc/starforth/README.md + @echo "✅ Debian package created: package/deb/starforth_$(VERSION)_*.deb" + +# Build RPM package +rpm: $(BINARY) + @echo "📦 Building RPM package..." + @if ! command -v fpm >/dev/null 2>&1; then \ + echo "Error: fpm not found. Install with: gem install fpm"; \ + exit 1; \ + fi + @mkdir -p package/rpm + @fpm -s dir -t rpm \ + -n starforth \ + -v $(VERSION) \ + -a native \ + --description "StarForth - The Fastest Forth in the West" \ + --url "https://github.com/yourusername/starforth" \ + --maintainer "StarForth Team" \ + --license "MIT" \ + --category "Development/Languages" \ + --package package/rpm/ \ + $(BINARY)=/usr/bin/starforth \ + capsules/init.4th=/etc/starforth/init.4th \ + README.md=/usr/share/doc/starforth/README.md + @echo "✅ RPM package created: package/rpm/starforth-$(VERSION)-*.rpm" + +# Build all packages +package: deb rpm + @echo "" + @echo "✅ All packages built successfully!" + @echo " Debian: package/deb/" + @echo " RPM: package/rpm/" + +# ============================================================================== +# VERSIONING & BUILD MANIFEST (Workflow/Governance Integration) +# ============================================================================== + +# Parse version from v3/include/version.h +GET_VERSION = $(shell grep "define STARFORTH_VERSION" v3/include/version.h | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1) + +.PHONY: version-info +version-info: + @echo "Current Version: $(GET_VERSION)" + @grep "STARFORTH_VERSION" v3/include/version.h | grep define + +.PHONY: build-manifest +build-manifest: $(BINARY) + @echo "📋 Generating BUILD_MANIFEST.json..." + @mkdir -p builds/manifest + @VERSION=$$(grep "STARFORTH_VERSION_STRING" v3/include/version.h | grep -o '"[^"]*"' | tr -d '"'); \ + GIT_HASH=$$(git rev-parse --short HEAD 2>/dev/null || echo "0000000"); \ + GIT_BRANCH=$$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown"); \ + BUILD_TIME=$$(date -Iseconds); \ + BINARY_PATH="$(BINARY)"; \ + if [ -f "$$BINARY_PATH" ]; then \ + BINARY_SHA256=$$(sha256sum "$$BINARY_PATH" | awk '{print $$1}'); \ + else \ + BINARY_SHA256="not-built"; \ + fi; \ + cat > builds/manifest/BUILD_MANIFEST.json << EOF; \ +{ \ + "version": "$$VERSION", \ + "timestamp": "$$BUILD_TIME", \ + "git": { \ + "commit_hash": "$$GIT_HASH", \ + "branch": "$$GIT_BRANCH", \ + "tag": "v$$VERSION" \ + }, \ + "build": { \ + "timestamp": "$$BUILD_TIME", \ + "compiler": "$$(gcc --version | head -1)", \ + "compiler_flags": "$(CFLAGS) $(ARCH_FLAGS)", \ + "target_architecture": "$(ARCH_NAME)", \ + "use_asm_opt": $(USE_ASM_OPT), \ + "use_lto": $(USE_LTO) \ + }, \ + "testing": { \ + "total_tests": 936, \ + "passed_tests": 0, \ + "failed_tests": 0, \ + "code_coverage_percent": 0, \ + "smoke_test_result": "N/A" \ + }, \ + "binary": { \ + "path": "$$BINARY_PATH", \ + "sha256": "$$BINARY_SHA256" \ + }, \ + "signatures": { \ + "builder": "jenkins-agent", \ + "approval_timestamp": "$(shell date -Iseconds)" \ + } \ +} \ +EOF + @echo "✓ BUILD_MANIFEST created: builds/manifest/BUILD_MANIFEST.json" + @cat builds/manifest/BUILD_MANIFEST.json | head -20 + +# ============================================================================== +# CLEANUP +# ============================================================================== + +clean: + @echo "🧹 Cleaning build artifacts..." + @rm -rfv build/* + @rm -f v3/src/*.gcda v3/src/word_source/*.gcda v3/src/*.gcno v3/src/word_source/*.gcno + @echo "✓ Clean complete" + +clean-obj: + @echo "🧹 Cleaning object files..." + @find build -name "*.o" -type f -delete 2>/dev/null || true + @echo "✓ Object files cleaned" + +# ============================================================================== +# HELP +# ============================================================================== + +help: + @echo "════════════════════════════════════════════════════════════" + @echo " ⚡ StarForth Build System - Fastest in the West! ⚡" + @echo "════════════════════════════════════════════════════════════" + @echo "" + @echo "🛠️ Variables:" + @echo " ARCH= (default: $(ARCH); canonical directory: $(ARCH_DIR))" + @echo " TARGET= (standard | fast | fastest | turbo)" + @echo "" + @echo "🏆 OPTIMIZATION BUILDS:" + @echo " fastest - Maximum performance (ASM + direct threading + LTO)" + @echo " fast - Fast without LTO (easier debugging)" + @echo " turbo - Assembly optimizations only" + @echo "" + @echo "🥧 PLATFORM-SPECIFIC BUILDS:" + @echo " rpi4 - Native build on Raspberry Pi 4" + @echo " rpi4-cross - Cross-compile from x86_64" + @echo " rpi4-fastest - Maximum optimization for RPi4" + @echo " riscv64-clang - Cross-compile for RISC-V 64 via clang (GCC fails here)" + @echo " minimal - Minimal/embedded build" + @echo "" + @echo "🔧 DEBUG & DEVELOPMENT:" + @echo " all - Standard optimized build (default)" + @echo " debug - Debug build with symbols (-g -O0)" + @echo " profile - Build with profiling support" + @echo " performance - Legacy performance build (use 'fastest')" + @echo "" + @echo "🧪 TESTING & BENCHMARKING:" + @echo " test - Run full test suite" + @echo " bench - Quick benchmark" + @echo " benchmark - Full benchmark suite" + @echo "" + @echo "📝 ANALYSIS & DOCUMENTATION:" + @echo " asm - Generate assembly output" + @echo " sbom - Generate SBOM (Software Bill of Materials, SPDX)" + @echo " docs - Generate all documentation" + @echo " api-docs - Generate API docs (Doxygen → AsciiDoc)" + @echo " docs-latex - Convert AsciiDoc to LaTeX" + @echo " docs-isabelle - Generate Isabelle documentation for auditing (includes build log)" + @echo " isabelle-build - Build and verify Isabelle formal theories (strict verification)" + @echo " isabelle-check - Quick-check Isabelle theories" + @echo " info - Build GNU info documentation" + @echo "" + @echo "🔬 REFINEMENT VERIFICATION (C ⊑ Isabelle):" + @echo " refinement-init - Initialize refinement tracking (CAPA + annotations)" + @echo " refinement-status - Show refinement defect summary and phase status" + @echo " refinement-phase1 - Build Phase 1 refinement proofs (vm.c core)" + @echo " verify-defect - Verify specific defect (Usage: make verify-defect DEFECT=001)" + @echo " refinement-annotate-check - Check code annotation coverage" + @echo " refinement-report - Generate refinement status report" + @echo "" + @echo "📦 INSTALLATION & PACKAGING:" + @echo " install - Install to PREFIX (default: .)" + @echo " uninstall - Uninstall from PREFIX" + @echo " deb - Build Debian package" + @echo " rpm - Build RPM package" + @echo " package - Build all packages" + @echo "" + @echo "🧹 CLEANUP:" + @echo " clean - Remove all build artifacts" + @echo " clean-obj - Remove object files only" + @echo " clean-docs - Remove generated documentation" + @echo "" + @echo "⚙️ CONFIGURATION VARIABLES:" + @echo " CC - Compiler (default: gcc)" + @echo " CFLAGS - Compiler flags (override defaults)" + @echo " LDFLAGS - Linker flags (override defaults)" + @echo " PREFIX - Install prefix (default: .)" + @echo " MINIMAL=1 - Minimal build mode (DISABLED -- incomplete, errors out)" + @echo " ASM=1 - Generate assembly files during build" + @echo "" + @echo "📋 EXAMPLES:" + @echo " make fastest # Fastest build for current platform" + @echo " make rpi4-cross # Cross-compile for Raspberry Pi 4" + @echo " make riscv64-clang # Cross-compile for RISC-V 64 (clang)" + @echo " make asm # Generate assembly for inspection" + @echo " make debug # Debug build" + @echo " make PREFIX=/usr/local install # Install system-wide" + @echo "" + @echo "🌟 CURRENT PLATFORM: $(ARCH_NAME)" + @echo "════════════════════════════════════════════════════════════" + +quality: compile_commands clang_tidy cppcheck gcc_analyzer + +compile_commands: + bear --output build/compile_commands.json -- make -j$(nproc) + +clang_tidy: + clang-tidy -p build $(shell find src -name '*.c' -o -name '*.h') | tee build/clang-tidy.txt + +cppcheck: + cppcheck --enable=all --inconclusive --std=c99 src 2> build/cppcheck.txt || true + +gcc_analyzer: + $(MAKE) -f v3/Makefile clean + CFLAGS="$(CFLAGS) -fanalyzer -Wall -Wextra" $(MAKE) -f v3/Makefile all 2>&1 | tee build/gcc-analyzer.txt diff --git a/include/README.md b/v3/include/README.md similarity index 100% rename from include/README.md rename to v3/include/README.md diff --git a/include/arch_detect.h b/v3/include/arch_detect.h similarity index 100% rename from include/arch_detect.h rename to v3/include/arch_detect.h diff --git a/include/blkcfg.h b/v3/include/blkcfg.h similarity index 100% rename from include/blkcfg.h rename to v3/include/blkcfg.h diff --git a/include/blkio.h b/v3/include/blkio.h similarity index 100% rename from include/blkio.h rename to v3/include/blkio.h diff --git a/include/blkio_factory.h b/v3/include/blkio_factory.h similarity index 100% rename from include/blkio_factory.h rename to v3/include/blkio_factory.h diff --git a/include/block_subsystem.h b/v3/include/block_subsystem.h similarity index 100% rename from include/block_subsystem.h rename to v3/include/block_subsystem.h diff --git a/include/cli.h b/v3/include/cli.h similarity index 100% rename from include/cli.h rename to v3/include/cli.h diff --git a/include/compudynamics.h b/v3/include/compudynamics.h similarity index 100% rename from include/compudynamics.h rename to v3/include/compudynamics.h diff --git a/include/dictionary_heat_optimization.h b/v3/include/dictionary_heat_optimization.h similarity index 100% rename from include/dictionary_heat_optimization.h rename to v3/include/dictionary_heat_optimization.h diff --git a/include/dictionary_management.h b/v3/include/dictionary_management.h similarity index 100% rename from include/dictionary_management.h rename to v3/include/dictionary_management.h diff --git a/include/doe_metrics.h b/v3/include/doe_metrics.h similarity index 100% rename from include/doe_metrics.h rename to v3/include/doe_metrics.h diff --git a/include/inference_engine.h b/v3/include/inference_engine.h similarity index 100% rename from include/inference_engine.h rename to v3/include/inference_engine.h diff --git a/include/io.h b/v3/include/io.h similarity index 100% rename from include/io.h rename to v3/include/io.h diff --git a/include/log.h b/v3/include/log.h similarity index 100% rename from include/log.h rename to v3/include/log.h diff --git a/include/math_portable.h b/v3/include/math_portable.h similarity index 100% rename from include/math_portable.h rename to v3/include/math_portable.h diff --git a/include/memory_management.h b/v3/include/memory_management.h similarity index 100% rename from include/memory_management.h rename to v3/include/memory_management.h diff --git a/include/physics_execution_hooks.h b/v3/include/physics_execution_hooks.h similarity index 100% rename from include/physics_execution_hooks.h rename to v3/include/physics_execution_hooks.h diff --git a/include/physics_hotwords_cache.h b/v3/include/physics_hotwords_cache.h similarity index 100% rename from include/physics_hotwords_cache.h rename to v3/include/physics_hotwords_cache.h diff --git a/include/physics_metadata.h b/v3/include/physics_metadata.h similarity index 100% rename from include/physics_metadata.h rename to v3/include/physics_metadata.h diff --git a/include/physics_pipelining_metrics.h b/v3/include/physics_pipelining_metrics.h similarity index 100% rename from include/physics_pipelining_metrics.h rename to v3/include/physics_pipelining_metrics.h diff --git a/include/physics_runtime.h b/v3/include/physics_runtime.h similarity index 100% rename from include/physics_runtime.h rename to v3/include/physics_runtime.h diff --git a/include/platform_alloc.h b/v3/include/platform_alloc.h similarity index 100% rename from include/platform_alloc.h rename to v3/include/platform_alloc.h diff --git a/include/platform_io.h b/v3/include/platform_io.h similarity index 100% rename from include/platform_io.h rename to v3/include/platform_io.h diff --git a/include/platform_lock.h b/v3/include/platform_lock.h similarity index 100% rename from include/platform_lock.h rename to v3/include/platform_lock.h diff --git a/include/platform_time.h b/v3/include/platform_time.h similarity index 100% rename from include/platform_time.h rename to v3/include/platform_time.h diff --git a/include/profiler.h b/v3/include/profiler.h similarity index 100% rename from include/profiler.h rename to v3/include/profiler.h diff --git a/include/q48_16.h b/v3/include/q48_16.h similarity index 100% rename from include/q48_16.h rename to v3/include/q48_16.h diff --git a/include/repl.h b/v3/include/repl.h similarity index 100% rename from include/repl.h rename to v3/include/repl.h diff --git a/include/rolling_window_knobs.h b/v3/include/rolling_window_knobs.h similarity index 100% rename from include/rolling_window_knobs.h rename to v3/include/rolling_window_knobs.h diff --git a/include/rolling_window_of_truth.h b/v3/include/rolling_window_of_truth.h similarity index 100% rename from include/rolling_window_of_truth.h rename to v3/include/rolling_window_of_truth.h diff --git a/include/ssm_jacquard.h b/v3/include/ssm_jacquard.h similarity index 100% rename from include/ssm_jacquard.h rename to v3/include/ssm_jacquard.h diff --git a/include/starforth_config.h b/v3/include/starforth_config.h similarity index 100% rename from include/starforth_config.h rename to v3/include/starforth_config.h diff --git a/include/startup.h b/v3/include/startup.h similarity index 100% rename from include/startup.h rename to v3/include/startup.h diff --git a/v3/include/version.h b/v3/include/version.h new file mode 100644 index 00000000..6603a0b5 --- /dev/null +++ b/v3/include/version.h @@ -0,0 +1,10 @@ +#ifndef STARFORTH_VERSION_H +#define STARFORTH_VERSION_H + +#define STARFORTH_VERSION "3.2.0" +#define STARFORTH_ARCH "x86_64" +#define STARFORTH_TARGET "standard" +#define STARFORTH_TIMESTAMP "2026-10-01T15:21:25-04:00" +#define STARFORTH_VERSION_FULL "StarForth v3.2.0 x86_64 standard 2026-10-01T15:21:25-04:00" + +#endif /* STARFORTH_VERSION_H */ diff --git a/include/vm.h b/v3/include/vm.h similarity index 100% rename from include/vm.h rename to v3/include/vm.h diff --git a/include/vm_api.h b/v3/include/vm_api.h similarity index 100% rename from include/vm_api.h rename to v3/include/vm_api.h diff --git a/include/vm_asm_opt.h b/v3/include/vm_asm_opt.h similarity index 100% rename from include/vm_asm_opt.h rename to v3/include/vm_asm_opt.h diff --git a/include/vm_asm_opt_arm64.h b/v3/include/vm_asm_opt_arm64.h similarity index 100% rename from include/vm_asm_opt_arm64.h rename to v3/include/vm_asm_opt_arm64.h diff --git a/include/vm_asm_opt_riscv64.h b/v3/include/vm_asm_opt_riscv64.h similarity index 100% rename from include/vm_asm_opt_riscv64.h rename to v3/include/vm_asm_opt_riscv64.h diff --git a/include/vm_debug.h b/v3/include/vm_debug.h similarity index 100% rename from include/vm_debug.h rename to v3/include/vm_debug.h diff --git a/include/vm_host.h b/v3/include/vm_host.h similarity index 100% rename from include/vm_host.h rename to v3/include/vm_host.h diff --git a/include/vm_inner_interp_arm64.h b/v3/include/vm_inner_interp_arm64.h similarity index 100% rename from include/vm_inner_interp_arm64.h rename to v3/include/vm_inner_interp_arm64.h diff --git a/include/vm_inner_interp_asm.h b/v3/include/vm_inner_interp_asm.h similarity index 100% rename from include/vm_inner_interp_asm.h rename to v3/include/vm_inner_interp_asm.h diff --git a/include/vm_inner_interp_riscv64.h b/v3/include/vm_inner_interp_riscv64.h similarity index 100% rename from include/vm_inner_interp_riscv64.h rename to v3/include/vm_inner_interp_riscv64.h diff --git a/include/word_registry.h b/v3/include/word_registry.h similarity index 100% rename from include/word_registry.h rename to v3/include/word_registry.h diff --git a/src/README.md b/v3/src/README.md similarity index 100% rename from src/README.md rename to v3/src/README.md diff --git a/src/blkio_factory.c b/v3/src/blkio_factory.c similarity index 100% rename from src/blkio_factory.c rename to v3/src/blkio_factory.c diff --git a/src/blkio_file.c b/v3/src/blkio_file.c similarity index 100% rename from src/blkio_file.c rename to v3/src/blkio_file.c diff --git a/src/blkio_ram.c b/v3/src/blkio_ram.c similarity index 100% rename from src/blkio_ram.c rename to v3/src/blkio_ram.c diff --git a/src/block_subsystem.c b/v3/src/block_subsystem.c similarity index 100% rename from src/block_subsystem.c rename to v3/src/block_subsystem.c diff --git a/src/cli.c b/v3/src/cli.c similarity index 100% rename from src/cli.c rename to v3/src/cli.c diff --git a/src/compudynamics.c b/v3/src/compudynamics.c similarity index 100% rename from src/compudynamics.c rename to v3/src/compudynamics.c diff --git a/src/dictionary_heat_optimization.c b/v3/src/dictionary_heat_optimization.c similarity index 100% rename from src/dictionary_heat_optimization.c rename to v3/src/dictionary_heat_optimization.c diff --git a/src/dictionary_management.c b/v3/src/dictionary_management.c similarity index 100% rename from src/dictionary_management.c rename to v3/src/dictionary_management.c diff --git a/src/doe_metrics.c b/v3/src/doe_metrics.c similarity index 100% rename from src/doe_metrics.c rename to v3/src/doe_metrics.c diff --git a/src/heartbeat_export.c b/v3/src/heartbeat_export.c similarity index 100% rename from src/heartbeat_export.c rename to v3/src/heartbeat_export.c diff --git a/src/inference_engine.c b/v3/src/inference_engine.c similarity index 100% rename from src/inference_engine.c rename to v3/src/inference_engine.c diff --git a/src/io.c b/v3/src/io.c similarity index 100% rename from src/io.c rename to v3/src/io.c diff --git a/src/log.c b/v3/src/log.c similarity index 100% rename from src/log.c rename to v3/src/log.c diff --git a/src/main.c b/v3/src/main.c similarity index 100% rename from src/main.c rename to v3/src/main.c diff --git a/src/math_portable.c b/v3/src/math_portable.c similarity index 100% rename from src/math_portable.c rename to v3/src/math_portable.c diff --git a/src/memory_management.c b/v3/src/memory_management.c similarity index 100% rename from src/memory_management.c rename to v3/src/memory_management.c diff --git a/src/physics_execution_hooks.c b/v3/src/physics_execution_hooks.c similarity index 100% rename from src/physics_execution_hooks.c rename to v3/src/physics_execution_hooks.c diff --git a/src/physics_hotwords_cache.c b/v3/src/physics_hotwords_cache.c similarity index 100% rename from src/physics_hotwords_cache.c rename to v3/src/physics_hotwords_cache.c diff --git a/src/physics_metadata.c b/v3/src/physics_metadata.c similarity index 100% rename from src/physics_metadata.c rename to v3/src/physics_metadata.c diff --git a/src/physics_pipelining_metrics.c b/v3/src/physics_pipelining_metrics.c similarity index 100% rename from src/physics_pipelining_metrics.c rename to v3/src/physics_pipelining_metrics.c diff --git a/src/physics_runtime.c b/v3/src/physics_runtime.c similarity index 100% rename from src/physics_runtime.c rename to v3/src/physics_runtime.c diff --git a/src/platform/README.md b/v3/src/platform/README.md similarity index 100% rename from src/platform/README.md rename to v3/src/platform/README.md diff --git a/src/platform/alloc_host.c b/v3/src/platform/alloc_host.c similarity index 100% rename from src/platform/alloc_host.c rename to v3/src/platform/alloc_host.c diff --git a/src/platform/alloc_kernel.c b/v3/src/platform/alloc_kernel.c similarity index 100% rename from src/platform/alloc_kernel.c rename to v3/src/platform/alloc_kernel.c diff --git a/src/platform/l4re/README.md b/v3/src/platform/l4re/README.md similarity index 100% rename from src/platform/l4re/README.md rename to v3/src/platform/l4re/README.md diff --git a/src/platform/l4re/time.c b/v3/src/platform/l4re/time.c similarity index 100% rename from src/platform/l4re/time.c rename to v3/src/platform/l4re/time.c diff --git a/src/platform/linux/README.md b/v3/src/platform/linux/README.md similarity index 100% rename from src/platform/linux/README.md rename to v3/src/platform/linux/README.md diff --git a/src/platform/linux/io.c b/v3/src/platform/linux/io.c similarity index 100% rename from src/platform/linux/io.c rename to v3/src/platform/linux/io.c diff --git a/src/platform/linux/time.c b/v3/src/platform/linux/time.c similarity index 100% rename from src/platform/linux/time.c rename to v3/src/platform/linux/time.c diff --git a/src/platform/platform_init.c b/v3/src/platform/platform_init.c similarity index 100% rename from src/platform/platform_init.c rename to v3/src/platform/platform_init.c diff --git a/src/platform/threading.c b/v3/src/platform/threading.c similarity index 100% rename from src/platform/threading.c rename to v3/src/platform/threading.c diff --git a/src/profiler.c b/v3/src/profiler.c similarity index 100% rename from src/profiler.c rename to v3/src/profiler.c diff --git a/src/repl.c b/v3/src/repl.c similarity index 100% rename from src/repl.c rename to v3/src/repl.c diff --git a/src/rolling_window_of_truth.c b/v3/src/rolling_window_of_truth.c similarity index 100% rename from src/rolling_window_of_truth.c rename to v3/src/rolling_window_of_truth.c diff --git a/src/ssm_jacquard.c b/v3/src/ssm_jacquard.c similarity index 100% rename from src/ssm_jacquard.c rename to v3/src/ssm_jacquard.c diff --git a/src/stack_management.c b/v3/src/stack_management.c similarity index 100% rename from src/stack_management.c rename to v3/src/stack_management.c diff --git a/src/test_runner/README.md b/v3/src/test_runner/README.md similarity index 100% rename from src/test_runner/README.md rename to v3/src/test_runner/README.md diff --git a/src/test_runner/include/README.md b/v3/src/test_runner/include/README.md similarity index 100% rename from src/test_runner/include/README.md rename to v3/src/test_runner/include/README.md diff --git a/src/test_runner/include/test_common.h b/v3/src/test_runner/include/test_common.h similarity index 99% rename from src/test_runner/include/test_common.h rename to v3/src/test_runner/include/test_common.h index c6154902..aa8942ab 100644 --- a/src/test_runner/include/test_common.h +++ b/v3/src/test_runner/include/test_common.h @@ -50,8 +50,8 @@ #ifndef TEST_COMMON_H #define TEST_COMMON_H -#include "../include/vm.h" -#include "../include/log.h" +#include "../../../include/vm.h" +#include "../../../include/log.h" #include "test_contracts.h" /** @name Test Configuration diff --git a/src/test_runner/include/test_contracts.h b/v3/src/test_runner/include/test_contracts.h similarity index 100% rename from src/test_runner/include/test_contracts.h rename to v3/src/test_runner/include/test_contracts.h diff --git a/src/test_runner/include/test_runner.h b/v3/src/test_runner/include/test_runner.h similarity index 100% rename from src/test_runner/include/test_runner.h rename to v3/src/test_runner/include/test_runner.h diff --git a/src/test_runner/modules/README.md b/v3/src/test_runner/modules/README.md similarity index 100% rename from src/test_runner/modules/README.md rename to v3/src/test_runner/modules/README.md diff --git a/src/test_runner/modules/acl_words_test.c b/v3/src/test_runner/modules/acl_words_test.c similarity index 100% rename from src/test_runner/modules/acl_words_test.c rename to v3/src/test_runner/modules/acl_words_test.c diff --git a/src/test_runner/modules/arithmetic_words_test.c b/v3/src/test_runner/modules/arithmetic_words_test.c similarity index 100% rename from src/test_runner/modules/arithmetic_words_test.c rename to v3/src/test_runner/modules/arithmetic_words_test.c diff --git a/src/test_runner/modules/block_words_test.c b/v3/src/test_runner/modules/block_words_test.c similarity index 100% rename from src/test_runner/modules/block_words_test.c rename to v3/src/test_runner/modules/block_words_test.c diff --git a/src/test_runner/modules/break_me_tests.c b/v3/src/test_runner/modules/break_me_tests.c similarity index 100% rename from src/test_runner/modules/break_me_tests.c rename to v3/src/test_runner/modules/break_me_tests.c diff --git a/src/test_runner/modules/control_words_test.c b/v3/src/test_runner/modules/control_words_test.c similarity index 100% rename from src/test_runner/modules/control_words_test.c rename to v3/src/test_runner/modules/control_words_test.c diff --git a/src/test_runner/modules/defining_words_tests.c b/v3/src/test_runner/modules/defining_words_tests.c similarity index 100% rename from src/test_runner/modules/defining_words_tests.c rename to v3/src/test_runner/modules/defining_words_tests.c diff --git a/src/test_runner/modules/dictionary_manipulation_words_test.c b/v3/src/test_runner/modules/dictionary_manipulation_words_test.c similarity index 100% rename from src/test_runner/modules/dictionary_manipulation_words_test.c rename to v3/src/test_runner/modules/dictionary_manipulation_words_test.c diff --git a/src/test_runner/modules/dictionary_words_test.c b/v3/src/test_runner/modules/dictionary_words_test.c similarity index 100% rename from src/test_runner/modules/dictionary_words_test.c rename to v3/src/test_runner/modules/dictionary_words_test.c diff --git a/src/test_runner/modules/double_words_test.c b/v3/src/test_runner/modules/double_words_test.c similarity index 100% rename from src/test_runner/modules/double_words_test.c rename to v3/src/test_runner/modules/double_words_test.c diff --git a/src/test_runner/modules/format_words_test.c b/v3/src/test_runner/modules/format_words_test.c similarity index 100% rename from src/test_runner/modules/format_words_test.c rename to v3/src/test_runner/modules/format_words_test.c diff --git a/src/test_runner/modules/inference_words_test.c b/v3/src/test_runner/modules/inference_words_test.c similarity index 100% rename from src/test_runner/modules/inference_words_test.c rename to v3/src/test_runner/modules/inference_words_test.c diff --git a/src/test_runner/modules/integration_tests.c b/v3/src/test_runner/modules/integration_tests.c similarity index 100% rename from src/test_runner/modules/integration_tests.c rename to v3/src/test_runner/modules/integration_tests.c diff --git a/src/test_runner/modules/io_words_test.c b/v3/src/test_runner/modules/io_words_test.c similarity index 100% rename from src/test_runner/modules/io_words_test.c rename to v3/src/test_runner/modules/io_words_test.c diff --git a/src/test_runner/modules/logical_words_test.c b/v3/src/test_runner/modules/logical_words_test.c similarity index 100% rename from src/test_runner/modules/logical_words_test.c rename to v3/src/test_runner/modules/logical_words_test.c diff --git a/src/test_runner/modules/mama_forth_words_test.c b/v3/src/test_runner/modules/mama_forth_words_test.c similarity index 100% rename from src/test_runner/modules/mama_forth_words_test.c rename to v3/src/test_runner/modules/mama_forth_words_test.c diff --git a/src/test_runner/modules/memory_words_test.c b/v3/src/test_runner/modules/memory_words_test.c similarity index 100% rename from src/test_runner/modules/memory_words_test.c rename to v3/src/test_runner/modules/memory_words_test.c diff --git a/src/test_runner/modules/mixed_arithmetic_words_test.c b/v3/src/test_runner/modules/mixed_arithmetic_words_test.c similarity index 100% rename from src/test_runner/modules/mixed_arithmetic_words_test.c rename to v3/src/test_runner/modules/mixed_arithmetic_words_test.c diff --git a/src/test_runner/modules/physics_freeze_words_test.c b/v3/src/test_runner/modules/physics_freeze_words_test.c similarity index 100% rename from src/test_runner/modules/physics_freeze_words_test.c rename to v3/src/test_runner/modules/physics_freeze_words_test.c diff --git a/src/test_runner/modules/q48_words_test.c b/v3/src/test_runner/modules/q48_words_test.c similarity index 100% rename from src/test_runner/modules/q48_words_test.c rename to v3/src/test_runner/modules/q48_words_test.c diff --git a/src/test_runner/modules/return_stack_words_test.c b/v3/src/test_runner/modules/return_stack_words_test.c similarity index 100% rename from src/test_runner/modules/return_stack_words_test.c rename to v3/src/test_runner/modules/return_stack_words_test.c diff --git a/src/test_runner/modules/stack_words_test.c b/v3/src/test_runner/modules/stack_words_test.c similarity index 100% rename from src/test_runner/modules/stack_words_test.c rename to v3/src/test_runner/modules/stack_words_test.c diff --git a/src/test_runner/modules/starforth_words_test.c b/v3/src/test_runner/modules/starforth_words_test.c similarity index 100% rename from src/test_runner/modules/starforth_words_test.c rename to v3/src/test_runner/modules/starforth_words_test.c diff --git a/src/test_runner/modules/stress_tests.c b/v3/src/test_runner/modules/stress_tests.c similarity index 100% rename from src/test_runner/modules/stress_tests.c rename to v3/src/test_runner/modules/stress_tests.c diff --git a/src/test_runner/modules/string_words_test.c b/v3/src/test_runner/modules/string_words_test.c similarity index 100% rename from src/test_runner/modules/string_words_test.c rename to v3/src/test_runner/modules/string_words_test.c diff --git a/src/test_runner/modules/system_words_test.c b/v3/src/test_runner/modules/system_words_test.c similarity index 100% rename from src/test_runner/modules/system_words_test.c rename to v3/src/test_runner/modules/system_words_test.c diff --git a/src/test_runner/modules/vocabulary_words_test.c b/v3/src/test_runner/modules/vocabulary_words_test.c similarity index 100% rename from src/test_runner/modules/vocabulary_words_test.c rename to v3/src/test_runner/modules/vocabulary_words_test.c diff --git a/src/test_runner/test_common.c b/v3/src/test_runner/test_common.c similarity index 100% rename from src/test_runner/test_common.c rename to v3/src/test_runner/test_common.c diff --git a/src/test_runner/test_contracts.c b/v3/src/test_runner/test_contracts.c similarity index 100% rename from src/test_runner/test_contracts.c rename to v3/src/test_runner/test_contracts.c diff --git a/src/test_runner/test_runner.c b/v3/src/test_runner/test_runner.c similarity index 100% rename from src/test_runner/test_runner.c rename to v3/src/test_runner/test_runner.c diff --git a/src/vm.c b/v3/src/vm.c similarity index 100% rename from src/vm.c rename to v3/src/vm.c diff --git a/src/vm_api.c b/v3/src/vm_api.c similarity index 100% rename from src/vm_api.c rename to v3/src/vm_api.c diff --git a/src/vm_bootstrap.c b/v3/src/vm_bootstrap.c similarity index 99% rename from src/vm_bootstrap.c rename to v3/src/vm_bootstrap.c index b933918e..f0e7d0f3 100644 --- a/src/vm_bootstrap.c +++ b/v3/src/vm_bootstrap.c @@ -65,8 +65,8 @@ #include "word_source/include/vocabulary_words.h" #ifdef __STARKERNEL__ -#include "../include/starkernel/capsule_birth.h" -#include "../include/starkernel/capsule_run.h" +#include "starkernel/capsule_birth.h" +#include "starkernel/capsule_run.h" #endif #include diff --git a/src/vm_debug.c b/v3/src/vm_debug.c similarity index 100% rename from src/vm_debug.c rename to v3/src/vm_debug.c diff --git a/src/vm_internal.h b/v3/src/vm_internal.h similarity index 100% rename from src/vm_internal.h rename to v3/src/vm_internal.h diff --git a/src/vm_time.c b/v3/src/vm_time.c similarity index 100% rename from src/vm_time.c rename to v3/src/vm_time.c diff --git a/src/word_registry.c b/v3/src/word_registry.c similarity index 100% rename from src/word_registry.c rename to v3/src/word_registry.c diff --git a/src/word_source/README.md b/v3/src/word_source/README.md similarity index 100% rename from src/word_source/README.md rename to v3/src/word_source/README.md diff --git a/src/word_source/acl_words.c b/v3/src/word_source/acl_words.c similarity index 100% rename from src/word_source/acl_words.c rename to v3/src/word_source/acl_words.c diff --git a/src/word_source/arithmetic_words.c b/v3/src/word_source/arithmetic_words.c similarity index 100% rename from src/word_source/arithmetic_words.c rename to v3/src/word_source/arithmetic_words.c diff --git a/src/word_source/block_words.c b/v3/src/word_source/block_words.c similarity index 100% rename from src/word_source/block_words.c rename to v3/src/word_source/block_words.c diff --git a/src/word_source/control_words.c b/v3/src/word_source/control_words.c similarity index 100% rename from src/word_source/control_words.c rename to v3/src/word_source/control_words.c diff --git a/src/word_source/defer_words.c b/v3/src/word_source/defer_words.c similarity index 100% rename from src/word_source/defer_words.c rename to v3/src/word_source/defer_words.c diff --git a/src/word_source/defining_words.c b/v3/src/word_source/defining_words.c similarity index 100% rename from src/word_source/defining_words.c rename to v3/src/word_source/defining_words.c diff --git a/src/word_source/dictionary_heat_diagnostic_words.c b/v3/src/word_source/dictionary_heat_diagnostic_words.c similarity index 100% rename from src/word_source/dictionary_heat_diagnostic_words.c rename to v3/src/word_source/dictionary_heat_diagnostic_words.c diff --git a/src/word_source/dictionary_manipulation_words.c b/v3/src/word_source/dictionary_manipulation_words.c similarity index 100% rename from src/word_source/dictionary_manipulation_words.c rename to v3/src/word_source/dictionary_manipulation_words.c diff --git a/src/word_source/dictionary_words.c b/v3/src/word_source/dictionary_words.c similarity index 100% rename from src/word_source/dictionary_words.c rename to v3/src/word_source/dictionary_words.c diff --git a/src/word_source/double_words.c b/v3/src/word_source/double_words.c similarity index 100% rename from src/word_source/double_words.c rename to v3/src/word_source/double_words.c diff --git a/src/word_source/editor_words.c b/v3/src/word_source/editor_words.c similarity index 100% rename from src/word_source/editor_words.c rename to v3/src/word_source/editor_words.c diff --git a/src/word_source/format_words.c b/v3/src/word_source/format_words.c similarity index 100% rename from src/word_source/format_words.c rename to v3/src/word_source/format_words.c diff --git a/src/word_source/framebuffer_words.c b/v3/src/word_source/framebuffer_words.c similarity index 100% rename from src/word_source/framebuffer_words.c rename to v3/src/word_source/framebuffer_words.c diff --git a/src/word_source/include/README.md b/v3/src/word_source/include/README.md similarity index 100% rename from src/word_source/include/README.md rename to v3/src/word_source/include/README.md diff --git a/src/word_source/include/acl_words.h b/v3/src/word_source/include/acl_words.h similarity index 100% rename from src/word_source/include/acl_words.h rename to v3/src/word_source/include/acl_words.h diff --git a/src/word_source/include/arithmetic_words.h b/v3/src/word_source/include/arithmetic_words.h similarity index 100% rename from src/word_source/include/arithmetic_words.h rename to v3/src/word_source/include/arithmetic_words.h diff --git a/src/word_source/include/block_words.h b/v3/src/word_source/include/block_words.h similarity index 100% rename from src/word_source/include/block_words.h rename to v3/src/word_source/include/block_words.h diff --git a/src/word_source/include/control_words.h b/v3/src/word_source/include/control_words.h similarity index 100% rename from src/word_source/include/control_words.h rename to v3/src/word_source/include/control_words.h diff --git a/src/word_source/include/defer_words.h b/v3/src/word_source/include/defer_words.h similarity index 89% rename from src/word_source/include/defer_words.h rename to v3/src/word_source/include/defer_words.h index cc24580b..1015e3d0 100644 --- a/src/word_source/include/defer_words.h +++ b/v3/src/word_source/include/defer_words.h @@ -10,7 +10,7 @@ #ifndef DEFER_WORDS_H #define DEFER_WORDS_H -#include "../../include/vm.h" +#include "../../../include/vm.h" void register_defer_words(VM *vm); diff --git a/src/word_source/include/defining_words.h b/v3/src/word_source/include/defining_words.h similarity index 100% rename from src/word_source/include/defining_words.h rename to v3/src/word_source/include/defining_words.h diff --git a/src/word_source/include/dictionary_heat_diagnostic_words.h b/v3/src/word_source/include/dictionary_heat_diagnostic_words.h similarity index 100% rename from src/word_source/include/dictionary_heat_diagnostic_words.h rename to v3/src/word_source/include/dictionary_heat_diagnostic_words.h diff --git a/src/word_source/include/dictionary_manipulation_words.h b/v3/src/word_source/include/dictionary_manipulation_words.h similarity index 100% rename from src/word_source/include/dictionary_manipulation_words.h rename to v3/src/word_source/include/dictionary_manipulation_words.h diff --git a/src/word_source/include/dictionary_words.h b/v3/src/word_source/include/dictionary_words.h similarity index 100% rename from src/word_source/include/dictionary_words.h rename to v3/src/word_source/include/dictionary_words.h diff --git a/src/word_source/include/double_words.h b/v3/src/word_source/include/double_words.h similarity index 100% rename from src/word_source/include/double_words.h rename to v3/src/word_source/include/double_words.h diff --git a/src/word_source/include/editor_words.h b/v3/src/word_source/include/editor_words.h similarity index 100% rename from src/word_source/include/editor_words.h rename to v3/src/word_source/include/editor_words.h diff --git a/src/word_source/include/format_words.h b/v3/src/word_source/include/format_words.h similarity index 100% rename from src/word_source/include/format_words.h rename to v3/src/word_source/include/format_words.h diff --git a/src/word_source/include/framebuffer_words.h b/v3/src/word_source/include/framebuffer_words.h similarity index 100% rename from src/word_source/include/framebuffer_words.h rename to v3/src/word_source/include/framebuffer_words.h diff --git a/src/word_source/include/inference_words.h b/v3/src/word_source/include/inference_words.h similarity index 100% rename from src/word_source/include/inference_words.h rename to v3/src/word_source/include/inference_words.h diff --git a/src/word_source/include/io_words.h b/v3/src/word_source/include/io_words.h similarity index 100% rename from src/word_source/include/io_words.h rename to v3/src/word_source/include/io_words.h diff --git a/src/word_source/include/keyboard_words.h b/v3/src/word_source/include/keyboard_words.h similarity index 100% rename from src/word_source/include/keyboard_words.h rename to v3/src/word_source/include/keyboard_words.h diff --git a/src/word_source/include/log_words.h b/v3/src/word_source/include/log_words.h similarity index 100% rename from src/word_source/include/log_words.h rename to v3/src/word_source/include/log_words.h diff --git a/src/word_source/include/logical_words.h b/v3/src/word_source/include/logical_words.h similarity index 100% rename from src/word_source/include/logical_words.h rename to v3/src/word_source/include/logical_words.h diff --git a/src/word_source/include/mama_forth_words.h b/v3/src/word_source/include/mama_forth_words.h similarity index 100% rename from src/word_source/include/mama_forth_words.h rename to v3/src/word_source/include/mama_forth_words.h diff --git a/src/word_source/include/memory_words.h b/v3/src/word_source/include/memory_words.h similarity index 100% rename from src/word_source/include/memory_words.h rename to v3/src/word_source/include/memory_words.h diff --git a/src/word_source/include/mixed_arithmetic_words.h b/v3/src/word_source/include/mixed_arithmetic_words.h similarity index 100% rename from src/word_source/include/mixed_arithmetic_words.h rename to v3/src/word_source/include/mixed_arithmetic_words.h diff --git a/src/word_source/include/physics_benchmark_words.h b/v3/src/word_source/include/physics_benchmark_words.h similarity index 100% rename from src/word_source/include/physics_benchmark_words.h rename to v3/src/word_source/include/physics_benchmark_words.h diff --git a/src/word_source/include/physics_diagnostic_words.h b/v3/src/word_source/include/physics_diagnostic_words.h similarity index 100% rename from src/word_source/include/physics_diagnostic_words.h rename to v3/src/word_source/include/physics_diagnostic_words.h diff --git a/src/word_source/include/physics_freeze_words.h b/v3/src/word_source/include/physics_freeze_words.h similarity index 100% rename from src/word_source/include/physics_freeze_words.h rename to v3/src/word_source/include/physics_freeze_words.h diff --git a/src/word_source/include/physics_pipelining_diagnostic_words.h b/v3/src/word_source/include/physics_pipelining_diagnostic_words.h similarity index 100% rename from src/word_source/include/physics_pipelining_diagnostic_words.h rename to v3/src/word_source/include/physics_pipelining_diagnostic_words.h diff --git a/src/word_source/include/q48_words.h b/v3/src/word_source/include/q48_words.h similarity index 100% rename from src/word_source/include/q48_words.h rename to v3/src/word_source/include/q48_words.h diff --git a/src/word_source/include/return_stack_words.h b/v3/src/word_source/include/return_stack_words.h similarity index 100% rename from src/word_source/include/return_stack_words.h rename to v3/src/word_source/include/return_stack_words.h diff --git a/src/word_source/include/scroll_words.h b/v3/src/word_source/include/scroll_words.h similarity index 100% rename from src/word_source/include/scroll_words.h rename to v3/src/word_source/include/scroll_words.h diff --git a/src/word_source/include/stack_words.h b/v3/src/word_source/include/stack_words.h similarity index 100% rename from src/word_source/include/stack_words.h rename to v3/src/word_source/include/stack_words.h diff --git a/src/word_source/include/starforth_words.h b/v3/src/word_source/include/starforth_words.h similarity index 100% rename from src/word_source/include/starforth_words.h rename to v3/src/word_source/include/starforth_words.h diff --git a/src/word_source/include/string_words.h b/v3/src/word_source/include/string_words.h similarity index 100% rename from src/word_source/include/string_words.h rename to v3/src/word_source/include/string_words.h diff --git a/src/word_source/include/system_words.h b/v3/src/word_source/include/system_words.h similarity index 100% rename from src/word_source/include/system_words.h rename to v3/src/word_source/include/system_words.h diff --git a/src/word_source/include/ttf_words.h b/v3/src/word_source/include/ttf_words.h similarity index 100% rename from src/word_source/include/ttf_words.h rename to v3/src/word_source/include/ttf_words.h diff --git a/src/word_source/include/vocabulary_words.h b/v3/src/word_source/include/vocabulary_words.h similarity index 100% rename from src/word_source/include/vocabulary_words.h rename to v3/src/word_source/include/vocabulary_words.h diff --git a/src/word_source/inference_words.c b/v3/src/word_source/inference_words.c similarity index 100% rename from src/word_source/inference_words.c rename to v3/src/word_source/inference_words.c diff --git a/src/word_source/io_words.c b/v3/src/word_source/io_words.c similarity index 100% rename from src/word_source/io_words.c rename to v3/src/word_source/io_words.c diff --git a/src/word_source/keyboard_words.c b/v3/src/word_source/keyboard_words.c similarity index 100% rename from src/word_source/keyboard_words.c rename to v3/src/word_source/keyboard_words.c diff --git a/src/word_source/lifecycle_words_hosted.c b/v3/src/word_source/lifecycle_words_hosted.c similarity index 100% rename from src/word_source/lifecycle_words_hosted.c rename to v3/src/word_source/lifecycle_words_hosted.c diff --git a/src/word_source/log_words.c b/v3/src/word_source/log_words.c similarity index 100% rename from src/word_source/log_words.c rename to v3/src/word_source/log_words.c diff --git a/src/word_source/logical_words.c b/v3/src/word_source/logical_words.c similarity index 100% rename from src/word_source/logical_words.c rename to v3/src/word_source/logical_words.c diff --git a/src/word_source/memory_words.c b/v3/src/word_source/memory_words.c similarity index 100% rename from src/word_source/memory_words.c rename to v3/src/word_source/memory_words.c diff --git a/src/word_source/mixed_arithmetic_words.c b/v3/src/word_source/mixed_arithmetic_words.c similarity index 100% rename from src/word_source/mixed_arithmetic_words.c rename to v3/src/word_source/mixed_arithmetic_words.c diff --git a/src/word_source/physics_benchmark_words.c b/v3/src/word_source/physics_benchmark_words.c similarity index 100% rename from src/word_source/physics_benchmark_words.c rename to v3/src/word_source/physics_benchmark_words.c diff --git a/src/word_source/physics_diagnostic_words.c b/v3/src/word_source/physics_diagnostic_words.c similarity index 100% rename from src/word_source/physics_diagnostic_words.c rename to v3/src/word_source/physics_diagnostic_words.c diff --git a/src/word_source/physics_freeze_words.c b/v3/src/word_source/physics_freeze_words.c similarity index 100% rename from src/word_source/physics_freeze_words.c rename to v3/src/word_source/physics_freeze_words.c diff --git a/src/word_source/physics_pipelining_diagnostic_words.c b/v3/src/word_source/physics_pipelining_diagnostic_words.c similarity index 99% rename from src/word_source/physics_pipelining_diagnostic_words.c rename to v3/src/word_source/physics_pipelining_diagnostic_words.c index 662d9431..1e928c35 100644 --- a/src/word_source/physics_pipelining_diagnostic_words.c +++ b/v3/src/word_source/physics_pipelining_diagnostic_words.c @@ -50,9 +50,9 @@ */ -#include "../include/vm.h" -#include "../include/physics_pipelining_metrics.h" -#include "../include/word_registry.h" +#include "../../include/vm.h" +#include "../../include/physics_pipelining_metrics.h" +#include "../../include/word_registry.h" #include #include #include diff --git a/src/word_source/q48_16_words.c b/v3/src/word_source/q48_16_words.c similarity index 99% rename from src/word_source/q48_16_words.c rename to v3/src/word_source/q48_16_words.c index 0b0279b4..b6e5b190 100644 --- a/src/word_source/q48_16_words.c +++ b/v3/src/word_source/q48_16_words.c @@ -45,7 +45,7 @@ #include #include -#include "../include/q48_16.h" +#include "../../include/q48_16.h" /* ============================================================================ * Core Arithmetic: Multiply diff --git a/src/word_source/q48_words.c b/v3/src/word_source/q48_words.c similarity index 100% rename from src/word_source/q48_words.c rename to v3/src/word_source/q48_words.c diff --git a/src/word_source/return_stack_words.c b/v3/src/word_source/return_stack_words.c similarity index 100% rename from src/word_source/return_stack_words.c rename to v3/src/word_source/return_stack_words.c diff --git a/src/word_source/scroll_words.c b/v3/src/word_source/scroll_words.c similarity index 100% rename from src/word_source/scroll_words.c rename to v3/src/word_source/scroll_words.c diff --git a/src/word_source/stack_words.c b/v3/src/word_source/stack_words.c similarity index 100% rename from src/word_source/stack_words.c rename to v3/src/word_source/stack_words.c diff --git a/src/word_source/starforth_words.c b/v3/src/word_source/starforth_words.c similarity index 100% rename from src/word_source/starforth_words.c rename to v3/src/word_source/starforth_words.c diff --git a/src/word_source/string_words.c b/v3/src/word_source/string_words.c similarity index 100% rename from src/word_source/string_words.c rename to v3/src/word_source/string_words.c diff --git a/src/word_source/system_words.c b/v3/src/word_source/system_words.c similarity index 100% rename from src/word_source/system_words.c rename to v3/src/word_source/system_words.c diff --git a/src/word_source/ttf_words.c b/v3/src/word_source/ttf_words.c similarity index 100% rename from src/word_source/ttf_words.c rename to v3/src/word_source/ttf_words.c diff --git a/src/word_source/vocabulary_words.c b/v3/src/word_source/vocabulary_words.c similarity index 100% rename from src/word_source/vocabulary_words.c rename to v3/src/word_source/vocabulary_words.c diff --git a/v4/README.md b/v4/README.md new file mode 100644 index 00000000..d1beb6b1 --- /dev/null +++ b/v4/README.md @@ -0,0 +1,9 @@ +# v4/ + +StarForth v4: the 32-instruction F18-derived core. The design lives in +`docs/v4.0.0/JUSTIFICATION.md` (why) and `docs/v4.0.0/DECOMPOSITION.md` +(every v3 word mapped to a v4 fate). + +There is no code yet. The first deliverable is the hosted C99 golden model +(`JUSTIFICATION.md` §10, step 1). It must pass POST and hold K≡1.0 with +32- and 64-bit cells on all three host ISAs.