Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
91 lines
4.5 KiB
Markdown
91 lines
4.5 KiB
Markdown
# v4's `init.4th` -- design, for ruling
|
||
|
||
Written 2026-11-18. Captain Bob ruled: "Write v4's init.4th". That was after the audit of Phase 7
|
||
Tasks 5–7 found that v4 has no `init.4th`.
|
||
|
||
**Nothing here is built.** Each point in section 5 is put to Captain Bob one at a time.
|
||
|
||
## 1. What the record asks
|
||
|
||
- **MACHINE.md §3, step 5:** "`init.4th`, the system's init (section 7, item 6). From here the boot
|
||
is `init.4th` only. No boot policy is written in C."
|
||
- **MACHINE.md §1.1:** "the system's init, `init.4th`, brings it up:
|
||
- it turns on security;
|
||
- it starts the system a module at a time and a node at a time;
|
||
- whoever is logged in gets a prompt: Zuse, `rajames`, `00` to `09`, or whoever it is."
|
||
- **MACHINE.md §5:** "Everything after POST is `init.4th`'s."
|
||
- **Ruled 2026-11-18:** `init.4th` sets the search order, starting in STARSHIPOS, then FORTH. `COLD`
|
||
stays as FORTH-79's, with one vocabulary.
|
||
|
||
## 2. What the boot does now (`v4/system/mesh.c`, `kernel/src/v4/sk_v4.c`)
|
||
|
||
1. The ROM assembles the nucleus on Hera.
|
||
2. The kernel words are made.
|
||
3. The capsules are loaded:
|
||
- `forth79.4th`;
|
||
- the kernel's list in C (`sk_v4.c:165`): `starshipos.4th`, `centre.4th`, `hera.4th`,
|
||
`physics.4th`.
|
||
4. Seal, then POST (990 cases), then `COLD`.
|
||
5. The kernel's C code runs:
|
||
- the identity gate: no identity drive means headless, and Zuse's drive gives a console
|
||
(`sk_v4_identity.c`);
|
||
- the prompt, `[zuse@Hera] ok>`.
|
||
|
||
**Security is never turned on in the kernel's boot.** The policy, `v4/capsule/ACL.fth` (v3's
|
||
`ACL.4th` as FORTH source), is loaded only by a host test (`test_host_quit.c:1637`). It is not in
|
||
the kernel's capsule directory, which is built from `capsules/` only.
|
||
|
||
## 3. The design
|
||
|
||
**`capsules/v4/init.4th`**, a capsule like the others:
|
||
- It is in the kernel's directory, and `mkcapsule` checks, hashes and signs it.
|
||
- Its blocks are 8300 up, following physics.4th's 8200 range. The range is open for ruling.
|
||
|
||
**The loader runs it last.** It is loaded by name after `COLD`, on Hera, through the same loader as
|
||
the system capsules. It is the only boot policy, so the loader's one fixed step after POST is "load
|
||
`v4:init.4th`". The list before POST stays the loader's (MACHINE.md §5).
|
||
|
||
**What it does, in order, each step its own task, test first:**
|
||
1. **The search order:** `STARSHIPOS` first, then FORTH (ruled).
|
||
2. **Security on:**
|
||
- it loads the ACL policy, `ACL.fth` brought into `capsules/v4/` as a capsule;
|
||
- `ACL-BOOT` runs;
|
||
- `BIRTH` is pinned as the parent plan's Phase 4 asks (`CAPSULE-BIRTH` has no v4 counterpart:
|
||
to be ruled).
|
||
3. **The system a module and a node at a time:** births through Hera (`centre.4th`'s `BIRTH`).
|
||
Which nodes, and in what order, is for ruling. Today the kernel births none at boot.
|
||
4. **The prompt for whoever is logged in.** Today the identity gate and the prompt are the kernel's
|
||
C code. Moving them into `init.4th` is the largest step, and comes last.
|
||
|
||
## 4. How each step is verified (named before it is built)
|
||
|
||
- `test_mesh_boot.c` checks each step on the host, seen to fail first:
|
||
- for step 1, `S" ok" DOE` works at the prompt without naming `STARSHIPOS`;
|
||
- for step 2, a strict word refuses as `test_host_quit.c`'s ACL cases do.
|
||
- POST stays at 990/990 on all three ISAs. POST runs before `init.4th`, so it is unchanged.
|
||
- The protocol runs on a clean tree. `dict_hash` changes with each step's words, and the new value is
|
||
recorded each time.
|
||
|
||
## 5. For ruling, one at a time
|
||
|
||
1. Start with step 1 only (the search order), built and accepted, then step 2?
|
||
2. `init.4th`'s blocks: 8300 up?
|
||
3. `ACL.fth` into `capsules/v4/` as a capsule loaded by `init.4th`, or does `init.4th` carry the policy
|
||
itself?
|
||
4. `CAPSULE-BIRTH`: v4 has no such word. Is it pinned once it exists, or dropped?
|
||
5. Which nodes `init.4th` births at boot, and in what order.
|
||
6. Step 4: when the identity gate and the prompt move from C into `init.4th`.
|
||
|
||
## 6. Rulings so far (2026-11-18)
|
||
|
||
1. **Step 1 first** (the search order), each step accepted before the next.
|
||
2. **Held.** Asked where `init.4th`'s blocks go, Captain Bob answered: "It shouldn't matter. Capsules
|
||
should not occupy fixed ranges." Then: "Capsules are ephemeral. We need to talk later." This runs
|
||
against the tree as it is:
|
||
- every capsule's `Block NNNN` headers;
|
||
- `mkcapsule`'s check of them;
|
||
- the ranges in `BLOCK_MAP.md` and `experiments/bare_metal/README.md`.
|
||
|
||
It may also change what `init.4th` is: a capsule, or not. **Nothing of this design is built until
|
||
that conversation.**
|