updated spec

This commit is contained in:
~d6 2023-11-17 22:39:16 -05:00
parent 02084e8b5b
commit f2dd113134
1 changed files with 17 additions and 10 deletions

View File

@ -61,14 +61,10 @@ the param ports (0x1c-0x1d) specify the a value to use as a parameter
for a host-put (0x1f). the meaning values by host-put value:
- 0x00 - (nop) unused
- 0x01 - (execute) command string (e.g. 'gcc -o "demo" demo.c')
- 0x02 - (pid) unused
- 0x02 - (getpid) unused
- 0x03 - (kill) unused
- 0x08 - (pty-set-height) height as u16 integer
- 0x09 - (pty-set-width) width as u16 integer
- 0x10 - (getenv) name string (e.g. "TERM")
- 0x11 - (setenv) assignment string (e.g. "TERM=vt100")
- 0x20 - (tty-set-raw) unused
- 0x21 - (tty-unset-raw) unused
strings must be null-terminated. commands are parsed by /bin/sh -c.
the opts port (0x1e) specifies options that affect host actions run
@ -87,19 +83,30 @@ using the host-put port (0x1f):
the host-put port (0x1f) specifies which host action to take:
- 0x00 - nop: does nothing
- 0x01 - execute: reads command string, starts a subprocess
- 0x02 - pid: responds with child process pid (if any)
- 0x02 - getpid: responds with child process pid (if any)
- 0x03 - kill: shuts down child process
- 0x08 - pty-set-height: set a child's pty height
- 0x09 - pty-set-width: set a child's pty width
- 0x10 - getenv: looks up a name (e.g. TERM) in env, responds with value
- 0x11 - setenv: reads an assignment (e.g. TERM=vt100), updates env
- 0x20 - tty-set-raw: enable raw mode in emulator's terminal
- 0x21 - tty-unset-raw: disable raw mode in emulator's terminal
EXAMPLE PROGRAM FRAGMENTS
( ----------------------------------- )
0. The following fragment uses `stty raw -echo` to enable a raw tty:
|0100 ( -- BRK )
run-stty ( ; set up raw mode )
... BRK ( ; do other initialization )
@run-stty ( -- )
;stty-cmd .Console/param DEO2 ( ; set up make to run )
#00 .Console/opts DEO ( ; use child 0 without pipelines )
#01 .Console/host-put DEO JMP2r ( ; run the command now and return )
@stty-cmd "stty 20 "raw 20 "-echo 00 ( ; buffer containing cmd to run )
( ----------------------------------- )
1. The following fragment runs `make` and acts based on its exit code:
|0100 ( -- BRK )