aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-24 22:45:04 +0200
committeruser <user@clank>2026-09-24 22:45:04 +0200
commit4cd933009dd6ce87fe710acfca6b1f786d51040c (patch)
tree67e50c2ab347ddc2ac3e5b6a5cf5a4cfc44cc8d0 /README.md
parentfs: mount the builtins at /bin (diff)
downloadgbos-4cd933009dd6ce87fe710acfca6b1f786d51040c.tar.gz
gbos-4cd933009dd6ce87fe710acfca6b1f786d51040c.tar.xz
gbos-4cd933009dd6ce87fe710acfca6b1f786d51040c.zip
usr: touch, tr, rev, cut, uniq
/# ls -l /bin > b /# cut -d \s -f 1 b | uniq -c 52 - - touch FILE...: gbfs has no timestamps (an MBC5 cart has no RTC), so touch does the half that means something here - make an empty file. O_APPEND is exactly right: it creates, and it does not truncate what is already there. - tr [-d] SET1 [SET2]: ranges (a-z), -d to delete, and a short SET2 padded with its last character, like tr(1). ASCII only - a 128-entry map. - rev, uniq [-c]: one line each, from a file or stdin like the other filters. Two things the tests caught. A bare "-" is a SET, not a flag, so `tr . -` has to skip flag-matching only when a letter follows the dash. And uniq compared an empty "line" against the last run at EOF and flushed a phantom blank one - a stray "1" in uniq -c output. tr and cut also take \s \t \n \r escapes, because the shell has no quoting: `-d ' '` arrives as three tokens, so a space or tab delimiter was simply untypeable. Shell quoting would be the better fix; this makes the tools usable today without touching the parser. Banks 49-53; 10 program slots left in the 1 MB ROM.
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/README.md b/README.md
index e828915..d0c3e8b 100644
--- a/README.md
+++ b/README.md
@@ -51,9 +51,10 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).*
show up as one anyway — `ls /bin` enumerates the kernel's own command
table, `cd /bin` works, and `xxd -l 16 /bin/uname` dumps the program's ROM
bank. Read-only, since it is ROM.
-- **A C toolchain**: userland is plain C compiled with SDCC (`sm83`); ~45
+- **A C toolchain**: userland is plain C compiled with SDCC (`sm83`); ~50
tools ship in `usr/` (`cat`, `wc`, `head`, `tail`, `grep`, `cp`, `mv`,
- `tee`, `more`, `ls`, `df`, `xxd`, `sleep`, `uptime`, …) — `help` lists them all on
+ `tee`, `tr`, `cut`, `uniq`, `rev`, `more`, `ls`, `df`, `xxd`,
+ `touch`, `sleep`, `uptime`, …) — `help` lists them all on
the Game Boy itself. Adding a program is one `.c` file + a table entry.
## Quick start