diff options
| author | user <user@clank> | 2026-09-22 21:54:13 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-22 21:54:13 +0200 |
| commit | 0a7ff09a910eaf5bcb0dc76d08dc5a6c9c239495 (patch) | |
| tree | 35d6e8713ed3ea638e5aaea04d9c726f8f2c2d49 /README.md | |
| parent | net: one socket per client - four-tuple demux, spawning accept, bounded close (diff) | |
| download | gbos-0a7ff09a910eaf5bcb0dc76d08dc5a6c9c239495.tar.gz gbos-0a7ff09a910eaf5bcb0dc76d08dc5a6c9c239495.tar.xz gbos-0a7ff09a910eaf5bcb0dc76d08dc5a6c9c239495.zip | |
usr: ircd - an IRC server running on the Game Boy
/# ircd &
host$ irssi -c 10.0.0.2 /join #gbos
other GB$ irc 10.0.0.2 gb2 /join #gbos
Implements the subset a real client needs to get in and talk: NICK, USER,
PING/PONG, JOIN, PART, PRIVMSG/NOTICE (to a channel or to a nick), NAMES and
QUIT, with the 001/004/375/372/376 numerics clients wait for on registration,
353/366 on join, and 421 for anything else. One channel per client keeps the
bookkeeping in fixed-size tables; this is a handheld with 8 KiB of task RAM.
MAXCL is 3, bounded by the kernel socket table (listener + client each take a
slot, the rest left for other programs). A fourth client is refused and the
daemon keeps serving - which is how the ~30s close() stall turned up.
Every event is logged to the LCD, so the Game Boy shows its own server
traffic: "+ alice", "alice joined", "<alice> hello".
Verified with real clients over the hub: two and three simultaneous hosts
registering, joining, channel relay (sender not echoed to itself), private
messages by nick, PING/PONG, unknown-command numerics, QUIT propagation, the
overflow refusal, and a second Game Boy running gbos's own irc(1) in the same
channel as a laptop client - messages crossing both ways between them.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -26,10 +26,14 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).* `nc` (netcat: `nc HOST PORT` interactively, or `nc -s HOST PORT < file` to pipe a request in and print the reply), `chat`, and a colorized **IRC client** (`irc HOST [NICK]`, `/join` and friends, SELECT for the keyboard). -- **It serves, too**: the kernel does passive opens (`listen`/`accept`), and - `httpd` puts the cart's filesystem on the web — `httpd &`, then point a - browser at the Game Boy: files are served from battery-backed RAM and - directories come back as clickable listings. +- **It serves, too**: the kernel does passive opens (`listen`/`accept`, one + socket per client), so the Game Boy runs daemons. `httpd` puts the cart's + filesystem on the web — `httpd &`, then point a browser at it: files come + from battery-backed RAM, directories as clickable listings. `ircd` is a + real IRC server — `ircd &`, then `irssi -c 10.0.0.2`: NICK/USER/JOIN/ + PRIVMSG/PING/NAMES/PART/QUIT, with the channel relayed between clients. + A laptop and a second Game Boy can sit in the same channel, hosted by a + Game Boy. - **A network to plug into**: `tools/gbhub` is a virtual switch + DHCP server + NAT gateway — spawn a fleet of Game Boys that ping *each other* and reach the real internet; `tools/gbjoin` attaches an interactive GB to it, and @@ -59,6 +63,11 @@ tools/gbtype 'ping 10.0.0.3' # or type into it from the host # serve the Game Boy's filesystem to your browser: tools/gbtype 'httpd &' # then open http://10.0.0.2/ curl http://10.0.0.2/readme # files straight out of cart RAM + +# or host an IRC network on it: +tools/gbtype 'ircd &' # then, from the host: +irssi -c 10.0.0.2 # /join #gbos +tools/gbtype -g 1 'irc 10.0.0.2 gb2' # a second GB joins the same channel ``` On the Game Boy: **SELECT** toggles the on-screen keyboard, d-pad + **A** |
