Launch paths — specification (dock, .lnk, ramdisk, builds)¶
This document is a historical Sphinx-side launch routing reference.
Warning
This page is not the sole canonical source anymore.
For current platform contracts and daemon/CLI/GUI settings model, use:
newdocs/README.mdnewdocs/system-architecture.mdnewdocs/settings-control-pattern.md
Executive summary¶
Problem |
Phase 1 fix |
Phase 2 fix |
|---|---|---|
Dock |
Point SET / WAND / EVNT / PNP at real ELFs already on the ramdisk (see §2) |
Add minimal stub crates (or full apps) and stage them back under |
|
Mirror the dock-critical copy lines (§5) |
Keep both scripts aligned always |
|
Change to |
Same |
Policy: No in-process “fake” apps inside the compositor for dock launches — only sys_execve to real files. Phase 1 uses interim targets; Phase 2 restores meaningful binary names at the original paths.
1. Phase 1 — dock & compositor (target mapping)¶
Rule: Every dock icon must resolve to a path that exists on the FAT image after build_all.bat (release x86_64-unknown-p1start where applicable).
1.1 Dock index → .lnk → PATH_* fallback → on-disk file¶
Dock order and labels are fixed in apps/deskgui/src/deskgui/compositor.rs (DOCK_ICON_LABELS, DOCK_LNK_PATHS, launch_dock_icon).
Idx |
Label |
|
|
|
|---|---|---|---|---|
0 |
SET |
|
|
|
1 |
TERM |
|
|
|
2 |
WAND |
|
|
|
3 |
EVNT |
|
|
|
4 |
PNP |
|
|
|
5 |
DOOM |
|
|
|
launch_dock_icon match arms (proposed): one try_exec(PATH_*) per index matching the table above; EVNT no longer attempts /Applications/Syslog/syslog.elf in Phase 1.
p1side.elf caveat: build_all.bat copies it only if exist the release binary. If P1SCode is not built, SET will still fail until the project is built or Phase 2 adds settings.elf. Documented mitigation: optional compositor second fallback try_exec(/bin/surf.elf) for idx 0 only — implementation choice; not required for Phase 1 doc minimum.
1.2 Build artifact → esp/ staging (build_all.bat)¶
Logical path (POSIX, as in |
Staged path on FAT ( |
Copy source (repo-relative, release) |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Target triple for user ELFs: x86_64-unknown-p1start (SDK\toolchain\x86_64-unknown-p1start.json), except Oasis (linux-gnu) and DOOM (doom_port).
2. Phase 2 — canonical /Applications/... (stub or real ELFs)¶
Restore semantic paths so .lnk and marketing/docs stay stable:
Path |
Purpose |
Implementation |
|---|---|---|
|
Settings |
New |
|
File explorer |
New |
|
Events / logs |
New |
|
Device manager |
New |
build_image.bat ends with python pack_ramdisk.py, which applies build/image.manifest (including Applications/Settings, Applications/Wander, Doom, Oasis, etc.). build_all.bat still means “full image + QEMU”; ad-hoc mkdir/copy into esp\ is only for quick partial syncs (e.g. run_qemu.bat parity). Remaining Phase 2 gaps are Syslog / PnP app trees once ELFs exist — add F lines to the manifest (and build steps) like the other /Applications/... entries.
After Phase 2: Revert §1.1 table .lnk + PATH_* + launch_dock_icon to these four Application paths; keep TERM / DOOM as today.
3. resolve_exec_line (exec_line.rs) — proposed CMD: map (Phase 1)¶
Keep EXEC: passthrough as-is. Update CMD: aliases so menus/dialogs that still emit CMD:SETTINGS etc. hit real ELFs until Phase 2:
|
Resolved path (Phase 1) |
Phase 2 (optional revert) |
|---|---|---|
|
|
unchanged |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unchanged |
|
|
unchanged |
|
|
unchanged |
|
|
unchanged |
5. run_qemu.bat — sync checklist (Phase 1)¶
Today run_qemu.bat is missing several ELFs that build_all.bat ships. For dock + common StartMenu entries to work under QEMU quick runs, add copies (mirror build_all.bat paths) for at least:
gterm→esp\bin\gterm.elfand optionallyesp\bin\termd.elfnetstat→esp\bin\netstat.elfsurf→esp\bin\surf.elf(already present in run_qemu)ps→esp\bin\ps.elfp1side→esp\System\Apps\P1SCode\bin\p1side.elf(conditionalif exist, same as full build)sh,ifconfig,ping,nslookup— optional parity with full build
Then run python pack_ramdisk.py from the repo root (same as build_image.bat: manifest → build/staging/ → src/initramfs.bin → sync into esp/ unless --no-sync).
6. Launcher mechanics (reference)¶
launch_dock_icon(idx) (compositor.rs): first try_exec_from_lnk(DOCK_LNK_PATHS[idx]), then match idx fallbacks.
try_exec_from_lnk: reads .lnk text; first line starting with EXEC=; substring after EXEC= passed to resolve_exec_line; result passed to sys_execve via try_exec_path_unix.
.lnk format: use EXEC=EXEC:/abs/path so the post-EXEC= payload is EXEC:/abs/path, which resolve_exec_line accepts.
7. pack_ramdisk.py + build/image.manifest¶
Authoritative flow: build/image.manifest lists T (recursive tree copies into staging), F (required single files), and E (optional; missing source is skipped). pack_ramdisk.py wipes build/staging/, applies the manifest, adds stub fonts / optional cursors / autorun hooks, packs every file under staging into src/initramfs.bin (hard-coded skips: *.ani entries, path ending in \doom.wad), then merges staging → esp/ (overwrite only; does not delete extra files already on esp/).
When adding new shipped ELFs or trees, extend build/image.manifest (and ensure build_image.bat builds them before pack_ramdisk.py runs). Older notes about packing “only what is already under esp/” referred to legacy workflows and are obsolete.
8. Files to touch (implementation index)¶
Area |
Files |
|---|---|
Dock fallbacks + constants |
|
|
|
StartMenu + Dock shortcuts |
|
Staging / QEMU |
|
Phase 2 stubs |
new |
Kernel metadata (optional) |
|
9. Brand flyout (APPS_SUB_TO_DOCK)¶
Indices [1, 2, 0, 3, 4, 5] still map Terminal → Wander → Settings → Events → PnP → DOOM to the same dock slots; no index change required once launch_dock_icon and .lnk match §1.1.
Document version: proposed Phase 1 + Phase 2 roadmap for P1Start launch routing. Implementation should follow §1–§5 first, then §2.