interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / omc / sites / found-xhreq-2.om

103 lines · 1768 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in xhreq (code 9)
2note Host/device composition. No GPU opened. FIONREAD observes real native pipes.
3global ends uchar 8
4global count uchar 12
5global status uchar 4
6text msg "Omega device boundary"
7text zero "/dev/zero"
8fn word32 off ulong to int
9v = uint 0
10for i ulong 4
11v = or v shl uint get ends add off i mul i 8
12end
13ret int v
14end
15fn fault kind int to int
16if eq kind 0
17r = devctl neg 65536 1 uint 21531 count 0 3
18ret int r
19end
20if eq kind 1
21r = devctl neg int 1 uint 21531 count 0 5
22ret int r
23end
24if eq kind 2
25r = devctl neg int 1 uint 21531 count 9 4
26ret int r
27end
28if eq kind 3
29r = devctl neg int 1 uint 21531 count 18446744073709551615 4
30ret int r
31end
32r = devctl neg int 1 uint 21531 count 0 18446744073709551615
33ret int r
34end
35fn main to int
36if ne pipefds ends 0 8 0 0
37ret 1
38end
39rd = word32 0
40wr = word32 4
41if ne write wr msg 0 len msg long len msg
42ret 2
43end
44for i ulong 12
45put count i 171
46end
47if ne devctl rd uint 21531 count 4 4 0
48ret 3
49end
50if ne get count 4 uchar len msg
51ret 4
52end
53for i ulong 12
54if or lt i 4 ge i 8
55if ne get count i 171
56ret 5
57end
58else
59if and gt i 4 ne get count i 0
60ret 6
61end
62end
63end
64if ne devctl neg int 1 uint 21531 count 4 4 neg long 9
65ret 7
66end
67note Normal file operations and nested native calls retain live values.
68fd = fopen zero 0 len zero 0 0
69if lt fd 0
70ret 8
71end
72if ne add devctl int fd uint 21531 count 4 4 25 0
73ret 9
74end
75if ne fclose int fd 0
76ret 10
77end
78if ne fclose rd 0
79ret 11
80end
81if ne fclose wr 0
82ret 12
83end
84for kind int 5
85pid = fork
86if lt pid 0
87ret 13
88end
89if eq pid 0
90exit fault kind
91end
92if ne waitpid int pid status 0 4 0 pid
93ret 14
94end
95if ne get status 0 0
96ret 15
97end
98if ne get status 1 103
99ret 16
100end
101end
102ret 0
103end