From b5544e84232b80351e7c58501c1632080a354d12 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 17 Jul 2026 01:28:23 +0200 Subject: net: SLIP framing over the link port + a host gateway (echo round-trip) First step of link-port networking. The LCD terminal + OSK freed the serial port from console duty, so it can be the network link. Kernel (src/net.asm): raw link-port serial that bypasses the console/ terminal - sys_ssend (transmit, GB drives the clock) and sys_srecv (receive, GB slave, blocks by yielding). Syscalls 29/30. Userland: libc ssend()/srecv(); c/necho.c does SLIP (RFC 1055) framing over them - send a packet, receive the reply, print it. Host: tools/gateway.py wraps the emulator, owns its link serial, speaks SLIP, and (for now) echoes every frame back - the "link cable adapter". Console (ASCII) bytes on the same channel are printed for visibility. Verified: `necho` sends a SLIP frame, the gateway decodes+echoes it, and gbos prints the reply - a real framed round-trip over the Game Boy link port. Next: swap the echo for actual network ops (DNS/HTTP or IRC/chat). --- src/programs.asm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/programs.asm') diff --git a/src/programs.asm b/src/programs.asm index e659cee..a0bef96 100644 --- a/src/programs.asm +++ b/src/programs.asm @@ -109,6 +109,9 @@ ProgCount: SECTION "prog_ptest", ROMX[$4000], BANK[24] ProgPtest: INCBIN "c/ptest.bin" +SECTION "prog_necho", ROMX[$4000], BANK[25] +ProgNecho: + INCBIN "c/necho.bin" ; ----------------------------------------------------------------------------- ; PROG_SH (bank 3) - the shell, now written in C (c/sh.c): parses >/ program id, searched by sys_lookup. @@ -249,4 +254,6 @@ NameTable:: db PROG_COUNT db "ptest", 0 db PROG_PTEST + db "necho", 0 + db PROG_NECHO db 0 -- cgit v1.3.1-sl0p