aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgbc dev <gbc@localhost>2026-09-22 19:50:10 +0200
committergbc dev <gbc@localhost>2026-09-22 19:50:10 +0200
commitc1ce018c20c8b9f10b849c1b10c6862b666ea2f6 (patch)
tree03a35915a412ffa3336d12e2c1dbb03576ec2985 /src
parentwasm: expose the link port as host-drained byte queues (diff)
downloadsl0pboy-c1ce018c20c8b9f10b849c1b10c6862b666ea2f6.tar.gz
sl0pboy-c1ce018c20c8b9f10b849c1b10c6862b666ea2f6.tar.xz
sl0pboy-c1ce018c20c8b9f10b849c1b10c6862b666ea2f6.zip
web: network lab - several Game Boys on a virtual switch, in the page
/net.html plugs Game Boys into a switch that leases them addresses and routes between them: add one, add another, and they ping each other. Unplug either and its address goes back to the pool for the next one. web/gbhub.js is tools/gbhub (gbos) ported to the browser - SLIP framing, DHCP OFFER/ACK, unicast routing, broadcast flooding and ICMP echo for the gateway. It deliberately has no uplink: NAT needs a TUN device and a tab has no raw sockets, so packets addressed off-net are dropped and logged as "no route" rather than pretending. web/gbcore.js wraps one wasm instantiation as a GameBoy object. Several Game Boys are several instantiations of the same compiled Module - the core keeps its machine in a static, so each gets its own linear memory and is isolated for free. Measured 12.3x realtime per instance, so the page caps at 6. Each card gets a text input, because unframed link bytes are console I/O: it lands on the shell's stdin like tools/gbtype, so you can run `ping 10.0.0.3` without the on-screen keyboard. Verified headless (node, two Game Boys through the hub: 2/2 leases, ping 4/4 received) and in headless Chrome against the live site: 4 Game Boys at 60fps each, leases .2-.5, typing into a card's console pings another, unplug frees the address and a replug reclaims it, no exceptions.
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions