aboutsummaryrefslogtreecommitdiffstats
path: root/include/gbos.inc
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-17 01:28:23 +0200
committeruser <user@clank>2026-07-17 01:28:23 +0200
commitb5544e84232b80351e7c58501c1632080a354d12 (patch)
treea4087d5c9df0589b613bcb6696962825099ce8b7 /include/gbos.inc
parentpipe: PIPE_MAX 2->4 (5-stage pipelines) + fix cross-yield byte corruption (diff)
downloadgbos-b5544e84232b80351e7c58501c1632080a354d12.tar.gz
gbos-b5544e84232b80351e7c58501c1632080a354d12.tar.xz
gbos-b5544e84232b80351e7c58501c1632080a354d12.zip
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).
Diffstat (limited to '')
-rw-r--r--include/gbos.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/gbos.inc b/include/gbos.inc
index bd7fbc2..71d6fa0 100644
--- a/include/gbos.inc
+++ b/include/gbos.inc
@@ -126,7 +126,9 @@ DEF SYS_MKDIR EQU 25 ; make a directory (DE=path -> A=0/$FF)
DEF SYS_CHDIR EQU 26 ; change directory (DE=path -> A=0/$FF)
DEF SYS_OPENDIR EQU 27 ; point ls at a directory (DE=path -> A=0/$FF)
DEF SYS_PIPE EQU 28 ; make a pipe (-> A=read fd; write=A+1)
-DEF SYS_MAX EQU 29
+DEF SYS_SSEND EQU 29 ; link-port: transmit one byte (E=byte)
+DEF SYS_SRECV EQU 30 ; link-port: receive one byte (-> A=byte, blocks)
+DEF SYS_MAX EQU 31
; SYS_KILL (9) is now implemented (B=pid -> A=0/$FF; pid 1 is immortal)
; (SYS_OPEN=4 / SYS_CLOSE=5 are now implemented by the filesystem)
@@ -211,5 +213,6 @@ DEF PROG_BLK EQU 19
DEF PROG_MKDIR EQU 20
DEF PROG_COUNT EQU 21
DEF PROG_PTEST EQU 22
+DEF PROG_NECHO EQU 23
ENDC