Migrate Hera->Artemis storage-attach to a real message round-trip
Hera still polls xHCI and sig-checks attached drives, but the storage
registration step (blk_subsys_attach_device(), now wrapped as the
BLK-ATTACH primitive) moves to Artemis's own dictionary, reached via
HERA-BLK-ATTACH-REQ/BLK-ATTACH-ACK (VM-EXEC, since Hera can't load her
own messaging.4th -- see the doc comment in repl.c). Identity birth
(Zuse genesis / WIREBIND) is deferred until the ack confirms storage
actually succeeded, instead of running synchronously underneath a
storage call that might fail ("wait for ack, safer for identity data").
Caught and fixed a real bug live during acceptance testing: Artemis's
ACK-APPEND-NUM fed a single-cell value into <# #S #> (which expects a
double-cell pair), causing a stack underflow the first time
HERA-BLK-ATTACH-REQ ran. Fixed with the same `0 SWAP` convention every
other numeric-append helper in this codebase already uses.
Verified booting clean to (zuse) ok> with no VM-EXEC errors on all
three architectures (amd64/aarch64/riscv64).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Ec88YKxxhZGG1RNnune78
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
c4f94c409f
commit
63b8b3bc29
@@ -500,3 +500,40 @@ MSG-CD-INIT
|
||||
2 MY-CH-ID !
|
||||
S" 2 COMMON-CH @ CH-ADD-MBR" S" Hermes" VM-EXEC
|
||||
STARTUP-BANNER
|
||||
|
||||
Block 4856
|
||||
( Storage-attach ack builder. Hera sends "<dev-addr> )
|
||||
( HERA-BLK-ATTACH-REQ"; reply is "<dev-addr> <ok?> )
|
||||
( BLK-ATTACH-ACK" so identity birth only proceeds once )
|
||||
( storage is confirmed (repl.c's BLK-ATTACH-ACK). Bob, )
|
||||
( 2026-09-07. )
|
||||
CREATE ATTACH-ACK-BUF 64 ALLOT
|
||||
VARIABLE ATTACH-ACK-LEN
|
||||
: ACK-APPEND ( src-addr len -- )
|
||||
DUP >R
|
||||
ATTACH-ACK-BUF ATTACH-ACK-LEN @ +
|
||||
SWAP CMOVE
|
||||
ATTACH-ACK-LEN @ R> + ATTACH-ACK-LEN ! ;
|
||||
|
||||
Block 4857
|
||||
: ACK-APPEND-CHAR ( char -- )
|
||||
ATTACH-ACK-BUF ATTACH-ACK-LEN @ + C!
|
||||
ATTACH-ACK-LEN @ 1+ ATTACH-ACK-LEN ! ;
|
||||
: ACK-APPEND-NUM ( n -- )
|
||||
0 SWAP <# #S #> ACK-APPEND ;
|
||||
|
||||
Block 4858
|
||||
( HERA-BLK-ATTACH-REQ ( dev-addr -- ): VM-EXEC'd by MSG- )
|
||||
( DELIVER when Hera's request arrives. Runs BLK-ATTACH on )
|
||||
( Artemis's own dictionary (real ACL gating, same as any )
|
||||
( other message payload), then replies to Hera (idx 0). )
|
||||
: HERA-BLK-ATTACH-REQ ( dev-addr -- )
|
||||
0 ATTACH-ACK-LEN !
|
||||
DUP ACK-APPEND-NUM
|
||||
BL ACK-APPEND-CHAR
|
||||
DUP BLK-ATTACH ACK-APPEND-NUM
|
||||
DROP
|
||||
BL ACK-APPEND-CHAR
|
||||
S" BLK-ATTACH-ACK" ACK-APPEND
|
||||
BLK-ATTACH-EVENT 2 0 ATTACH-ACK-BUF
|
||||
ATTACH-ACK-LEN @ 0 MSG-SEND ;
|
||||
|
||||
Reference in New Issue
Block a user