interplane.Get Omega
Read in your language

omega-mcp

aien-dev/omega-mcp

Brought by drakestapleton

branch main Branches Tags History

omega-mcp / src / state.om

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