aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / evidence / allen-omega-L694 / L748 / independent-review / probes / provider-semantic-output.om
| 1 | global Obuf uchar 256 |
| 2 | text Omagic "ALNPRV01" |
| 3 | fn test ok bool to void |
| 4 | check ok add get Checks 0 1 |
| 5 | end |
| 6 | fn getheader p ulong to ulong |
| 7 | v = ulong 0 |
| 8 | for i ulong 8 |
| 9 | v = or v shl ulong get Obuf add p i mul i 8 |
| 10 | end |
| 11 | ret v |
| 12 | end |
| 13 | fn main to int |
| 14 | n = ulong 0 |
| 15 | while lt n 120 |
| 16 | r = read 0 Obuf n sub len Obuf n |
| 17 | if le r 0 |
| 18 | ret 65 |
| 19 | end |
| 20 | n = add n ulong r |
| 21 | end |
| 22 | test eq n 120 |
| 23 | for rec ulong 3 |
| 24 | p = mul rec 40 |
| 25 | for i ulong 8 |
| 26 | test eq get Obuf add p i get Omagic i |
| 27 | end |
| 28 | if eq rec 2 |
| 29 | test eq getheader add p 8 6 |
| 30 | else |
| 31 | test eq getheader add p 8 1 |
| 32 | end |
| 33 | if eq rec 0 |
| 34 | test eq getheader add p 16 1 |
| 35 | else |
| 36 | if eq rec 1 |
| 37 | test eq getheader add p 16 0 |
| 38 | else |
| 39 | test eq getheader add p 16 1 |
| 40 | end |
| 41 | end |
| 42 | test eq getheader add p 24 0 |
| 43 | test eq getheader add p 32 0 |
| 44 | end |
| 45 | test eq get Checks 0 37 |
| 46 | if ne get Fails 0 0 |
| 47 | ret 1 |
| 48 | end |
| 49 | ret 0 |
| 50 | end |