4.1 KiB
SecLink Terminal Demo
DOS terminal emulator combining the DVX windowed GUI with SecLink encrypted serial communication. Connects to a remote BBS through the SecLink proxy, providing a full ANSI terminal in a DVX-style window with encrypted transport.
Architecture
termdemo (DOS, 86Box)
|
+--- DVX GUI windowed desktop, ANSI terminal widget
|
+--- SecLink encrypted serial link
| |
| +--- packet HDLC framing, CRC, retransmit
| +--- security DH key exchange, XTEA-CTR cipher
| +--- rs232 ISR-driven UART I/O
|
COM port (86Box emulated modem)
|
TCP:2323
|
secproxy (Linux)
|
TCP:23
|
Remote BBS
All traffic between the terminal and the proxy is encrypted via XTEA-CTR on SecLink channel 0. The proxy decrypts and forwards plaintext to the BBS over telnet.
Usage
termdemo [com_port] [baud_rate]
| Argument | Default | Description |
|---|---|---|
com_port |
1 | COM port number (1-4) |
baud_rate |
115200 | Serial baud rate |
termdemo # COM1 at 115200
termdemo 2 # COM2 at 115200
termdemo 1 57600 # COM1 at 57600
termdemo -h # show usage
Startup Sequence
- Seed the RNG from hardware entropy
- Open SecLink on the specified COM port (8N1, no handshake)
- Perform DH key exchange (blocks until the proxy completes its side)
- Initialize the DVX GUI (1024x768, 16bpp VESA)
- Create a resizable terminal window with menu bar and status bar
- Enter the main loop
The handshake completes in text mode before the GUI starts, so the DOS console shows progress messages during connection setup.
Main Loop
Each iteration:
dvxUpdate()-- process mouse, keyboard, paint, and window eventssecLinkPoll()-- read serial data, decrypt, deliver to ring bufferwgtAnsiTermPoll()-- drain ring buffer into the ANSI parser
Data Flow
BBS -> proxy -> serial -> secLinkPoll() -> onRecv() -> ring buffer
-> commRead() -> wgtAnsiTermWrite() -> ANSI parser -> screen
Keyboard -> widgetAnsiTermOnKey() -> commWrite()
-> secLinkSend() -> serial -> proxy -> BBS
A 4KB ring buffer bridges the SecLink receive callback (which fires
during secLinkPoll()) and the terminal widget's comm read interface
(which is polled by wgtAnsiTermPoll()).
GUI
- Window: resizable, titled "SecLink Terminal"
- Menu bar: File -> Quit
- Terminal: 80x25 ANSI terminal widget with 1000-line scrollback
- Status bar: shows COM port, baud rate, and encryption status
The ANSI terminal widget supports standard escape sequences including cursor control, SGR colors (16-color CGA palette), erase, scroll, insert/delete lines, and DEC private modes (cursor visibility, line wrap).
Test Setup
-
Start the SecLink proxy on the Linux host:
secproxy 2323 bbs.example.com 23 -
Configure 86Box with a COM port pointing at the proxy's listen port (TCP client mode, port 2323, no telnet negotiation)
-
Run the terminal inside 86Box:
termdemo -
The handshake completes, the GUI appears, and BBS output is displayed in the terminal window
Building
make # builds ../bin/termdemo.exe
make clean # removes objects and binary
The Makefile builds all dependency libraries automatically. Objects
are placed in ../obj/termdemo/, the binary in ../bin/.
Dependencies
All libraries are in ../lib/:
| Library | Purpose |
|---|---|
libdvx.a |
DVX windowed GUI and widget system |
libseclink.a |
Secure serial link wrapper |
libpacket.a |
HDLC framing and reliability |
libsecurity.a |
DH key exchange and XTEA cipher |
librs232.a |
ISR-driven UART serial driver |
Target: DJGPP cross-compiler, 486+ CPU, VESA VBE 2.0+ video.
Files
termdemo/
termdemo.c terminal emulator program
Makefile DJGPP cross-compilation build