diff options
| author | user <user@clank> | 2026-07-17 20:31:00 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-07-17 20:31:00 +0200 |
| commit | 138e0ad2eb25ee078464c7e2ff7d6a919a188634 (patch) | |
| tree | 67090285cbd0ec47a4d2f87a93717f63aebf7d84 /src | |
| parent | irc: a bitchx/irssi-style IRC client (diff) | |
| download | gbos-138e0ad2eb25ee078464c7e2ff7d6a919a188634.tar.gz gbos-138e0ad2eb25ee078464c7e2ff7d6a919a188634.tar.xz gbos-138e0ad2eb25ee078464c7e2ff7d6a919a188634.zip | |
gbhub: control socket + gbtype to inject shell input without the OSK
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.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions
