Files
LithosAnanake/Kconfig.kernel
T
Robert Allan JamesandClaude Sonnet 5 eb0fd4fffa starkernel: item 3.2 -- Stadium boot-time allocation
Punch list §25 item 3.2 complete.

stadium_boot_init() (src/starkernel/vm/stadium.c) sizes the global
cell array at boot from a real memory-budget query rather than a
hardcoded count: pmm_get_stats().free_bytes at the point of
allocation, times the new STADIUM_MEMORY_PERCENT Kconfig symbol
(default 1%), rounded down to whole 64-byte cells. Matches §17.6's
position (b) literally. Also allocates the header/continuation
discriminator bitmap item 3.1 declared but did not allocate. Both are
kmalloc'd and explicitly zero-filled (kmalloc does not zero).

Called from kernel_main.c immediately before sk_vm_bootstrap_parity(),
i.e. before any VM exists (§6). Failure is soft -- logs and continues,
does not halt boot -- matching the existing precedent one line below
it (VM bootstrap parity failure does the same).

Added a "Stadium: N cells (M KB)" boot console line at the allocation
site so the acceptance logs are evidence the array was actually
allocated, not just that the kernel still boots -- the same blind spot
item 3.1's uncompiled-header gap exposed.

Verified: three-architecture boot (amd64, aarch64, riscv64), all
reaching ok> with identical dict_hash=0x3d4e1daf289da94f matching the
item-3.1 baseline, and the Stadium boot line confirmed present in all
three serial logs (amd64: 74234 cells/4639 KB, aarch64: 161329
cells/10083 KB, riscv64: 76122 cells/4757 KB).

Not built here, reported per §25.0 rule 3: per-VM free lists (§22.3)
-- granted when Hera assigns quota, not this item's scope.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 16:48:13 -04:00

99 lines
4.0 KiB
Plaintext

menu "Kernel-only options"
if STARFORTH_VARIANT_KERNEL
config STARFORTH_ENABLE_VM
bool "Enable StarForth VM integration, M7 milestone (STARFORTH_ENABLE_VM)"
default y
help
Compiles the full StarForth VM source tree into the kernel image
and enables capsule birth/execution. Disabling this builds a
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.
config PARITY_MODE
bool "Deterministic parity harness mode (PARITY_MODE)"
default n
help
Enables the parity/determinism verification harness used to
compare dict_hash and capsule state across independent runs.
Off by default (normal boot); on for parity-campaign builds.
config SK_PARITY_DEBUG
bool "Verbose parity/vocabulary debug logging (SK_PARITY_DEBUG)"
default n
help
Extra diagnostic logging in vocabulary_words.c and
vm_bootstrap.c's parity paths (src/starkernel/vm/vm_internal.h
guards these with #if defined(__STARKERNEL__) && SK_PARITY_DEBUG).
Previously opt-in-only via VM_FEATURE_FLAG_VARS with no Kconfig
presence at all; promoted here for discoverability, same
treatment as every other previously-unwired constant in this
migration.
config HEARTBEAT_DOE_LOG
bool "Per-tick heartbeat DoE logging (HEARTBEAT_DOE_LOG)"
default y
help
Emits per-heartbeat-tick DoE observation records used by the
bare-metal Design-of-Experiments campaigns
(experiments/bare_metal/). On by default; the DoE tooling expects
this log to be present.
config STADIUM_MAX_VM_COUNT
int "Outer Stadium VM population bound (STADIUM_MAX_VM_COUNT)"
default 4
help
Hard bound on live VMs in the outer Stadium (FABRIC.md item 1.5).
Birth is refused once this many VMs are LIVE simultaneously; a
dead or stillborn VM's registry slot does not count against the
bound. Default of 4 matches Tripod's currently-known topology
(Hera + two Hermes instances + Artemis) -- an explicit placeholder
pending a DoE campaign to find an idealized default (item 5.1),
not a padded estimate.
config STADIUM_CONTAINS_DEPTH_MAX
int "Patron containment chain depth cap (STADIUM_CONTAINS_DEPTH_MAX)"
default 5
help
Hard bound on how many patrons deep a `contains` chain (FABRIC.md
item 1.1, the ninth cell wire) may nest. A patron with a non-none
`contains` link cannot be reaped -- reap-gating enforcement of
this bound is item 3.5's scope, not yet implemented. Distinct
from the already-implemented VM-Stadium nesting depth (item 1.7,
default 2): that bounds VMs nested inside VMs, this bounds
patrons held inside patrons within one Stadium.
config STADIUM_CAPACITY_TICK
int "Capacity arbitration cadence, in virtual ticks (STADIUM_CAPACITY_TICK)"
default 1000
help
How often Hera re-evaluates capacity transfers between VMs
(FABRIC.md item 1.4), expressed in virtual ticks -- never
wall-clock. Default matches the existing precedent at
capsule_vm_physics.c's vm_physics_heartbeat_tick()
(HEARTBEAT_INFERENCE_FREQUENCY, also 1000), comfortably past
the "order of magnitude apart from the heat tick" minimum
(FABRIC.md §22.4). No consumer yet -- capacity arbitration
itself is not yet on the punch list.
config STADIUM_MEMORY_PERCENT
int "Percent of free physical memory the Stadium claims at boot (STADIUM_MEMORY_PERCENT)"
default 1
help
The Stadium's global cell array is sized at boot from
pmm_get_stats().free_bytes, taken at the point of allocation
(FABRIC.md item 3.2, §17.6 position (b): "sized at boot from the
memory budget", not a hardcoded cell count). This is the fraction
of that free-byte figure the array claims, rounded down to whole
64-byte cells. Default of 1% is conservative -- comfortably clears
the ~4096-cells-per-VM illustrative figure in FABRIC.md §23.3
against a QEMU -m 1024 test config while leaving the kernel heap
and everything else nearly all of physical memory.
endif # STARFORTH_VARIANT_KERNEL
endmenu