omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
| 1 | note omega-mcp: state shared by every unit. Globals hold only what host words read or write |
| 2 | note directly (a global is never passed as an argument); request, tape, writer and reference data |
| 3 | note live in fn main's frame and travel as sized parameters. |
| 4 | |
| 5 | note gv: scalar state cells, indexed by the g* constants below. |
| 6 | global gv ulong 64 |
| 7 | note pk: packed argument list for execprog (u16 count, then u16 length + bytes per record). |
| 8 | global pk uchar 4096 |
| 9 | note pa: path scratch; tdir: the per-call temporary directory path. |
| 10 | global pa uchar 4096 |
| 11 | global tdir uchar 64 |
| 12 | note sx: this executable; omcp: the pinned compiler; datp: the reference data directory. |
| 13 | global sx uchar 4096 |
| 14 | global omcp uchar 4096 |
| 15 | global datp uchar 4096 |
| 16 | note cb: captured bytes. 0..32767 program stdout, 32768..40959 program stderr, |
| 17 | note 40960..45055 compiler stderr, 45056..110591 example source. |
| 18 | global cb uchar 131072 |
| 19 | note wst: waitpid status; fds: pipefds output; sbuf: status record from the reaper. |
| 20 | global wst uchar 8 |
| 21 | global fds uchar 8 |
| 22 | global sbuf uchar 8 |
| 23 | note rl: one resource-limit pair for the prlimit host word (new soft, hard in; old soft, hard out) |
| 24 | global rl uchar 32 |
| 25 | note inf: bwrap --info-fd text; lb: one server log line; rnd: random bytes; qb: decoded query. |
| 26 | global inf uchar 1024 |
| 27 | global lb uchar 1024 |
| 28 | global rnd uchar 16 |
| 29 | global qb uchar 256 |
| 30 | note bsha: a sha256 digest (the compiler at start-up, then each compiled binary); hbuf: discard buffer |
| 31 | note for unexpected status-pipe bytes. |
| 32 | global bsha uchar 32 |
| 33 | global hbuf uchar 64 |
| 34 | |
| 35 | note gv cells |
| 36 | const gpkn ulong 0 |
| 37 | const gpkl ulong 1 |
| 38 | const gpkr ulong 2 |
| 39 | const gtdl ulong 3 |
| 40 | const gsxl ulong 4 |
| 41 | const gomcl ulong 5 |
| 42 | const gdatl ulong 6 |
| 43 | const gnoiso ulong 7 |
| 44 | const glbl ulong 8 |
| 45 | const gpkov ulong 9 |
| 46 | const gtag ulong 10 |
| 47 | const gst ulong 11 |
| 48 | const gwall ulong 12 |
| 49 | const gbws ulong 13 |
| 50 | const gelms ulong 14 |
| 51 | const gsbf ulong 15 |
| 52 | const gcrc ulong 16 |
| 53 | const gcln ulong 17 |
| 54 | const gcer ulong 18 |
| 55 | const gbinn ulong 19 |
| 56 | const goutn ulong 20 |
| 57 | const gerrn ulong 21 |
| 58 | const goutc ulong 22 |
| 59 | const gerrc ulong 23 |
| 60 | const gcerc ulong 24 |
| 61 | const gcern ulong 25 |
| 62 | const gtmo ulong 26 |
| 63 | const gsin ulong 27 |
| 64 | const gfin ulong 28 |
| 65 | const gfout ulong 29 |
| 66 | const gferr ulong 30 |
| 67 | const gsr ulong 31 |
| 68 | const gsw ulong 32 |
| 69 | const gbr ulong 33 |
| 70 | const gbw ulong 34 |
| 71 | const gir ulong 35 |
| 72 | const giw ulong 36 |
| 73 | const gpid ulong 37 |
| 74 | const gcpid ulong 38 |
| 75 | const gidt ulong 39 |
| 76 | const gpar ulong 40 |
| 77 | const garg ulong 41 |
| 78 | const gqll ulong 42 |
| 79 | const gqk ulong 43 |
| 80 | const gqc ulong 44 |
| 81 | const gqln ulong 45 |
| 82 | const gisok ulong 46 |
| 83 | const gexn ulong 47 |
| 84 | const gran ulong 48 |
| 85 | const gmeth ulong 49 |
| 86 | const gtool ulong 50 |
| 87 | const gres ulong 51 |
| 88 | const gsgot ulong 53 |
| 89 | note geof: 1 while the rest of an overlong request line is being discarded |
| 90 | const geof ulong 54 |
| 91 | note tools/call arguments: source and stdin string tokens, the query token, why a stage stopped |
| 92 | const gsrct ulong 55 |
| 93 | const gstdt ulong 56 |
| 94 | const gqt ulong 57 |
| 95 | const gstop ulong 58 |
| 96 | |
| 97 | note capture regions in cb |
| 98 | const cbout ulong 0 |
| 99 | const cboutn ulong 32768 |
| 100 | const cberr ulong 32768 |
| 101 | const cberrn ulong 8192 |
| 102 | const cbcer ulong 40960 |
| 103 | const cbcern ulong 4096 |
| 104 | const cbex ulong 45056 |
| 105 | const cbexn ulong 65536 |
| 106 | |
| 107 | note limits (bytes, seconds, nanoseconds) |
| 108 | const maxsrc ulong 524288 |
| 109 | const maxline ulong 983040 |
| 110 | const runcpu ulong 10 |
| 111 | const runas ulong 268435456 |
| 112 | const runfsz ulong 1048576 |
| 113 | const runnpr ulong 5 |
| 114 | const cmpcpu ulong 20 |
| 115 | const cmpas ulong 536870912 |
| 116 | const cmpfsz ulong 16777216 |
| 117 | const cmpnpr ulong 4 |
| 118 | const cmpwall ulong 20000000000 |
| 119 | const deftmo ulong 5000 |
| 120 | const maxtmo ulong 30000 |
| 121 | |
| 122 | note arm64 open flags: wronly|creat|excl|nofollow|cloexec = 557249; rdonly|nofollow|cloexec = 557056; |
| 123 | note wronly|nofollow|cloexec = 557057 (the reaper opens the stage files the parent already created) |
| 124 | const ofnew int 557249 |
| 125 | const ofrd int 557056 |
| 126 | const ofwr int 557057 |
| 127 | |
| 128 | note texts |
| 129 | text khex "0123456789abcdef" |
| 130 | text ktmp "/tmp/omega-mcp-" |
| 131 | note kpin (the omc sha256) and kmv (the omega-mv revision, 8 characters) come from build/pin.om, which |
| 132 | note build.sh writes from PIN before this unit (src/UNITS) |
| 133 | text kver "0.1.0" |
| 134 | text kname "omega-mcp" |