<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gbos.git/tools/gbhub, branch master</title>
<subtitle>gbos - a tiny Unix-flavored OS for the Game Boy Color (kernel, shell, coreutils in C, RAM filesystem)</subtitle>
<id>https://git.sl0p.foo/gbos.git/atom/tools/gbhub?h=master</id>
<link rel='self' href='https://git.sl0p.foo/gbos.git/atom/tools/gbhub?h=master'/>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/'/>
<updated>2026-07-17T18:31:00Z</updated>
<entry>
<title>gbhub: control socket + gbtype to inject shell input without the OSK</title>
<updated>2026-07-17T18:31:00Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-07-17T18:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/commit/?id=138e0ad2eb25ee078464c7e2ff7d6a919a188634'/>
<id>urn:sha1:138e0ad2eb25ee078464c7e2ff7d6a919a188634</id>
<content type='text'>
Typing into a Game Boy meant driving the on-screen keyboard by hand. But
the link port already *is* the shell's console: bytes the hub sends
un-SLIP-framed land straight on stdin (that's what GB.type() has always
done for spawn-mode command scripting). This just exposes it.

gbhub now serves a control socket (/tmp/gbhub.ctl, world-connectable like
the join socket) accepting two commands: 'list' and 'type [idx]' followed
by a payload (delimited by the client's half-close). Injection is chunked
and paced to respect the 64-byte kernel console ring, so arbitrarily long
input - even multi-line scripts - reaches the shell without overflow. The
server runs in both daemon and spawn modes.

tools/gbtype is the client:
  tools/gbtype 'ls -l'        run a command on GB0 (Enter appended)
  tools/gbtype -g 1 ps        target the Nth joined Game Boy
  tools/gbtype -n abc         no trailing Enter
  tools/gbtype -r             just press Enter
  tools/gbtype -l             list connected Game Boys
  printf 'ls\nuname\n' | tools/gbtype    pipe a script via stdin

Options precede the command; the first non-option word starts literal
text, so 'gbtype ls -l' needs no quoting. No root required.

Verified end to end: injected list/uname/echo through the real CTL
protocol and saw the shell execute each and echo output back.
</content>
</entry>
<entry>
<title>gbhub: make GB drops attributable, not spooky</title>
<updated>2026-07-17T17:47:12Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-07-17T17:47:12Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/commit/?id=6f8243ef094241d3a4175fd2deed23fe5ee946ce'/>
<id>urn:sha1:6f8243ef094241d3a4175fd2deed23fe5ee946ce</id>
<content type='text'>
Link-drop investigation fallout - every drop looked identical because
the hub discarded all the evidence:

- gb_reader logs *how* a GB left (clean eof vs the exception) with
  timestamps on join/leave, for correlating against SSH/terminal events.
- Spawn mode keeps each emulator's stderr in /tmp/gbhub_&lt;n&gt;.err instead
  of devnull - postmortems get the emulator's side of the story.
- A second gbhub exits with a clear 'already running?' message instead
  of an ioctl traceback (and can't damage the live hub's NAT/socket).
</content>
</entry>
<entry>
<title>tools: gbhub --daemon + gbjoin - interactive multi-Game-Boy networking</title>
<updated>2026-07-17T12:26:06Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-07-17T12:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/commit/?id=584b19508b31f444ae02a974b96d1a50b8e650a2'/>
<id>urn:sha1:584b19508b31f444ae02a974b96d1a50b8e650a2</id>
<content type='text'>
gbhub gains a --daemon mode: instead of spawning headless emulators, it just
runs the switch/router/DHCP and accepts link connections, handing each a lease
from a pool (10.0.0.2..) and freeing it on disconnect. The link socket is made
world-connectable so unprivileged emulators can join.

gbjoin (no root) launches a *windowed* Game Boy and plugs its link into the
running hub, with its own ROM copy so battery saves don't clash. So you get real
interactive Game Boys on one network:

    term 1:  sudo tools/gbhub --daemon
    term 2:  tools/gbjoin            # windowed GB -&gt; 10.0.0.2
    term 3:  tools/gbjoin            # windowed GB -&gt; 10.0.0.3
    (on each: SELECT for the OSK, then e.g. ping 10.0.0.3)

Verified two GBs join the daemon and get distinct leases; routing is the same
code path as the (already-verified) spawn-mode GB&lt;-&gt;GB ping.
</content>
</entry>
<entry>
<title>tools: gbhub - many Game Boys on one network (DHCP pool + inter-GB routing)</title>
<updated>2026-07-17T12:19:02Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-07-17T12:19:02Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/commit/?id=4bc5adf806a1f06ddfc456fa63ebebd3ae8e8a04'/>
<id>urn:sha1:4bc5adf806a1f06ddfc456fa63ebebd3ae8e8a04</id>
<content type='text'>
A virtual switch/router/DHCP for N emulators. It leases each Game Boy a distinct
address (10.0.0.2, 10.0.0.3, ...), routes packets between them by destination IP,
floods broadcasts, and NATs external traffic out a TUN. No kernel changes are
needed: the GB just sends to a dst IP over its one link and the hub decides
GB&lt;-&gt;GB vs GB&lt;-&gt;internet.

  sudo tools/gbhub 2 netd "ping 10.0.0.2"

Verified two Game Boys talking to each other:
  [GB0] dhcp: leased 10.0.0.2      [GB1] dhcp: leased 10.0.0.3
  [GB0] netd: up (10.0.0.2)        [GB1] ping 10.0.0.2 -&gt; 4/4 received

DHCP is keyed per connection (not MAC), so identical GBs still get unique IPs;
each emulator gets its own ROM copy so battery saves don't clash.
</content>
</entry>
</feed>
