aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-24 12:48:51 +0200
committeruser <user@clank>2026-09-24 12:48:51 +0200
commit65b53de14dc6918db39b6ee6dc032f805182daad (patch)
tree6af7b52262321a3cbe11e1d472ca2938df2fc37e /README.md
parentsh: run scripts, and >> redirection (diff)
downloadgbos-65b53de14dc6918db39b6ee6dc032f805182daad.tar.gz
gbos-65b53de14dc6918db39b6ee6dc032f805182daad.tar.xz
gbos-65b53de14dc6918db39b6ee6dc032f805182daad.zip
usr: ls -l, df, mv, tail, tee, sleep, help, poweroff
Filling in the core utilities the box was missing: - ls -l: type, links and size, now that stat() exists. The screen is 40 columns, so it is "d 1 256 name", not the GNU sprawl. Sizes were previously unknowable except one file at a time with wc -c. - df: blocks and inodes, used and free, on the 32 KiB cart disk. - mv: no rename syscall, so it is cp + rm - and the copy has to finish before the source goes, or a failure loses the file. - tail [-n N]: no seek syscall, so it streams the input through a ring of N lines rather than jumping to the end. N is capped by that ring. - tee: the missing half of a pipeline - `cat big | tee copy | wc -l`. - sleep: the thing every script needs; the kernel counts 1/64 s ticks. - help: lists every command the shell knows, walked out of the kernel's own name table. The box previously had no way to tell you what it could do. - poweroff: the only safe way to stop a gbos that has data on it. The cart's battery RAM is written when the emulator exits cleanly, so killing it loses the whole filesystem - it comes back "formatted". Found while testing /rc.
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 12 insertions, 6 deletions
diff --git a/README.md b/README.md
index c84eb43..8596fe2 100644
--- a/README.md
+++ b/README.md
@@ -17,9 +17,12 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).*
background jobs (`spin &`), `ps`, `kill` — round-robin cooperative
scheduling across banked memory with an HRAM context switch.
- **A shell** (written in C, running *on* the GB) with I/O redirection
- (`>` `<`) and pipes (`|`), argument passing, and a cwd-aware prompt — with
- `grep` to put on the other end of the pipe, and `more` to page anything
- longer than the 18-row screen.
+ (`>` `<` `>>`) and pipes (`|`), argument passing, and a cwd-aware prompt —
+ with `grep` to put on the other end of the pipe, `tee` to fork it, and
+ `more` to page anything longer than the 18-row screen.
+- **Shell scripts**: a shell fed from a file (`sh < script`) runs it with no
+ prompt and no echo, and init runs **`/rc`** at boot if the cart has one —
+ so a Game Boy can come up with its own startup script.
- **Networking, for real**: the kernel owns SLIP over the link port, IPv4,
ICMP, UDP and TCP; userland gets BSD-ish sockets via one syscall. On top:
`dhcp` (boot-time lease), `ping`, `nslookup` (real DNS), `wget` (HTTP),
@@ -42,9 +45,12 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).*
colors) + an **on-screen keyboard** on the window layer (SELECT toggles it).
- **Persistent filesystem** on battery-backed cart RAM: inodes, nested
directories, per-process cwd — survives power-off (files up to 3 KiB).
-- **A C toolchain**: userland is plain C compiled with SDCC (`sm83`); ~35
- tools ship in `usr/` (`cat`, `wc`, `head`, `grep`, `cp`, `more`, `ls`,
- `uptime`, …). Adding a program is one `.c` file + a table entry.
+ `ls -l` and `df` report sizes and free space; `poweroff` is the only safe
+ way to stop the machine (the battery save is written on a clean exit).
+- **A C toolchain**: userland is plain C compiled with SDCC (`sm83`); ~45
+ tools ship in `usr/` (`cat`, `wc`, `head`, `tail`, `grep`, `cp`, `mv`,
+ `tee`, `more`, `ls`, `df`, `sleep`, `uptime`, …) — `help` lists them all on
+ the Game Boy itself. Adding a program is one `.c` file + a table entry.
## Quick start