Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/omc/sites/found-mmapio-2.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / sites / found-mmapio-2.om` 101 lines ยท 1900 bytes Raw Blame History 1 note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in mmapio (code 9) 2 note Exact word access through managed mappings. No GPU or device opens. 3 global bytes uchar 16 4 global status uchar 4 5 text msg "PASS managed addresses and ordered mapped words\n" 6 fn ck yes bool to void 7 if not yes 8 exit int 80 9 end 10 end 11 fn bad k int to void 12 h = mapnew neg int 1 0 4096 3 34 13 ck gt h 0 14 if eq k 0 15 ck eq mapdrop h 0 16 r = mapaddr h 17 ret 18 end 19 if eq k 1 20 ck eq mapdrop h 0 21 r = mapget h 0 1000 22 ret 23 end 24 if eq k 2 25 r = mapget h 4096 4 26 ret 27 end 28 if eq k 3 29 r = mapset h 4092 8 0 30 ret 31 end 32 if eq k 4 33 r = mapget h 1 4 34 ret 35 end 36 if eq k 5 37 r = mapset h 4 8 0 38 ret 39 end 40 if eq k 6 41 ro = mapnew neg int 1 0 4096 1 34 42 r = mapset ro 0 4 0 43 ret 44 end 45 if eq k 7 46 r = mapset h 0 4 `4294967296` 47 ret 48 end 49 r = mapget h `18446744073709551615` 8 50 end 51 fn held h long a ulong b ulong c ulong d ulong e ulong to void 52 ck gt mapaddr h 4096 53 ck eq mapset h 0 8 `18446744073709551615` 0 54 ck eq mapget h 0 8 `18446744073709551615` 55 ck eq a 101 56 ck eq b 202 57 ck eq c 303 58 ck eq d 404 59 ck eq e 505 60 end 61 fn main to int 62 h = mapnew neg int 1 0 4096 3 33 63 ck gt h 0 64 ck eq and mapaddr h 4095 0 65 held h 101 202 303 404 505 66 ck eq mapset h 8 4 `4294967295` 0 67 ck eq mapget h 8 4 `4294967295` 68 ck eq mapset h 12 4 `305419896` 0 69 ck eq mapread h 0 bytes 0 16 16 70 for i ulong 12 71 ck eq get bytes i 255 72 end 73 ck eq get bytes 12 120 74 ck eq get bytes 13 86 75 ck eq get bytes 14 52 76 ck eq get bytes 15 18 77 ck eq mapset h 4088 8 `81985529216486895` 0 78 ck eq mapget h 4088 8 `81985529216486895` 79 p = fork 80 ck ge p 0 81 if eq p 0 82 ck eq mapset h 0 8 42 0 83 exit int 0 84 end 85 ck eq waitpid int p status 0 4 0 p 86 ck and eq get status 0 0 eq get status 1 0 87 ck eq mapget h 0 8 42 88 ck eq mapdrop h 0 89 for k int 9 90 p = fork 91 ck ge p 0 92 if eq p 0 93 bad k 94 exit int 80 95 end 96 ck eq waitpid int p status 0 4 0 p 97 ck and eq get status 0 0 eq get status 1 103 98 end 99 ck eq write 1 msg 0 len msg long len msg 100 ret 0 101 end