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
omega-mv / seed / omc / sites / found-xhmnew-2.om
| 1 | target x86linux |
| 2 | note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in xhmnew (code 9) |
| 3 | note dev.om: an OM-2 function unit (no fn main) using every function-mode clock and device word: |
| 4 | note monons realns sleepns, devctl devcall uvmctl, mapnew mapaddr mapset mapget mapwrite mapread mapdrop, |
| 5 | note with cpufence between the payload and the doorbell. The mapping words find their table through |
| 6 | note runtime-table entry 31 (seed/host/MAPPING.md, function mode); the exact code is pinned by sha256. |
| 7 | om2 |
| 8 | fn clk to long |
| 9 | a = monons |
| 10 | s = sleepns long 1000 |
| 11 | b = monons |
| 12 | r = realns |
| 13 | if lt s 0 |
| 14 | ret s |
| 15 | end |
| 16 | if lt r 0 |
| 17 | ret r |
| 18 | end |
| 19 | ret sub b a |
| 20 | end |
| 21 | fn dev fd int to long |
| 22 | b = new uchar 48 0 |
| 23 | r = devctl fd uint 21531 b 0 4 |
| 24 | if lt r 0 |
| 25 | ret r |
| 26 | end |
| 27 | r = devctl fd uint 3224389163 b 0 48 |
| 28 | hd = new uchar 32 0 |
| 29 | pa = new uchar 16 0 |
| 30 | k = devcall fd uint 3223340587 hd 0 32 pa 0 16 |
| 31 | u = uvmctl fd uint 75 b 0 8 |
| 32 | ret add add r k u |
| 33 | end |
| 34 | fn ring v ulong to long |
| 35 | h = mapnew neg int 1 0 4096 3 15 |
| 36 | if lt h 0 |
| 37 | ret h |
| 38 | end |
| 39 | p = new uchar 16 7 |
| 40 | a = mapaddr h |
| 41 | w = mapwrite h 16 p 0 16 |
| 42 | cpufence |
| 43 | d = mapset h 8 8 v |
| 44 | d = mapset h 0 4 1 |
| 45 | x = long mapget h 8 8 |
| 46 | q = new uchar 16 0 |
| 47 | n = mapread h 16 q 0 16 |
| 48 | z = mapdrop h |
| 49 | if eq a 0 |
| 50 | ret -1 |
| 51 | end |
| 52 | ret add x long get q 15 |
| 53 | end |