feat(userspace): programs in /bin w/o .elf; bin manifests (needs = display) so shell runs snake; Ctrl+C kills foreground via terminal interrupt notification; ctrl keys; sleep

This commit is contained in:
2026-10-27 21:16:00 +01:00
parent 1fc5a54f06
commit 83809bbe94
33 changed files with 608 additions and 121 deletions

2
disk/bin/snake.manifest Normal file
View File

@@ -0,0 +1,2 @@
# What snake needs beyond the terminal and storage.
needs = display

View File

@@ -1,8 +1,11 @@
The shell runs a program by asking init to load it (init alone may
The shell runs /bin/<name> by asking init to load it (init alone may
create processes), then gives the program the terminal as its output
and a read-only storage grant to the current directory, writes its
arguments onto a page it moves into the program, starts it and waits
for it to die. Then it takes the grant back.
for it to die. Then it takes the grant back. Ctrl+C kills it.
Built-ins: help, echo, clear, cd, pwd. Anything else is a program on
disk: `name args...` runs name.elf.
A program that needs more says so in /bin/<name>.manifest, e.g.
`needs = display` for snake, which then gets the screen and keyboard
until it quits. A need the shell does not know, it refuses to run.
Built-ins: help, echo, clear, cd, pwd.

View File

@@ -5,3 +5,4 @@ this file reached your screen because the shell handed `cat` the
terminal and read-only access to this directory, and nothing else.
Try: ls cd docs cat shell.txt cat ../readme.txt
ls bin snake (q quits) sleep 30, then Ctrl+C