implements PR-025

This commit is contained in:
2026-03-24 13:40:56 +00:00
parent fab5ed2c46
commit 67e7acf73b
3 changed files with 15 additions and 6 deletions
@@ -91,6 +91,8 @@ Current high-level flow:
If VM initialization fails, firmware transitions to the crash path.
POS selects the cartridge and its execution context, but the cartridge's initial callable is not chosen by firmware metadata. Execution starts from the cartridge boot protocol defined in [`13-cartridge.md`](13-cartridge.md), currently `func_id = 0`.
## 7 Firmware States
The current firmware state model includes:
+11 -5
View File
@@ -28,8 +28,7 @@ The runtime currently expects the following manifest fields:
"app_id": 1234,
"title": "My Game",
"app_version": "1.0.0",
"app_mode": "Game",
"entrypoint": "main"
"app_mode": "Game"
}
```
@@ -47,7 +46,6 @@ Current required manifest fields:
- `title`
- `app_version`
- `app_mode`
- `entrypoint`
Current required file payloads:
@@ -70,14 +68,22 @@ The current loader validates:
If validation fails, cartridge loading is rejected before execution.
## 5 App Mode and Entrypoint
## 5 App Mode and Boot Protocol
`app_mode` controls firmware launch behavior:
- `Game`
- `System`
`entrypoint` is passed to the VM initialization flow and may be resolved as a symbol or function identifier according to the VM/runtime contract.
Cartridge boot is protocol-driven, not manifest-driven.
The executable entrypoint of a valid cartridge is always `func_id = 0`.
This means:
- `manifest.json` does not select the callable to execute;
- firmware/runtime loads the cartridge and starts execution from `func_id = 0`;
- nominal exports may exist for linking or introspection, but they do not hold boot authority.
## 6 Assets and Preload
+2 -1
View File
@@ -33,7 +33,8 @@ When the boot target is `Cartridge`:
1. firmware loads the requested cartridge;
2. cartridge metadata is read;
3. launch behavior follows cartridge `app_mode`.
3. launch behavior follows cartridge `app_mode`;
4. bytecode execution starts through the cartridge boot protocol defined by the cartridge contract, not by textual entry metadata.
## 3 Launch Resolution by App Mode