diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-21 21:17:44 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-21 21:17:44 +0200 |
| commit | 71b6445b048456bf198d8b622570db95f4665cb9 (patch) | |
| tree | 808e73fa95709ed9c2d409aecaf275fd70365293 /Cargo.lock | |
| parent | input: total keyboard routing + per-terminal discipline (ADR 0006 ph1) (diff) | |
| download | rs-dos-71b6445b048456bf198d8b622570db95f4665cb9.tar.gz rs-dos-71b6445b048456bf198d8b622570db95f4665cb9.zip | |
exec: PE32+ loader, versioned ABI, first external binaries (v0.6.0)
rsapi: the kernel<->binary ABI crate (no_std, no deps). Versioned
Exports table (magic + version header), EntryPoint = extern "C" on
x86_64-unknown-uefi (Win64: RCX/RDX/R8), Line/Arg/StreamResult types.
Binaries link only this crate.
rsnix::load: PE32+ parser — DOS/COFF/optional headers, section copy,
BSS zero-fill, .reloc base relocations (DIR64) via rva_to_file mapping
(the reloc directory is an RVA, not a file offset). Images are
allocated at LOAD_BASE=192MiB inside the page allocator's conventional
span and identity-mapped user+writable+nx.
rsnix::exec: resolution name -> /disk/<UID>/bin/<kind>/<name>.efi per
mounted volume; spawn reserves a sched slot, stores a per-task ExecCtx
(exports + argv block + image) before launch_at installs the frame —
no adopt race. Trampoline calls entry(&Exports, argc, argv), posts
TaskMsg::User(exit_code) to the shell. abort_current notifies the
shell with u64::MAX when an exec'd binary dies, so a faulting command
cannot leave the shell blocked forever.
sched: reserve_slot/launch_at split out of spawn; task_exit made pub.
shell: exec_external runs before non-frozen built-ins (ADR 0006
resolution rule); frozen core (help/clear/echo/halt/poweroff/exit/
rescan) is exempt. Exports v1 wires put_line to the terminal and
get_line to EOF; stream injection lands in Phase 3. ^C while waiting
kills the command task.
bins/{hello,boom}: gate binaries. hello prints through the exports
table; boom faults on 0x400000000000 to prove containment. The image
entry point IS the ABI entry (efi_main carries the Exports signature).
Version 0.6.0: exec exists end-to-end.
Gates verified in QEMU: 'hello' loads from \\bin\\cli\\hello.efi, calls
put_line across the ABI, exits 0, shell unblocks; 'boom' faults, task
dies gracefully with full report, shell survives, jobs shows the corpse;
built-in fallback works when the file is absent; test-disk PASS.
Diffstat (limited to '')
| -rw-r--r-- | Cargo.lock | 28 |
1 files changed, 25 insertions, 3 deletions
| @@ -3,8 +3,26 @@ | |||
| 3 | version = 4 | 3 | version = 4 |
| 4 | 4 | ||
| 5 | [[package]] | 5 | [[package]] |
| 6 | name = "boom" | ||
| 7 | version = "0.6.0" | ||
| 8 | dependencies = [ | ||
| 9 | "rsapi", | ||
| 10 | ] | ||
| 11 | |||
| 12 | [[package]] | ||
| 13 | name = "hello" | ||
| 14 | version = "0.6.0" | ||
| 15 | dependencies = [ | ||
| 16 | "rsapi", | ||
| 17 | ] | ||
| 18 | |||
| 19 | [[package]] | ||
| 20 | name = "rsapi" | ||
| 21 | version = "0.6.0" | ||
| 22 | |||
| 23 | [[package]] | ||
| 6 | name = "rsdos" | 24 | name = "rsdos" |
| 7 | version = "0.5.11" | 25 | version = "0.6.0" |
| 8 | dependencies = [ | 26 | dependencies = [ |
| 9 | "rsnix", | 27 | "rsnix", |
| 10 | "shell", | 28 | "shell", |
| @@ -19,7 +37,10 @@ dependencies = [ | |||
| 19 | 37 | ||
| 20 | [[package]] | 38 | [[package]] |
| 21 | name = "rsnix" | 39 | name = "rsnix" |
| 22 | version = "0.5.11" | 40 | version = "0.6.0" |
| 41 | dependencies = [ | ||
| 42 | "rsapi", | ||
| 43 | ] | ||
| 23 | 44 | ||
| 24 | [[package]] | 45 | [[package]] |
| 25 | name = "rspaint" | 46 | name = "rspaint" |
| @@ -30,8 +51,9 @@ dependencies = [ | |||
| 30 | 51 | ||
| 31 | [[package]] | 52 | [[package]] |
| 32 | name = "shell" | 53 | name = "shell" |
| 33 | version = "0.5.11" | 54 | version = "0.6.0" |
| 34 | dependencies = [ | 55 | dependencies = [ |
| 56 | "rsapi", | ||
| 35 | "rsdosedit", | 57 | "rsdosedit", |
| 36 | "rsnix", | 58 | "rsnix", |
| 37 | "rspaint", | 59 | "rspaint", |
