From bb4f468b73c8a888bec1e5b2ba7f1575ab7f8456 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 16 Jul 2026 11:15:12 +0200 Subject: jobs: background execution (&), non-blocking reap, spin demo - sys_reap: nohang reap of a finished zombie child (-> pid or 0). - shell: 'cmd &' launches in the background (prints [pid], no wait); reaps finished jobs at the prompt ([pid done]). Foreground now waits for its own child specifically (loops wait(), reporting bg completions meanwhile) so kill reports the right pid. - spin: a process that yields forever - a target for ps/kill. - verified: spin &; ps shows it; kill removes just that one; immortal init; self-finishing bg worker reaped with [pid done]. --- include/gbos.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/gbos.inc') diff --git a/include/gbos.inc b/include/gbos.inc index 30c3a50..329430c 100644 --- a/include/gbos.inc +++ b/include/gbos.inc @@ -101,7 +101,8 @@ DEF SYS_SETOUT EQU 18 ; set current stdout fd (B=fd, $FF=console) DEF SYS_LOOKUP EQU 19 ; program id for a command name (DE=name -> A=id/$FF) DEF SYS_PS EQU 20 ; process table entry (B=slot, DE=buf3 -> A=1/0) DEF SYS_PROGNAME EQU 21 ; program id -> name (B=id, DE=namebuf) -DEF SYS_MAX EQU 22 +DEF SYS_REAP EQU 22 ; reap a zombie child, nohang (-> A=pid or 0) +DEF SYS_MAX EQU 23 ; SYS_KILL (9) is now implemented (B=pid -> A=0/$FF; pid 1 is immortal) ; (SYS_OPEN=4 / SYS_CLOSE=5 are now implemented by the filesystem) -- cgit v1.3.1-sl0p