aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 22 insertions, 2 deletions
diff --git a/README.md b/README.md
index 929cafe..a0b8338 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,10 @@ $FFEF-$FFF2 HRAM bank shadows + switch target
## Syscall ABI
-User loads `C` = syscall number, args in `DE`/`B`, then `rst $30`. Return in `A`.
+User loads `C` = syscall number, args in `DE`/`B`/`HL`, then `rst $30`.
+Return in `A` (and `B` for `wait`). **The trap clobbers `BC`/`DE`/`HL`** (it uses
+`HL` to index the dispatch table), so userland must save any pointer it needs
+across a syscall (`push hl` / `pop hl`). Libc syscall stubs handle this for C.
| # | name | status |
|---|---------|--------|
@@ -52,7 +55,24 @@ User loads `C` = syscall number, args in `DE`/`B`, then `rst $30`. Return in `A`
| 7 | wait | ✅ blocks; reaps a zombie child → `A`=pid `B`=code |
| 8 | getpid | ✅ |
| 11| yield | ✅ cooperative switch |
-| 2,4,5,9,10 | read/open/close/kill/brk | ⛔ `ENOSYS` |
+| 2 | read | ✅ blocking console input (1 byte) via external-clock serial |
+| 4,5,9,10 | open/close/kill/brk | ⛔ `ENOSYS` |
+
+### The shell (PROG_SH)
+
+init `exec`s a tiny shell: **prompt → read a line (with echo) → match a command
+→ `fork`+`exec`+`wait`**. Commands live in a table (`worker`, `hello`). Runs
+entirely over the headless serial console:
+
+```
+$ hello
+hello world!
+$ worker
+worker!
+$ foo
+?
+$
+```
### Process lifecycle (exit / wait / reaping)