summaryrefslogtreecommitdiffstats
path: root/rsapi/src/lib.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-27 16:58:31 +0200
committersalmonik <salmonik@tuta.io>2026-08-27 16:58:31 +0200
commit300c0acbd7ab3fae8596ff839c39d9a17c70c68d (patch)
tree5a600b24c037dc798766e3ce3fc004956e517abb /rsapi/src/lib.rs
parentexec: PE32+ loader, versioned ABI, first external binaries (v0.6.0) (diff)
downloadrs-dos-300c0acbd7ab3fae8596ff839c39d9a17c70c68d.tar.gz
rs-dos-300c0acbd7ab3fae8596ff839c39d9a17c70c68d.zip
streams: per-invocation channel, pumping mode, filter pipeline wiring
exec: LineChannel bounded ring (cap=16) with abort/eof/marker fields. Shell 'pumping mode' assembles canonical lines from its queue into the channel while the command runs; ^C marks the channel aborted. Shell-side grammar: USE/TIL pre-drain into the channel before spawn; <cmd> <path> TIL <marker> sugar drains paths until the marker line. Interactive TIL: pump_key checks each submitted line against the marker and closes the channel when it matches. Exports callbacks run in the command task but touch shell-owned state: this is safe by construction — the shell blocks in exec_external until the command completes. put_line feeds Pipeline::line directly; get_line pops from the channel (yield-poll when empty). load: drop NX from image mapping (single-privilege kernel, NX bit 63 reserved when EFER.NXE is set by OVMF); compute image span from section RVAs not file size. bins/count: gate binary — reads lines via get_line, reports count via put_line. Verified: count USE file → 6; count <path> TIL END → 2; interactive count TIL DONE → 3; -h filter across task boundary; ^C abort. v1 stream exports: put_line → Pipeline, get_line ← channel, log_line → klog append, exit → abort_current. Accounting: print_one_line → pipe.line() returns false (head kill / pager ^C) → the binary should wrap up promptly; accepted: binary does not check the return value in v1 (phase 3 simplification).
Diffstat (limited to 'rsapi/src/lib.rs')
-rw-r--r--rsapi/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rsapi/src/lib.rs b/rsapi/src/lib.rs
index f71e69f..d7b69a2 100644
--- a/rsapi/src/lib.rs
+++ b/rsapi/src/lib.rs
@@ -20,7 +20,8 @@ pub const ABI_VERSION: u32 = 1;
20/// Entry-point signature. `extern "C"` on the x86_64-unknown-uefi 20/// Entry-point signature. `extern "C"` on the x86_64-unknown-uefi
21/// target is the Win64 convention: the three arguments arrive in 21/// target is the Win64 convention: the three arguments arrive in
22/// RCX/RDX/R8 on both sides of the table. 22/// RCX/RDX/R8 on both sides of the table.
23pub type EntryPoint = extern "C" fn(exports: &'static Exports, argc: usize, argv: *const Arg) -> i32; 23pub type EntryPoint =
24 extern "C" fn(exports: &'static Exports, argc: usize, argv: *const Arg) -> i32;
24 25
25/// One C-style argv element: pointer + length (rs-dos strings are not 26/// One C-style argv element: pointer + length (rs-dos strings are not
26/// NUL-terminated in memory). 27/// NUL-terminated in memory).