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:
@@ -68,6 +68,7 @@
|
||||
#include <stddef.h>
|
||||
#include "vm.h"
|
||||
#include "blkio.h" /* ensure struct blkio_dev is fully visible */
|
||||
#include "blk_layout.h" /* BLK_RAM_USER_BLOCKS, the knob the layout below is derived from */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -75,8 +76,8 @@ extern "C" {
|
||||
|
||||
/* Core configuration constants */
|
||||
#define BLK_FORTH_SIZE 1024u /* Forth block size */
|
||||
#define BLK_RAM_BLOCKS 2080u /* Physical RAM blocks (user-visible LBN 0..2047) */
|
||||
#define BLK_DISK_START 2080u /* Device-backed Forth blocks start at LBN 2080 */
|
||||
#define BLK_RAM_BLOCKS (BLK_RAM_USER_BLOCKS + BLK_FORTH_SYS_RESERVED) /* Physical RAM blocks: the user's (blk_layout.h; 2048 by default, LBN 0..2047) and the reserved ones -- 2080 by default */
|
||||
#define BLK_DISK_START BLK_RAM_BLOCKS /* Device-backed Forth blocks start after the RAM blocks: LBN 2080 by default */
|
||||
#define BLK_DEVICE_SECTOR 4096u /* Physical “devblock” size (4×1 KiB blkio units) */
|
||||
#define BLK_PACK_RATIO 3u /* 3× 1 KiB data per 4 KiB devblock (plus 1 KiB metadata) */
|
||||
#define BLK_META_TOTAL 1024u /* Last 1 KiB in a 4 KiB devblock is metadata */
|
||||
|
||||
Reference in New Issue
Block a user