UMIX/86 - services and BASIC

Services

servicehow
web serverGET / or /NAME.EXT from C:, and /api/* ; 4 KB files, text/html
JSON APIAPI.SYS at 0x9000; see Web API
TFTPUDP 69, GET/PUT, block 8..192, windowsize 1..4; PUT needs WRITE ON
BASIC routesAPI ROUTE /api/name FILE.BAS via INT 62h
jobsprime, sort, crc16, run one at a time by the kernel
JCLC:\STARTUP.JCL plus JCL FILE.JCL
chatterminal room and HTTP chat; see Chat

Web server

/ serves INDEX.HTM. Any other target maps to an 8.3 name in the C: root and is served if it exists (/README.TXT, /job.jcl?x=1). Missing, nested or larger than 4000 bytes gets 404.HTM or NOT FOUND. Every reply is Connection: close.

TFTP

TFTP ON        serve UDP 69 (needs MUX ON)
TFTP GET UMIX.SYS
TFTP PUT FILE   (needs WRITE ON)

BASIC

BASIC starts a GWBASIC-style, line-numbered interpreter: FOR/NEXT IF/THEN/ELSE GOTO GOSUB RETURN INPUT PRINT DIM, integer math, strings, LOAD/SAVE of .BAS files. Limits: 61-char lines, 16-bit integers, 63-char strings.

When a .BAS file is registered as an API route it is started through INT 62h. Before it runs, four string variables are preset:

P$request pathQ$query string
M$GET / POST / DELETEB$first 63 body chars

The interpreter's PRINT output is captured as the HTTP body. The route has a 90-tick budget; a busy BASIC session makes the route answer 503.

Jobs

POST /api/jobs with an app and params. The kernel pumps one job at a time between timer ticks; completed results are kept in the job table. Apps: prime (count primes), sort (sort a string list), crc16 (CRC of supplied data).