aboutsummaryrefslogtreecommitdiffstats
path: root/src/programs.asm
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-22 21:54:13 +0200
committeruser <user@clank>2026-09-22 21:54:13 +0200
commit0a7ff09a910eaf5bcb0dc76d08dc5a6c9c239495 (patch)
tree35d6e8713ed3ea638e5aaea04d9c726f8f2c2d49 /src/programs.asm
parentnet: one socket per client - four-tuple demux, spawning accept, bounded close (diff)
downloadgbos-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 '')
-rw-r--r--src/programs.asm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/programs.asm b/src/programs.asm
index 31125a2..0277dcc 100644
--- a/src/programs.asm
+++ b/src/programs.asm
@@ -154,6 +154,9 @@ ProgNc:
SECTION "prog_httpd", ROMX[$4000], BANK[39]
ProgHttpd:
INCBIN "build/usr/httpd.bin"
+SECTION "prog_ircd", ROMX[$4000], BANK[40]
+ProgIrcd:
+ INCBIN "build/usr/ircd.bin"
; -----------------------------------------------------------------------------
; PROG_SH (bank 3) - the shell, now written in C (usr/sh.c): parses >/</| and
@@ -272,6 +275,8 @@ ProgramTable::
dw ProgNc
db LOW(BANK(ProgHttpd)), HIGH(BANK(ProgHttpd))
dw ProgHttpd
+ db LOW(BANK(ProgIrcd)), HIGH(BANK(ProgIrcd))
+ dw ProgIrcd
ProgramTableEnd::
; -----------------------------------------------------------------------------
@@ -355,4 +360,6 @@ NameTable::
db PROG_NC
db "httpd", 0
db PROG_HTTPD
+ db "ircd", 0
+ db PROG_IRCD
db 0