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
@@ -79,7 +79,14 @@ Written 2026-11-18, from the capsules talk with Captain Bob. It records the ruli
## 4. The work, for ruling (nothing built)
Each step is test first, then POST and the protocol:
1. **The knob.** The RAM block count becomes a Kconfig symbol. `block_subsystem.h` and the kernel read
1. **The knob. Built 2026-11-18:**
- `BLK_RAM_USER_BLOCKS` is in `Kconfig.kernel`, default 2048, defined in `v3/include/blk_layout.h`.
- `block_subsystem.h` derives `BLK_RAM_BLOCKS` (2080) and `BLK_DISK_START` from it.
- `kernel/Makefile` passes it to the kernel's C code, `mkcapsule` and `mkartemis`, and
`mkcapsule`'s two literal 2048s are the knob.
- Tested by `scripts/test_capsule_ram_blocks.sh`, 8 checks, in `logs/20261118-ram-blocks-knob/`.
The plan as written: `block_subsystem.h` and the kernel read
it, and `mkcapsule` is given it at build time in place of its literal 2048.
2. **`mkcapsule`.**
- Its floor comes from the knob.