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 / L725 / independent-review / lifecycle-review.om
| 1 | note Independent serialized lifecycle boundary probes; all assertions run in Omega. |
| 2 | global SavedOut uchar 8192 |
| 3 | fn test ok bool to void |
| 4 | n = get Outlen 0 |
| 5 | e = get Err 0 |
| 6 | for i ulong n |
| 7 | put SavedOut i get Outb i |
| 8 | end |
| 9 | check ok add get Checks 0 1 |
| 10 | for i ulong n |
| 11 | put Outb i get SavedOut i |
| 12 | end |
| 13 | put Outlen 0 n |
| 14 | put Err 0 e |
| 15 | end |
| 16 | fn copyout to void |
| 17 | put Inlen 0 get Outlen 0 |
| 18 | for i ulong get Outlen 0 |
| 19 | put In i get Outb i |
| 20 | end |
| 21 | end |
| 22 | fn controlr kind ulong to void |
| 23 | put Inlen 0 0 |
| 24 | b = packet kind get Q 1 0 0 0 |
| 25 | copyout |
| 26 | end |
| 27 | fn liner part ulong value ulong to void |
| 28 | put Inlen 0 1 |
| 29 | put In 0 uchar value |
| 30 | b = packet 2 get Q 1 part 0 0 |
| 31 | copyout |
| 32 | end |
| 33 | fn main to int |
| 34 | test qstart 77 100 |
| 35 | test qnext 100 true |
| 36 | test qsent 100 true |
| 37 | test not qnext 2099 true |
| 38 | test qnext 2100 true |
| 39 | test qsent 2100 true |
| 40 | controlr 6 |
| 41 | test eq qincoming 2101 1 |
| 42 | test qready 2101 |
| 43 | note First failed JOB must be immediately retryable; ACK while no send is outstanding then suppresses retries. |
| 44 | put Inlen 0 3 |
| 45 | put In 0 65 |
| 46 | put In 1 66 |
| 47 | put In 2 67 |
| 48 | test qsubmit 2102 |
| 49 | test qnext 2102 true |
| 50 | test eq get T 10 1 |
| 51 | test qsent 2102 false |
| 52 | test eq get T 10 0 |
| 53 | test qnext 2102 true |
| 54 | test qsent 2102 true |
| 55 | controlr 4 |
| 56 | test eq qincoming 2103 1 |
| 57 | test eq get T 6 1 |
| 58 | test not qnext 4101 true |
| 59 | note Send one line, fail its GOT, then accept duplicate and retry GOT until success. |
| 60 | liner 1 65 |
| 61 | test eq qincoming 4102 1 |
| 62 | test qnext 4102 true |
| 63 | test eq get T 10 3 |
| 64 | test qsent 4102 false |
| 65 | test eq get T 13 1 |
| 66 | liner 1 65 |
| 67 | test eq qincoming 4103 2 |
| 68 | test qnext 4103 true |
| 69 | test qsent 4103 true |
| 70 | test eq get T 13 0 |
| 71 | test qtake |
| 72 | test eq get In 0 65 |
| 73 | test not qtake |
| 74 | note Pending GOT is discarded by cancel; cancelled sequence cannot later emit old receipt. |
| 75 | liner 2 66 |
| 76 | test eq qincoming 4104 1 |
| 77 | test qnext 4104 true |
| 78 | test eq get T 10 3 |
| 79 | qcancel |
| 80 | test eq get T 10 0 |
| 81 | test eq get T 13 0 |
| 82 | test not qsent 4104 true |
| 83 | test not qnext 4104 true |
| 84 | test eq get Q 4 0 |
| 85 | note New submission after cancel uses new sequence; stale old ACK is rejected. |
| 86 | put Inlen 0 1 |
| 87 | put In 0 90 |
| 88 | test qsubmit 4105 |
| 89 | test eq get Q 1 2 |
| 90 | put Inlen 0 0 |
| 91 | b = packet 4 1 0 0 0 |
| 92 | copyout |
| 93 | test eq qincoming 4106 0 |
| 94 | test eq get T 6 0 |
| 95 | test qnext 4106 true |
| 96 | test eq get T 10 1 |
| 97 | test qsent 4106 true |
| 98 | controlr 4 |
| 99 | test eq qincoming 4107 1 |
| 100 | note Existing ready state expires at the strict 30000ms edge, then HELLO uses 2s. |
| 101 | test qready 32100 |
| 102 | test qnext 32100 true |
| 103 | test qsent 32100 true |
| 104 | test not qready 32101 |
| 105 | test not qnext 32101 true |
| 106 | test qnext 34100 true |
| 107 | test eq get T 10 5 |
| 108 | test qsent 34106 true |
| 109 | note Once any LINE is accepted, a later backward-clock packet cannot move clock/state. |
| 110 | liner 1 82 |
| 111 | test eq qincoming 34107 1 |
| 112 | old = get T 0 |
| 113 | liner 2 83 |
| 114 | test eq qincoming 34106 0 |
| 115 | test eq get T 0 old |
| 116 | test eq get Q 2 1 |
| 117 | ret int get Fails 0 |
| 118 | end |