aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gbhub (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gbhub: control socket + gbtype to inject shell input without the OSKuser4 days1-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gbhub: make GB drops attributable, not spookyuser4 days1-5/+15
| | | | | | | | | | | | 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_<n>.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).
* tools: gbhub --daemon + gbjoin - interactive multi-Game-Boy networkinguser4 days1-20/+57
| | | | | | | | | | | | | | | | | | | 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 -> 10.0.0.2 term 3: tools/gbjoin # windowed GB -> 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<->GB ping.
* tools: gbhub - many Game Boys on one network (DHCP pool + inter-GB routing)user4 days1-0/+166
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<->GB vs GB<->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 -> 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.