UMIX/86 - MUX and TCP/IP

Framed MUX protocol

The terminal link is a byte stream carrying variable-length frames:

02  | type | termid | len | payload (0..250) | XOR | 03
STX           1..10           0x02  STX, 0x03 ETX, XOR covers type..payload
typemeaning
01 DATAterminal input/output
02 OPENclaim a terminal; payload[0] = app id
03 CLOSEsession finished
04 BUSYno free serial session
05 ACKOPEN accepted
06 ERRORprotocol error

Terminal id 0 is the guest console log; 1..10 are serial sessions; 0xFE is the IP channel. Apps: 1 console/shell, 2 web, 3 upload. OPEN may carry a printable line (client address) that the guest logs on the console.

Flow control

Each session has a 256-byte receive ring and a 64-byte transmit buffer; a newline flushes the transmit buffer as a frame. The guest UART has no FIFO, so the bridge paces input: 64-byte chunks for web/upload, 8-byte frames with a 10 ms gap for console input. A full transmit buffer drops bytes, never overruns.

Host bridge

bridge optiongives you
--listenraw TCP terminal sessions (app 1)
--http-listenweb requests (app 2) to the guest web server
--upload-listenPUT uploads (app 3)
--ip --tftp-listenUDP relay and TFTP

TCP/IP stack

The kernel has IPv4, ICMP and UDP. It answers ping, carries the terminal session over UDP, and runs an in-guest TFTP server on UDP 69. For TCP, the guest loads TCP.SYS at 0x2900: a SLIP link at 9600 baud with a proto-6 mailbox, ARP, TCP and a small HTTP server. The host runs slattach/ifconfig and points a browser at 192.168.99.1.

MUX and TCP are mutually exclusive: both use the 0x2900 window and the same serial link. The pages you are reading went through MUX, not TCP.SYS.