Capsule blocks step 1: the RAM block count is a build knob, BLK_RAM_USER_BLOCKS

Captain Bob ruled that the offset is the RAM block count, not a literal
2048.
- v3/include/blk_layout.h defines it, 2048 by default. block_subsystem.h
  derives BLK_RAM_BLOCKS (2080) and BLK_DISK_START from it.
- Kconfig.kernel has the symbol. kernel/Makefile passes it to the
  kernel's C code and builds mkcapsule and mkartemis with it.
- mkcapsule's two literal 2048s are now the knob.

The default value is unchanged, so the layout and the media are as before.

Test first: scripts/test_capsule_ram_blocks.sh, 8 checks.
- The before-run failed 4: the knob did not exist and mkcapsule ignored
  it. Its three Makefile checks also hit a SIGPIPE flaw in the test,
  fixed before the after-run.
- After: all 8 pass.

The amd64 build and mkartemis build clean. All 40 capsules lint. The
mesh boot passes 109 checks with POST 990/990. test_host_blocks,
test_host_quit, test_host_unit and test-32 pass.

Logs are in logs/20261118-ram-blocks-knob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-18 17:35:15 +00:00
parent cda8aad8b2
commit 6f9900f805
14 changed files with 764 additions and 13 deletions
+12
View File
@@ -28,6 +28,18 @@ config STARFORTH_V4
2026-10-14: v3 is being retired. Off builds v3 alone. See
docs/v4.0.0/DECOMPOSITION.md and boards/BRINGUP.md A6.
config BLK_RAM_USER_BLOCKS
int "The VM's user RAM block count (BLK_RAM_USER_BLOCKS)"
default 2048
help
How many blocks of fast RAM a VM sees: LBN 0 .. BLK_RAM_USER_BLOCKS - 1.
The block layout is derived from it (v3/include/blk_layout.h,
block_subsystem.h: BLK_RAM_BLOCKS, BLK_DISK_START). A capsule page
`Block n` must have n at least this, and is copied down by it to be
interpreted (docs/v4.0.0/plans/2026-11-18-capsule-blocks.md). mkcapsule
and mkartemis are built with the same value. Changing it moves where
disk blocks start, so media made with another value do not match.
config PARITY_MODE
bool "Deterministic parity harness mode (PARITY_MODE)"
default n