docs(v4.0.0): storage -- the plan for step 6, and three details ruled into the spec

blk_subsys_init loses its unused VM argument (ruled).  Block done has a
fourth answer, no such block.  MESH.md 8.4 says which chain a number
means, that storage has a number like a node, and that a block number is
not signed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-06 19:12:23 -04:00
co-authored by Claude Opus 5.5
parent 8cacfb663c
commit a7991f2757
2 changed files with 377 additions and 10 deletions
+18 -10
View File
@@ -348,7 +348,7 @@ Four types, beside text, output and done (section 6):
| Block read | the block number, one word | Block data, or Block done with an error |
| Block write | the block number, one word; a Block data message follows it | Block done |
| Block data | 1024 characters | |
| Block done | one word: it worked, there is no storage, or it was refused | |
| Block done | one word: 0 it worked, 1 there is no storage, 2 it was refused, 3 there is no such block | |
A write is two messages because a block is exactly the most a message
carries, so the number cannot go with the data. Whatever answers pairs the
@@ -368,20 +368,28 @@ block. The engine (`v4/src`) knows nothing of it.
- Blocks 0 to 2047 are the chain's fast RAM, as in v3; nodes that share
the common store share those too.
- The device holds a **view**: the common chain, or a private chain, or
both. A number at the top of the space (ruling 9) is the private
chain's; any other is the common chain's; a number in a chain the view
does not have is "no storage".
both. Private block *k* is the private chain's block 2048 + *k*, its
first on a device. A number is the private chain's when *k* is less than
the blocks that chain has on devices; any other is the common chain's,
and one past its end is "no such block". Numbers below 2048 are the
common chain's fast RAM, or the private chain's if the view has no
common chain. A number that belongs to no chain the view has is "no
storage".
- Whatever is on a storage port has a number, as a node has, and is sent
to and answers like one. Whoever wires a node tells it that number
(`STORAGE`) and the way to it (`ROUTE`). A node not told has no storage.
- A block number is not signed: on 32-bit cells the numbers from the top
down are the negative ones. Only 0 is no block.
**A change to v3's C.** Its block subsystem is one global chain. For a
second chain its state becomes something there can be two of. The change
is mechanical and the one chain v3 uses behaves as it did. (Approved.)
Found 2026-10-06 and not yet ruled: `blk_subsys_init` must be given a v3
`VM`, and refuses without one, though the subsystem stores it and never
uses it (`block_subsystem.c` line 651 is its only mention). The hosted v4
system has no v3 `VM` to give. The same change would have to take that
argument away, which also changes the kernel's one call of it
(`kernel/src/capsule/capsule_loader.c`).
`blk_subsys_init` must be given a v3 `VM`, and refuses without one, though
the subsystem stores it and never uses it (`block_subsystem.c` line 651 is
its only mention). The hosted v4 system has no v3 `VM` to give. **Ruled
2026-10-06:** the argument is removed, in the same change; the kernel's
call of it (`kernel/src/capsule/capsule_loader.c`) changes with it.
**On bare metal** the lone node's storage port fronts the kernel's real
chain — RAM, the ramdrive and the virtio disk — in place of the RAM array