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
23 lines
1012 B
C
23 lines
1012 B
C
/* SPDX-License-Identifier: LicenseRef-Starship-1.0
|
|
* Copyright (c) 2023-2026 Robert A. James
|
|
*/
|
|
/* blk_layout.h -- the VM's user RAM block count, the one knob the block layout is derived from.
|
|
*
|
|
* BLK_RAM_USER_BLOCKS is how many blocks of fast RAM a VM sees (LBN 0 .. BLK_RAM_USER_BLOCKS - 1).
|
|
* It is a build knob (Kconfig BLK_RAM_USER_BLOCKS; kernel/Makefile passes it as -D), and the tools
|
|
* that make the kernel's media are built with the same value: mkcapsule takes it as its floor --
|
|
* a capsule's page `Block n` has n at least this, and is copied down by it to be interpreted --
|
|
* and mkartemis lays out a disk by it (block_subsystem.h derives BLK_RAM_BLOCKS and BLK_DISK_START).
|
|
* docs/v4.0.0/plans/2026-11-18-capsule-blocks.md, ruling 3 (Captain Bob: "The RAM block count").
|
|
*
|
|
* Nothing else is in this header, so a host tool can include it alone.
|
|
*/
|
|
#ifndef BLK_LAYOUT_H
|
|
#define BLK_LAYOUT_H
|
|
|
|
#ifndef BLK_RAM_USER_BLOCKS
|
|
#define BLK_RAM_USER_BLOCKS 2048u
|
|
#endif
|
|
|
|
#endif /* BLK_LAYOUT_H */
|