Files
LithosAnanke/capsules/v4/hera.4th
T
Claude 6dcfbe6740 Capsule blocks steps 3+4 for v4: capsules are placed in RAM and load their lowest block
Captain Bob ruled: Block n lands at n-R; the lowest block is
interpreted; chaining is the developer's; together, v4 first.
- v4_blocks_place_capsule copies each Block n into RAM block n - R as 16
  lines of 64, space-padded, in any file order. A later block of the
  same number overwrites. It refuses a block below R.
- The mesh's load(), its capsule reader (CAPSULE-OPEN/(LINES), so a
  child's forth79.4th via BIRTH too), boot.c and test_host_unit's model
  each place a capsule, then interpret "<lowest> LOAD".
- mkdictionary.py skips --> when it types capsules at the hosted prompt.
- The v4 capsules are renumbered into R..2R-1, landing at RAM 1900 and
  up, away from POST's blocks 0-5. Each is chained with -->, and
  centre.4th's gap at 8103 is closed.

Test first:
- test_host_blocks.c gained 6 placement checks; it failed to build
  before.
- test_mesh_boot.c checks forth79's lowest block in RAM block 1900; it
  failed before.

After: POST is 990/990; all 52 tests at 64 bits, test-32, hosted-check
and ASan/UBSan pass; the amd64 kernel builds; the dictionary has 404
words.

Logs are in logs/20261118-capsule-place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:33:21 +00:00

32 lines
1.3 KiB
Forth

Block 3960
( hera.4th -- what is Hera's alone, beside centre.4th, which )
( she loads first. docs/v4.0.0/MESH.md 9a. She decides )
( which nodes there are and which are awake: KILL, PAUSE and )
( RESUME, by number, through the kernel's registry, are hers )
( and no other node's, as v3's KILL is Hera's alone. )
-10 KERNEL-WORD NODE-SLEEP -11 KERNEL-WORD NODE-WAKE
-12 KERNEL-WORD NODE-KILL
( n -- n flag a node there is, and not Hera herself )
: (THERE?) DUP (ME) @ = 0= OVER NODE-PLACE 0< 0= AND ;
: (NO-NODE) ( n -- ) DROP ." no such node" CR -1 NODE-ERROR ! ;
( n -- KILL: node n is removed, whatever it was doing; the )
( kernel tells every node it is gone, and Hera forgets it. )
: KILL ( n -- )
(THERE?) 0= IF ." KILL: " (NO-NODE) THEN
DUP NODE-KILL NO-ROUTE ;
-->
Block 3961
: PAUSE ( n -- )
(THERE?) 0= IF ." PAUSE: " (NO-NODE) THEN NODE-SLEEP ;
: RESUME ( n -- )
(THERE?) 0= IF ." RESUME: " (NO-NODE) THEN NODE-WAKE ;
( n -- a unit is removed: each of n's children, then n )
: UNIT-KILL ( n -- )
BEGIN DUP 0 NODE-CHILD ?DUP WHILE KILL REPEAT KILL ;
( n -- A SECOND CENTRE, node n, from its port 6 to Hera's )
( port 6, given centre.4th; it births its unit, n+1 to n+4. )
: CENTRE ( n -- )
DUP 6 6 S" v4:centre.4th" BIRTH-AS DROP
5 1 DO DUP I + 6 ROUTE LOOP DROP
(T0) (KID#) @ (TN) S" UNIT" (TS) (T) (TELL) ;