aboutsummaryrefslogtreecommitdiffstats
path: root/include/gbos.inc
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-17 12:15:09 +0200
committeruser <user@clank>2026-07-17 12:15:09 +0200
commitd102366e6808f74ef98044374d744e453efdbefa (patch)
tree6f35b79e4e0fb01c432262fbb5254f39331717ad /include/gbos.inc
parentnet: real routed IP via SLIP<->TUN bridge (you can *ping* a Game Boy) (diff)
downloadgbos-d102366e6808f74ef98044374d744e453efdbefa.tar.gz
gbos-d102366e6808f74ef98044374d744e453efdbefa.tar.xz
gbos-d102366e6808f74ef98044374d744e453efdbefa.zip
net: ping - GB-originated ICMP echo (a Game Boy pings the real internet)
New `ping [A.B.C.D]` program (PROG_PING=27, bank 29): builds and sends ICMP echo requests from 10.0.0.2, then reads replies off the link port. It keeps reading SLIP frames until it finds *our* echo reply, skipping the IGMP/mDNS/ SSDP multicast noise that shares 10.0.0.0/24. Reply wait uses a generous srecv_nb spin budget since the emulator runs uncapped (no timer syscall yet). Verified over the tunbridge (with NAT): /# ping 10.0.0.1 -> 4/4 received, ttl=64 (the SLIP peer/host) /# ping 1.1.1.1 -> 4/4 received, ttl=56 (Cloudflare, real net!) ttl=56 is a real internet round trip (64 minus the hops). Combined with the host being able to ping the GB, the Game Boy is now a full two-way ICMP host.
Diffstat (limited to 'include/gbos.inc')
-rw-r--r--include/gbos.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/gbos.inc b/include/gbos.inc
index 2de2a84..a80841c 100644
--- a/include/gbos.inc
+++ b/include/gbos.inc
@@ -219,5 +219,6 @@ DEF PROG_NECHO EQU 23
DEF PROG_WGET EQU 24
DEF PROG_CHAT EQU 25
DEF PROG_NETD EQU 26
+DEF PROG_PING EQU 27
ENDC