feat(apps): permission manager equips apps (manifest+consent+decisions in /system), launches via init w/ file grant; shell unprivileged (/home); install/apps/allow/revoke; revoke stops running app; app-image tool; counter app

This commit is contained in:
2026-10-27 22:56:44 +01:00
parent 9bc31a9bbe
commit 90e11eb2e8
51 changed files with 1766 additions and 644 deletions

View File

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

View File

@@ -1,11 +0,0 @@
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. Ctrl+C kills it.
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.

10
disk/home/docs/shell.txt Normal file
View File

@@ -0,0 +1,10 @@
The shell runs an app by asking the permission manager, passing along
the terminal as its output and a read-only grant to the current folder:
all the shell has to give. The permission manager adds what the app's
manifest asks for and you allowed, and runs it. Ctrl+C stops it.
You decide what each app may use: `install <folder>` asks you, `apps`
shows what each may use, `allow` and `revoke` change it (revoking from
a running app stops it).
Built-ins: help, echo, clear, cd, pwd, apps, install, allow, revoke.

9
disk/home/readme.txt Normal file
View File

@@ -0,0 +1,9 @@
Welcome to k-os.
Every program here is an app that runs with only the capabilities it
was given: this file reached your screen because the shell handed `cat`
the terminal and read-only access to this folder, and nothing else.
Try: ls cd docs cat shell.txt cat ../readme.txt
apps snake (q quits) sleep 30, then Ctrl+C
install inbox/counter, then counter, counter

View File

@@ -1,8 +0,0 @@
Welcome to k-os.
Every program here runs with only the capabilities it was given:
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