Repository navigation
Conversation
Design review, round 1: head
|
|
Ruling on BLOCKER 12, where key transitions from a userland driver go. Userland owns the merge. "Userland first: the kernel takes on only what userland cannot." Once the driver is in userland, the kernel's part in input is a relay that userland can own. So there is no The other BLOCKERs are taken as written. In particular, M1 runs before acceptance as a scout (it is mine to run on both laptops), and the design answers #900's current 7.2 exit. |
8bb4bff to
74aea28
Compare
Design round 2: the answer to round 1's reviewRound 1's review: #899 (comment). The owner's ruling on its BLOCKER 12: #899 (comment). The body at the new head is the design. This comment maps each finding to what changed, preferring the deletion wherever the review offered one. The authority for the protocol is now IBM's latest revision, read whole: the October 1990 Hardware Interface Technical Reference — Common Interfaces (84F9735), whose controller and keyboard sections were revised in September 1991 (C, K). Its keyboard section lost the old K 19 and K 38, so K88 (May 1988, pages 39–40) is cited for the keyboard's data output. For the pointing device, no IBM PS/2 reference I could reach has a section giving the device's commands: the 1987, 1988 and 1990 Hardware Interface Technical References, and the Model 25, 30 and 80 technical references, give either nothing or the BIOS's INT 15h C2. The device's own document is IBM's TrackPoint System Version 4.0 Engineering Specification (TP), which states the PS/2 auxiliary-device protocol the T14's TrackPoint implements. No other implementation is cited. M1 is staged as a scout and runs before acceptance: BLOCKERs
NOTEs
|
Design round 3: what M1 decidedThe orchestrator ran the scout
The scout's worktree, its local branch and |
Design review, round 3: head
|
|
Rulings on round 3 (#899 (comment)).
|
|
Round 4 mapping, answering round 3's review under the rulings. Head unchanged, Round 1's BLOCKER 1, still open in round 3 (the
BLOCKER 1 (the supervisor never restarts ps2server): ruling 2. Restart names it as supervisor change 1, a waiter for every start of a row that serves a port or is
BLOCKER 2 (the aux stage beside a live keyboard): ruling 3. The sequence is now five numbered steps, with
NOTE 1 (the AMD bench's EC translates regardless of bit 6): stated in rule 1 and in the M1 table's Read ID row ( NOTE 2 (which Refused path the T14 takes): stated as unmeasured. The build expects neither, both decide Refused, the fake holds both, ps2server's line names the path taken, and NOTE 3 (the kernel's button OR): ruling 4.
NOTE 4 ( NOTE 5 (deliveries equal answers is false of the T14's M2 is staged for both benches and handed to the orchestrator to run. |
|
M2 run by the orchestrator, and a ruling. The scout Ruling: the keyboard is reset at every start, not only on a restart. It is one path, and it needs no restart variable, so |
|
M2's readings, and what each decided. Published masked on
M1's firmware-byte and set-query rows are marked superseded in the body. Three more things are yours: #877's A2, which has no arm left in ps2server; whether the owner's sign-off is still owed on |
|
Rulings on round 5's open items.
|
Design review, round 5: head
|
|
Rulings on round 5's review (#899 (comment)). BLOCKER 1 and NOTEs 1, 2, 4 and 5 are taken as written. NOTE 3: the System Flag (bit 2) is written as 1, the value M2 ran with ( |
The kernel keeps the `isa` claim on the i8042's ports and lines and speaks none of its protocol. /system/bin/ps2server probes the controller after IBM's PS/2 Hardware Interface Technical Reference (84F9735) and the TrackPoint System Version 4.0 Engineering Specification: the keyboard is reset at every start and armed set 2 translated, every command byte holds the System Flag and the keyboard interface disabled until the arming's 0xAE, a byte is read 7 us after the status read that showed it and written only with both buffers empty, and a device's answers wait on its interrupt. The stream feeds the pointer's framer the device's own idle time, so a slow reader never splits a packet. ps2server hands each key and pointer report to the owner of input over the new `input` port, which only it may receive. The owner (the compositor, or the console on its image) merges every source with toyos-input: a key or a button is held while any source holds it, and a source's end releases what it held and nothing another holds. The kernel's merge goes: its keyboard and mouse streams carry its USB sources' records unmerged, and MouseEvent carries what a device said - its source, its own buttons, scroll, and relative or absolute motion. The supervisor waits on every start of a row that serves a port or is `restart`, and starts a `restart` row again only when it ended other than by exit 0 (toyos-manifest's Program::supervised, with its module test). Deleted: the kernel's i8042 driver and tally, its vector, the keyboard_controller seam, irq_ring's and the census's i8042 source, the i8042-withheld and test-input-merge actuators and the input-merge guest row, the loom tally model, iapc_boot_arch, isa_claim_refused (its premise, a kernel driving the controller, is gone), and issues/t14-hands-over-an-uninitialised-8042.md, whose fallback from firmware's command byte the reset at every start deletes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
…release, not a keyboard claim Step 10's exit named "the keyboard's by stage 7 step 2's kernel test on usbd's claim", and stage 7 step 2 refused a keyboard claim while no source existed and owed a kernel test of a keyboard claim handed to the next claimant. Under the input ruling (#899, applied to usbd on #901) neither driver holds a keyboard claim, so all three presupposed a kernel feed that is gone. Step 10's exit now holds a key usbd held at its death to the owner of input's `toyos-input` release test, as #901's accepted design maps it. Stage 7 step 2 names ps2server's one kernel claim, the `isa` row, and its kernel test is `isa_lines_reach_their_holder`'s dead holder leaving no record to the next, as #899's accepted design maps it. Taken here by the ruling on #904 that widened its fence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
… owner of input, not the screen's Review round 1 on #904. Step 10's exit now fails while `keyboard.rs`, `mouse.rs`, `input_merge_test.rs` or a `Keyboard`/`Mouse` class in `sdk/abi` remains. Step 10 and stage 7 step 2 deliver to the owner of input, as the ruling names it, not the screen's owner. The `toyos-input` test's controls are #901's two, exactly. Stage 7 step 2 states the kernel merge's deletion in #899's words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
74aea28 to
27c052c
Compare
|
Ruling on the |
#894 adds the clipboard port beside the input port: both are held alone, both are served by the compositor, and its poll budget counts both. #904 rewrote step 7.2 of the track; its text is kept, marked done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
…and metalcase holds until the probe ends The first metal run found two reds, neither of them the probe's: - `ps2server_arms`, on both benches: `metalcase` runs no job, so its test-runner rebooted 3 ms after the supervisor started ps2server (T14, inside the keyboard's 516 ms reset) and 1 ms after the keyboard's line (AMD, inside the aux stage's 600 ms). The kernel's probe ran during boot; ps2server's runs after it. `test_rs_ps2server_hold`, on `acpi_hold`'s pattern, ends every `metalcase` boot once ps2server has said it armed or the kernel has recorded its exit; the image serves test-runner `log`. - `isa_lines_reach_their_holder`: a claim's first interrupt is announced once per claim (the release re-arms it), and `dies` read away the stale record its own `0x20` raised under firmware's `0x47`, so the kernel announced it twice. `dies` now reads no record at all, which is also what its name says, and the count of one holds on any firmware byte. The orchestrator's ruling on m06 removes the `0xAD` after the keyboard stage: the aux stage's `0x60` sets bit 4, which disables the keyboard interface as `0xAD` does (C 11, C 12). The dropped-command-byte shape now drops the arming's byte alone, so the aux stage's bit 4 is what the `0x20` runs under, and is what it reads back (`0x56`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
#894's `clipboardcase` landed with a compositor row from before this branch, and the compositor takes the `input` acceptor as it takes `prompt`'s, so it panicked at its start on that boot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
|
Metal at
Readbacks and judge logs are beside each image under |
Build review, round 1: head
|
|
Orchestrator ruling on build review round 1, BLOCKER 2 (this changes the accepted design's Accepted as the review states it. Loss is scoped to the device that lost something:
The owners of input (compositor and console) end only key state on |
tests/toyos.rs: #886's `microcode` row and this branch's `ps2server_arms` were each added after `metal_sim_scanout_wc`; both are kept, each on METALCASE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
LOST was sent for the keyboard's overrun, for every aux byte the framer discarded and at the pointer's write-off, and the compositor ended both the source's keys and its pointer's buttons on it. So a resync of the TrackPoint released a held Ctrl, and a keyboard overrun released a held button mid-drag. Every PS/2 packet states its buttons whole, so a discarded aux byte owes the owner nothing: it is counted and sends nothing. The write-off owes a report with no buttons for source 0, and no key release. LOST is the keyboard's overrun alone, and the owner ends key state on it; pointer state ends on a zero-buttons report or on the connection's end. The orchestrator's ruling on build review round 1, BLOCKER 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
`Probed::Armed`'s `keyboard` was read only by the probe's tests, which now hold the armed line and the command byte instead; `rel_scale_for` was exported only for `toyos-input`'s integration test. It is private, its aspect test moves into `merge.rs`, and the motion test states its expected scale as the numbers 1920x1080 gives. Build review round 1, BLOCKER 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
…the deadline's look is tested The quiet stage wrote 0xAD first, and a wedged output buffer kept that write reading for its whole 250 ms, about 35,000 reads, ending "never took 0xAD" with every byte it read unsaid. It now drains before its first write as after, so a buffer still full after 32 reads is said with what they read, and no write is made into it (C 14). A write the controller never takes says what it drained first. Hw's wait reads the clock before it looks for a record, so a record landing as the deadline passes is still found. That loop is now `Records::first`, and a host test preempts it between every two steps: read the clock after the look and it reds. Build review round 1, NOTEs 4 and 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
…d where host tests reach them Deleting `test-input-merge` cut the only test of `PointerSource`'s allocation, which stays in the shipping kernel: a `unbind` that gave no number back would leak one of 256 on every replug, and nothing went red. The allocation is `kernel::pointers::Sources` in the pure library now, host-tested: two claims take distinct numbers, a number given back is the next claim's, all 256 held refuse a claim, and a number given back twice panics. `mouse.rs` keeps the type and calls it. The mask to boot-mouse order's five buttons moves from `mouse::report` into `toyos-usbhid`'s decode, reading `toyos_input::wire::BUTTONS`, the one declaration the owner's decode refuses past; its test is there. Build review round 1, BLOCKER 3 and NOTE 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
… a test again Deleting `isa_claim_refused` left `claim_row`'s `KernelDriven` arm with no test, and the arm is reachable: a FADT reset register at 0x64 is declared to the kernel (`power::init_reset`), and then the i8042's row must not be handed out. The `isa-port-declared` actuator declares 0x64 to the kernel at boot, and the `isa_claim_refused_on_a_kernel_port` T14 row runs `test_rs_isa_claim_refused` under it: the claim answers PermissionDenied, and the kernel names the port and its holder. Build review round 1, BLOCKER 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy
Built, at
26c867374: the buildfebfd21e8; merges oforigin/mainat6080e839d,1a81b5926andbc8429e71(#886); fix round 1 (6016e657b,a42489c7c); and fix round 2,1ca170b2bto26c867374, which answers build review round 1. This is stage 7.2 ofissues/the-kernel-is-small-interrupts-post-and-threads-wait.md, which is also step 6.3. The i8042 leaves the kernel, and/system/bin/ps2serverdrives it over theisaclaim that #592 built. It hands every key and pointer report to the owner of input, which merges every source.The design below was accepted in the orchestrator's rulings on round 5, and this build applies them:
0x75,0x56,0x57/0x75);0x20written with it clear;issues/t14-hands-over-an-uninitialised-8042.mdis closed.It also applies the ruling on m06, so the
0xADafter the keyboard stage is gone. And it applies the ruling on BLOCKER 2: a loss is scoped to the device that lost something.Lines:
git diff --shortstat origin/main...26c867374: 94 files, +3,589 −2,555.kernel/srcis 64,375 lines at the basebc8429e71and 62,633 here, which is −1,742.git diff --numstat 6248cd756 26c867374) is 20 files, +382 −121:kernel/pure/pointers.rs+85, 41 of them its tests. About 20 of the rest moved out ofmouse.rs, which goes −26 +7.bus.rs+70, 43 of them its test. ItsRecords::firstishw.rs's wait loop moved, andhw.rsis ±23.isa_claim_refused's binary, row, judge and actuator, +63.Fix round 2: build review round 1, answered
NOTE 1, the merge.
origin/mainatbc8429e71is merged at6248cd756. #886'smicrocoderow and this branch'sps2server_armswere each added aftermetal_sim_scanout_wcintests/toyos.rs, and both are kept, each onMETALCASE. Every gate below is at the merged head.BLOCKER 1, metal at
a42489c7c: published, cited and judged. The orchestrator ran the four requests ata42489c7c(comment). Every reading is masked with the orchestrator's mask, and a grep for the machine fields counts 0. They are atmetal-a42489c7c/.boot.txtis left out: its BIOS line keeps a version the mask does not cover.ps2server_arms isa_ports_are_the_binders_alone isa_lines_reach_their_holder mask_windowsps2server_armsmask_windowsisa_lines_reach_their_holderaux reset, 0xaa 367475 us after its 0xfa, thenarmed, command byte 0x57 — keyboard on, aux on.aux absent — its reset went unanswered in 600 ms, thenarmed, command byte 0x75 — keyboard on, aux off.afteras the exit wants, and the track's 7.2 close rests on that red.The three other rows
metalcasecarries, judged with--metal-readbackover thosemetalcasereadbacks. This touches no machine, and the judge code is this head's.metal_sim_scanout_wc blackbox_done_chain machine_rebootusb_reset_hands_devices_backalso needs the device boot, so it is in this head's request below, along with every row this round changes.BLOCKER 2, a loss on one device released the other's state: fixed as the ruling states.
LOSTonly for the keyboard's overrun (0x00).Pointerrecord for source 0 with no buttons, and no key release.MSG_LOST's contract (wire.rs) is now "every key this source holds is released; its pointers keep their buttons".LOST. The console already did, since it holds noPointer.three_failed_reenables_write_the_pointer_off_with_0xa7now wants the zero-buttons report.a_discarded_aux_byte_sends_nothing. Shift is held, then an aux byte with bit 3 clear arrives. The records are Shift's make alone, and the framer counted one discard.BLOCKER 3,
PointerSource's allocation had no test: the allocation moves tokernel::pointers::Sourcesin the kernel's pure library, where host tests reach it.mouse.rskeepsPointerSourceand calls it.unbind'sfetch_andis nowgive_back's. m18 replaces it with a load, and three of the tests go red.IN_USE.give_backcall fromunbindis a deletion a reader sees.BLOCKER 4, the
KernelDrivenrefusal had no test. The arm is reachable: a FADTRESET_REGat port0x64is declared to the kernel bypower::init_reset. So the claim on the i8042's row must be refused.isa-port-declared(a boot parameter of the test kernel) declares0x64to the kernel at boot, after the row is filled.isa_claim_refused_on_a_kernel_portrunstest_rs_isa_claim_refusedunder it. The claim must answerPermissionDenied, and the kernel must sayisa: the i8042's ports 0x64+1 are the isa-port-declared actuator's.return Err(KernelDriven)is removed, and the log line stays, so only the job can red. It is staged for the T14 below.claim_rowagainst the kernel's own table of declared ports, so a host test cannot reach it. A metal row sits before QEMU in rootCLAUDE.md's order, and the twoisarows beside it are metal rows too.RUST_SKIP, so the shared block does not run it on a boot where the claim is granted. The actuator is inFLASHABLE, with what it touches.BLOCKER 5, two things shipped for tests alone: both are gone.
Probed::Armedloseskeyboard. The probe's tests now hold the armed line and the command byte: the T14's0x57 — keyboard on, aux on, and the0xFCshape's0x56 — keyboard off, aux on.rel_scale_foris private, andlib.rsno longer exports it. Its aspect test moves intomerge.rs. The motion test states the 1920x1080 scales as numbers, 36 across and 64 down.NOTE 2, the whole change reverted on metal:
tests/images/metalcase.tomlnames aps2serverthe reverted tree does not build, and staging stops at the build. The stage log is for QEMU. On metal it fails with "no programps2server".ps2server_armsmust go red with nops2server: kbd resetline.bc8429e71redsconsole_image_bootswith exit 1 and "STALLED: waiting for ps2server to arm the i8042" (log).NOTE 3, the five-button mask: it moves out of
mouse::reportand intotoyos-usbhid'sPointer::decode. It readstoyos_input::wire::BUTTONS, the one declaration the owner's decode also refuses past.a_button_past_the_fifth_is_dropped.NOTE 4, rule 5 had no test:
Hw's wait is nowbus::Records::first, andHwsupplies the clock, the record and the park.a_record_landing_as_the_deadline_passes_is_foundpreempts the waiter between every two of its steps. The record lands as the deadline passes.NOTE 5, a wedged controller in the quiet stage: the stage drains before its first write as well as after it.
a_wedged_output_buffer_is_said_after_32_reads_with_nothing_written.0xADreads for 250 ms.NOTE 6, the duplicated accept loop: left, by my call.
RxStepto aRecordor an end reason, about 15 lines.Pollerand routes pointers to aPointer. The console reads readiness by token and holds noPointer.toyos::ipcandtoyos-inputtogether.toyos-inputis linked into the kernel throughtoyos-usbhid, so it cannot depend ontoyos, and a third crate for 15 lines adds more than it deletes. Design: one userland input owner for the ARM desktop #868's inputserver makes the owner one program, and the second copy goes with it.NOTE 7, the
usbkbdlines: #901's body does not own them; it names no Linux line inkernel/usbhid. But no new issue is needed.issues/the-tree-names-linux-as-an-authority.md(assigned, the orchestrator's sweep) owns them by its exit,git grep -n -i linux -- kernel …prints nothing, and that coverskernel/usbhid/src/keyboard.rs:21and:27. It also coverskernel/usbhid/src/pointer.rs:17(usbmouse), which NOTE 3 now makes a file this diff edits. Neither line is edited here.NOTE 8, prose: the "staged, 2" and "the orchestrator's to run" rows are replaced by the readings above.
Gates, each its command's own exit
cargo run -- --ci host26c867374cargo run -- --build-only26c867374cargo test, the whole guest suite26c867374metalcaserows over thea42489c7creadbacks,--metal-readback26c867374's judges--metal-readback26c867374The request at
26c867374(the orchestrator's to run):metal-head:isa,isa-port-declared,metalcase,metaldevicecaseps2server_arms microcode metal_sim_scanout_wc blackbox_done_chain machine_reboot usb_reset_hands_devices_back isa_ports_are_the_binders_alone isa_lines_reach_their_holder isa_claim_refused_on_a_kernel_portmetal-head-amd:metalcaseps2server_arms microcode metal_sim_scanout_wc blackbox_done_chain machine_rebootmetal-c05-whole-change-reverted-metalcase:metalcaseps2server_armsmetal-c04-claim-ignores-kernel-ports:isa-port-declaredisa_claim_refused_on_a_kernel_portmask_windowsis not re-run. Nothing sincea42489c7ctouches an interrupts-off section. The kernel changes are the pure allocatormouse.rscalls, the mask's move intotoyos-usbhid, and an actuator that is off unless armed. Its base-against-branch reading ata42489c7cstands.microcodeis The kernel loads Intel's CPU microcode early on every CPU, and an AMD CPU says ToyOS has no loader for it #886's row. It ridesmetalcase, which this branch changed, so it is judged on this head's boot.The smoke test's own lines come from the guest suite, under QEMU's i8042, whose keyboard answers the reset as K 11 and 13 say:
ps2server: kbd reset, …, thenps2server: armed, command byte 0x57 — keyboard on, aux on, whichconsole_image_bootsawaits whole.Negative controls and mutations
Each control is applied as a checked patch, run, its exit kept, and reversed with the tree left clean. Each log carries its diff.
build-a42489c7c/mutations/.26c867374with fix round 1's patches (run-r1.sh); m03 is rebased onto the quiet stage's first drain.bc8429e71, the tests keptcargo test -- console_image_boots, at26c867374tests/images/metalcase.tomlat the base toops2server_armson the T14claim_rownames the kernel's port and grants the claimisa_claim_refused_on_a_kernel_porton the T14isa_lines_reach_their_holderon the T14a42489c7c27c052cea)ps2server_armson both benchesLOSTa_discarded_aux_byte_sends_nothingLOSTthree_failed_reenables_write_the_pointer_off_with_0xa7give_backfrees nothinga_number_given_back_is_the_next_claims,every_number_held_refuses_a_claim_until_one_is_given_back,a_number_given_back_twice_panicstoyos-usbhida_button_past_the_fifth_is_dropped,every_report_is_read_or_refused_and_nothing_elsea_record_landing_as_the_deadline_passes_is_founda_wedged_output_buffer_is_said_after_32_reads_with_nothing_written0x20, C 11's interrupt, bit 4 in the aux stage, the System Flag, the keyboard reset, the0xAAbound, the supervisor's waiter, the source's release, the buttons' OR, the framer's gaps, the re-enable's found byte26c867374(summary; each log beside its patch)Oracles:
ps2server_arms, which passed on both ata42489c7c.Where the build answers what the design left open, or differs from it
t_end, byConnection::send_bytes. The SDK has no single write of several frames, and the owner buffers each frame whole either way.Mergeand noPointer, because it draws no pointer.service = true, because the manifest refuses a row that serves a port without it (ServesWithoutService).HOMEis/state/console, and the shell it starts runs on its own row.input, includingtests/images/panelcase.toml's andtests/images/clipboardcase.toml's, since the compositor takes the acceptor as it takesprompt's.toyos-usbhid's decode, so every record the kernel's stream carries decodes (fix round 2 moved it frommouse::report).LOSTis the keyboard's overrun alone, and releases keys alone (the ruling on BLOCKER 2). The pointer's write-off sends a zero-buttons report, and a discarded aux byte sends nothing. A failed re-enable is retried at once, three times in all, then0xA7.i8042:lines described stages that are gone.toyos::endow::isajoinspci_functionandpartition, the one lookup of anisa:claim by its spelling.process_waitrefuses its own process handle. It used to ignore the answer; now the exit code decides.acpi_mediated_accessasks for the test kernel bykernel_features: ACTUATOR_KERNEL, for its Global Lock actuator.i8042-withheldwas what selected that kernel.isa_claim_refusedcomes back as the T14 rowisa_claim_refused_on_a_kernel_port, under theisa-port-declaredactuator (fix round 2). Its first premise, a kernel driving the i8042, is gone. The refusal it tests is still reached by a FADT reset register at0x64.iapc_boot_arch's short-FADT test is kept as the century test it also was, nameda_fadt_that_ends_at_the_century_byte_reads_it.0x20,0x60,0xA7,0xA8,0xAD,0xAE,0xD4).0xAA,0xABand any other command C does not list panic as reserved.metalcaseboot ends ontest_rs_ps2server_hold(fix round 1), and its image serves test-runnerlog.PointerSource's allocation iskernel::pointers::Sourcesin the kernel's pure library (fix round 2), host-tested.mouse.rskeeps the type.Hw's wait isbus::Records::first(fix round 2), so rule 5's order is host-tested.What I am unsure of
0x60. It now takes the arming's0x20with its keyboard interface enabled, since no0xADstands behind bit 4.inputport's name. Design: one userland input owner for the ARM desktop #868's draft names its compositor-facing protocolinputtoo; whichever lands second renames.the-i8042-tallys-release-acquire-pair-has-no-negative-control.mdandscreen-diag-boot-leaves-no-i8042-line-on-the-panel.md. Neither is edited, and closing them is the orchestrator's call.LOSTarm has no test. Its binary has no host build, and the change is one deleted line.The design, as accepted
M1 has run, and decided what round 2 left to it. The scout kernel of
b3637916areplaced the i8042 probe with the exchanges ps2server was then designed to make, and logged each answer, on both benches; both judges exited 0. Its readings are everyscout-ps2:line of each boot, masked: the T14's and the AMD bench's. M1 below maps each reading to what it decided, and which of its decisions the reset at every start superseded.M2 has run, and both benches' keyboards answer IBM's Reset from firmware's state and from a scanning set-2 keyboard. The orchestrator ran the scout
2b3433af7(rowscout_ps2_reset) once on each bench; both judges exited 0. The masked kernel logs and judges: the T14's (judge) and the AMD bench's (judge). On the reading, the orchestrator ruled that the keyboard is reset at every start, one path, soTOYOS_RESTARTEDgoes; this round applies it. M2 below maps each reading to what it decided. One of them is the orchestrator's to accept: the T14's0xAAcomes 516 ms after the ack, 16 ms past IBM's 500 ms, and the design accepts it inside the keyboard stage's 750 ms ceiling.What this was read from:
mainat858da4d42; the track at #900's text; #868; #877's design; #901's design and its ruling;kernel/src/arch/x86_64/i8042/,kernel/src/isa.rs,keyboard.rs,mouse.rs,device.rs,input_merge_test.rs,drivers/xhci/hid.rs,kernel/usbhid/, the compositor's and the console's input paths, the supervisor's start, waiter and restart paths,lib/manifest,kernel/ps2/; and IBM's references, read whole for the controller, the keyboard and the pointing device:0xA9and drops nothing else, and its keyboard section loses the old K 19 buffer size and K 38 data-output text.The rulings this design follows:
TOYOS_RESTARTEDgoes. It extends round 3's ruling 1.restartrow, with a module test; (3)0xADaround the aux stage and the arming, replaced on that point by the ruling on m06 (6139222704): the aux stage's0x60sets bit 4, so the0xADafter the keyboard stage goes, one mechanism, not two; (4) the NOTEs as written, and for NOTE 3 the source travels in the record and the owner ORs the buttons, so the kernel keeps no merge.The split
The kernel keeps only the claim and the post, both unchanged since #592:
pio::fill_i8042_row(ports0x60and0x64, ISA lines 1 and 12),crate::isa, andisa::isr, which records the interrupt on the claim and posts its watch. Nothing in the kernel speaks the 8042's protocol afterwards. The panic path is unchanged: it reads no port of the i8042 and takes no input.ps2server never calls
isa::ack, and the claim does not change. M1 read IRQ 1 and IRQ 12 as edge, active high, on both benches (GSI 1 and GSI 12), so round 2's change to answerOkon a row with no level line is deleted with the level arm it served. On a machine whose MADT makes either line level, the claim keeps that line masked until a first ack that never comes (isa.rs:26-29): no record arrives, every probe stage runs out its ceiling, and the keyboard is disabled and the pointer found absent by name, with the stage's line saying whether OBF was set when it gave up./system/bin/ps2servertakes everything else: the probe, both decoders, the aux self-reset's re-enable, the naming of undecoded bytes and the counters. It isexempt.owns: its job exists only on ToyOS. Two packages, as soundserver and netstack are:system/ps2server/ps2iskernel/ps2moved bygit mv, package nametoyos-ps2kept, its decoders and both test files unchanged. Device bytes are input from outside the program's trust, so the decoders stay a crate of their own.system/ps2serveris the program: the claim, the ports throughtoyos::ioport, the probe and the stream as state machines over aControllertrait (status, data, command, write, clock), host-tested against a scripted fake, and the connection to the owner of input.Where key transitions go: the owner of input, over IPC
The owner is the program that owns the screen, until #868 lands. #868 is an open design with no code, so ps2server delivers to the compositor in
images/system.tomlandtests/images/metalcase.toml, and to/system/bin/consoleinimages/console.toml, the shell on the panel, whose machine is the T14. When #868's inputserver lands it takes the acceptor and ps2server's row does not change.The port. The owner serves
input, and ps2server's row receives it. Each connection is one source; usbd joins as more connections under #901. The owner is the server, so it never blocks on a source:ipc::FrameRx, buffered whole;The build refuses
inputto every row but ps2server's, as it refusesprompt(build/build.rs): a connector is the authority to type into the focused window.The records are the kernel's own, so one decode serves every source:
toyos_abi::input::RawKeyEvent: a HID Keyboard-page usage, and inmodifiersnothing butMOD_RELEASED. Usage 0 and any other modifier bit are refused.toyos_abi::input::MouseEvent, which gains what a device said:source, the pointer it came from;buttons, that pointer's own;scroll;kind(relative or absolute); andx,yasi16, the delta or the position in0..=32767. An unknown kind, a button outside boot-mouse order's five bits or an absolute position outside the range is refused. Scroll and absolute motion are in the record because the xHCI path delivers both today and usbd will (round 1's NOTE 6). ps2server's one pointer is source 0.LOST, a frame with no payload. As accepted it released everything the source held, and ps2server sent it on a keyboard overrun code or a byte it had to drop. The ruling on build review round 1's BLOCKER 2 narrows it: it is sent on the keyboard's overrun alone and releases keys alone. A pointer's state ends on a zero-buttons report or the connection's end.The merge moves to userland whole.
lib/input(toyos-input) holds it, because two programs share it and it decodes a peer's words. It is#![no_std],#![forbid(unsafe_code)]and depends ontoyos-abialone, never ontoyos, sotoyos-usbhid, a kernel dependency, links it (round 3's NOTE 4); the kernel links only what it calls,Keys.Keys, one keyboard's held usages, and the modifiers-first transitions between two sets of them, moved out oftoyos-usbhid'skeyboard.rs(Usages,hold,Transitions,Pass).toyos-usbhid'sKeyboardkeeps the report decode and holds aKeys. This is the one held-set type in the tree (round 1's BLOCKER 10).Merge, the owner's: aKeysper source; a transition is delivered when it changes the union of every source's set, and every delivered key carries the union's modifiers. A source that ends isKeys::hold(empty), delivered usage by usage where the union changes, so a key another source still holds stays held.Pointer, the owner's: each pointer's buttons, keyed by its connection and its record'ssource, ORed into what it delivers, so one pointer's zero-buttons report never clears a button another holds; a connection's end clears every pointer it carried. One position, which relative motion moves and absolute motion sets, relative motion scaled byrel_scale_for(moved from the kernel with its test).The kernel keeps no merge (round 3's NOTE 3, ruling 4), since a userland merge over a kernel merge would be two merges:
keyboard.rslosesHELD,modifiers_of,modifiers()andrelease_all, and queues each transition as it comes. It is one source to the owner, which dedupes it with that source'sKeysexactly asHELDdid: two USB keyboards holding one usage are one hold, and either one's release ends it.mouse.rslosesBUTTONS,merged_buttons,LAST_X,LAST_Y, both scales,set_screen,rel_scale_forandPointerSource::PS2, and queues each report as the device gave it, with itsPointerSourceas the record'ssource.release_buttons(source)queues that source's zero-buttons record.PointerSource's allocation (IN_USE,claim,unbind) stays: it names a USB pointer, and merges nothing.A keyboard or mouse claim stops being evidence (round 1's BLOCKER 8, the deletion it offers).
SOURCE_EXISTS,declare_sourceandsource_existsgo from both modules, withtry_claim's two checks and xHCI's two declares (drivers/xhci/wait/boot.rs:154-155). A claim is granted on every machine. On AArch64, where nothing feeds either stream, the compositor no longer exits at its claim: it runs with no input source until #868 gives that machine one. That is the state #868 itself starts from ("the compositor exits because no input source can supply its keyboard and mouse handles").No endowment order is needed (round 1's BLOCKER 9): ports exist before any program runs (
sdk/toyos/src/port.rs), so ps2server's first frame waits in its connection until the owner accepts it, and no claim depends on another being minted first.Restart
isa.rs:125-138), and the ports go back with the process. The owner sees the connection end and releases its keys and buttons. No kernel code knows ps2server.close_when_it_ends, the only waiter, is spawned only for a start that kept acceptors (system/supervisor/src/main.rs:726), so arestartrow that serves no port, as ps2server's does not, is never seen to end and never restarted. Supervisor change 1: a waiter is spawned for every start of a row that serves a port or isrestart. It reaches ps2server alone: diskserver and fileserver, the onlyrestartrows in any image, serve ports and are waited on today, and a row that is neither still has no waiter.restartrow is started again only when its process ended other than by exit 0; one that exits 0 is not, and its ports, if any, close as a non-restartrow's do. ps2server exits 0 only when it has nothing to serve: noisaclaim (AArch64), port0x64reading0xFF(no controller), or the owner's port answeringGone. diskserver and fileserver never exit 0.TOYOS_RESTARTEDis deleted by the M2 ruling. Every start of ps2server is the same start, so it needs no fact about its predecessor.toyos-manifest, besideRESTARTSandProgram::restart, which the supervisor calls at the spawn and in the waiter: whether a start is waited on, and whether an end is owed a new start. Its module test is intoyos-manifest, because the supervisor's binary builds againststd::os::toyosand has no host build: arestartrow with no port is waited on; a row that is neither is not; an end other than exit 0 of arestartrow is owed a start; exit 0 is not; a non-restartrow is never owed one. Its control: change 1 reverted (the waiter for ported starts only) reds the first./tmp/ps2server/firmwarefile and its isolation hole are deleted, and so is any reading of what firmware or a predecessor left: The probe is one sequence, the same on a boot's first start and on a restart.The probe, following IBM
0xFF, answered0xFAand then the completion code0xAA"between 300 and 500 milliseconds after a Reset command is acknowledged" (K 11), after which "the keyboard defaults to scan-code set 2" (K 13) and "keyboard scanning begins" (K 11). So every start arms set 2 translated, the mode C 10 gives for PC compatibility, whatever firmware or a predecessor left, a set-1 keyboard from POST (K 1) included.0xAAis accepted whenever it comes inside the keyboard stage's 750 ms ceiling, and IBM's window is enforced at neither end: M2 read the T14's 516 ms after the ack, 16 ms past K 11's 500, and the AMD bench's 2.2 ms and 1.3 ms, far inside its 300. Both decide the same, set 2 translated, and K 11's window decides nothing ps2server does. The 750 ms ceiling leaves the T14 234 ms.0xFC, any other byte for0xFAor0xAA, or no0xAAinside the ceiling disables the keyboard by name, with the byte or the silence in its line.0xAAarrives through the translation the stream will run under; M2 read0xAAthat way on both benches, with the command byte0x65before and after each reset.0xAB 0x41: K 13, Figure 2, givesAB 83, and C 5, Figure 1, translates83to41). The reset sets bit 6, so the stream runs as the EC does regardless; the fake's AMD shape translates regardless of bit 6.0xF0 0x00(K 14) and its three arms (Told0x02, Refused, Unanswered), the inference from firmware's translate bit, round 2's0x01arm,0xF5, and the keyboard's0xF4, since the reset leaves it scanning (K 11). With them goes round 3's NOTE 2, which arm the T14's refusal takes.0xAA), it is drained, with the rest, by name: the reset reinitializes the keyboard (K 13), and nothing typed then is delivered;AUXBclear (C 7) is a keystroke and is fed to the keyboard's decoder, never dropped (round 1's BLOCKER 4); one withAUXBset is the aux device's and goes to its stage or decoder. That holds through the aux stage, the arming and the steady state.0xEEincluded, and each exchange's deliveries equal its answers but for the T14's0xF0, whose second delivery is the0xEEthe next exchange found waiting (round 3's NOTE 5). The delivery can trail OBF by a few microseconds (the AMD bench's0xF0ack: OBF 101 µs after the write, delivery 103 µs); ps2server reads status only after the record, so the lag never reaches it. M2 read the same of the reset: both its answer bytes raised the line on both benches, the0xAAhalf a second after the0xFAon the T14 included, one delivery each. The one controller command that draws a controller answer, the arming's0x20, is written while the keyboard interface is disabled, under the bit 4 that the aux stage's and the arming's0x60each write (the ruling on m06), so the answer it draws, withAUXBclear, is the controller's and no keystroke's (round 3's BLOCKER 2b; round 5's NOTE 1): bit 4 is "Disable Keyboard" (C 11), what0xADsets, which "disables the keyboard interface by driving the 'clock' line low. Data is not received while the interface is disabled" (C 12).0xAD,0xAE,0x60,0xA7,0xA8and0xD4draw no controller answer.0xADsets it and0xAEclears it (C 12), and a0x60writes it with the rest of the byte. So every0x60the probe writes states bit 4, and one written with it clear would re-enable the keyboard as0xAEdoes (round 5's BLOCKER 1).0x60(round 5's NOTE 3, as ruled): C 11 places "the value written to this bit … in the system flag bit of the Controller Status register" and gives 0 after a power-on reset; 1 is the value M2 ran with (0x65) and firmware left on both benches (0x77). The arming's0x20read-back holds it.0xAAinside the keyboard stage's 750 ms. The slowest answers read are the T14 keyboard's0xAA, 516 ms after its0xFA(M2), inside the keyboard stage's 750 ms, and the T14 TrackPoint's0xAA, 367 ms after its reset's0xFA(M1), inside TP's 500 ms and the aux stage's 600 ms.The sequence, every command cited (round 1's BLOCKER 6, round 3's BLOCKER 2, the ruling on m06):
0xAD,0xA7(disable the keyboard and aux interfaces, C 12); drain up to 32 bytes. Firmware's command byte is not read: nothing is decided from it, and the arming writes the byte whole.0x60(C 11) with the keyboard's interrupt bit alone, the System Flag, the keyboard interface still disabled (bit 4 = 1), the aux clock off and translation on:0x75;0xAE(C 12), which clears bit 4;0xFF(K 13), its0xFAand0xAA. The keyboard now scans.0x60with the aux interrupt bit alone, the System Flag, the keyboard interface disabled again (bit 4 = 1), the aux clock on and translation on:0x56;0xA8(C 12);0xD4(C 13) before each of0xFF, answered0xFA 0xAA 0x00within the 500 ms diagnostics (TP 9, 12), and0xF4(TP 13). From that0x60on, the keyboard holds what it would send: "if the 'clock' line is inactive (low), data is stored in the keyboard buffer" (K88 39; C 15, step 5). So up to the arming's0xAEno keystroke can load the output buffer, hold OBF against the aux answer, or be read as the command byte (round 3's BLOCKER 2a–c). Dropped:0xF2, since the id is the byte after0xAA;0xF3 0x64, since 100 reports per second is the reset's default (TP 9); and0xE8 0x03, which "has no effect for the TrackPoint controller" (TP 17).0x60with the keyboard's interrupt bit, the System Flag, the keyboard interface still disabled (bit 4 = 1) and translation on, and the aux interrupt bit and clock on only if the aux stage armed the device:0x57with it armed,0x75with it absent;0x20reads it back, written with OBF clear and answered by the controller alone, since the keyboard's interface is disabled and an aux byte carriesAUXB. Then0xAE, last: the keyboard sends what it held, and the stream begins.0xAAand0xAB, which IBM's list does not have ("commands not listed are reserved", C 9), and0xA9, which it has (C 12) but which no decision needs: an aux device that is absent or broken is found by its reset going unanswered. With them goes today's inference that0xA8clearing bit 5 means a second port exists.0xA7alone, which stops the aux interface's clock (C 12), so IRQ 12 never rises again.0x60disables the interface is completed by the keyboard (K88 39) and "not received" by the controller (C 12). If both hold, that one byte is lost, once per probe; no bench has shown it, and it is in the roast.The stream
One wake drains the output buffer:
AUXBnames.t_end.t_end).Both lines are edge on every measured machine, and the controller raises its line whenever it loads a byte (C 11; M1, one delivery per answer byte), so a byte that loads after step 2's last status read raises its own wake, and a byte is never left in the buffer with no wake behind it. A byte that loads during step 2 is read there, and its wake finds OBF clear and reads nothing.
A wedged controller (round 1's BLOCKER 3) is OBF still set after 32 reads in one wake. That is no state IBM's protocol produces, since the output buffer empties when it is read (C 7), so ps2server says so with the last bytes it read and exits non-zero (built without the disabling write the design had: C 14 forbids a write with OBF full); the supervisor, now waiting on its row, starts it again, and its restart limit (
RESTARTSends inRESTART_WINDOW_SECS) gives up on it by name. The kernel'sQUARANTINEgoes.The mouse framer's clock (round 1's BLOCKERs 2b and 5). IBM never says the controller holds a device off while its output buffer is full: the system "can" hold the clock (C 15, step 5), "can inhibit the keyboard until the system processes the input" (K88 40), "may inhibit the TrackPoint controller until it processes the data" (TP 50). M1 read both behaviours, and no lost byte, each with the first answer byte of a Read ID or Read Device Type left unread for 50 ms:
The framer covers both:
first_nanos − t_endof the previous wake, saturating at 0. Every later byte of the same wake is fed with a gap of 0.first_nanosis when the wake's first interrupt landed (DeviceIrqRecord). A queued byte is read in the wake that read the one before it, at a gap of 0. A held-off device's next byte loads one byte's time after the read that released it, and that read is beforet_end, so its gap is at most that byte's time: M1's 1,000 µs, underPACKET_GAP_NS's 5 ms.PACKET_GAP_NShappens only when the device itself went quiet: at 100 reports per second (TP 14) a packet's three bytes take at most 3.3 ms at C 16's 30–50 µs clock phases, and the line then idles about 6.7 ms.feed'snow_ns. Everytoyos-ps2test moves unchanged.The aux self-reset (
0xAA 0x00mid-stream) re-enables reporting with0xD4 0xF4once OBF and IBF are clear, and the device's0xFAarrives in the stream as an aux byte the stream is waiting for, with a 25 ms ceiling (TP 46). Keyboard bytes meanwhile go to the keyboard's decoder. No interface is disabled, and nothing runs with interrupts off. The kernel's 30 ms interrupts-off re-enable (mod.rs:931) goes.Diagnostics kept: the probe's lines, now the new stages' own; undecoded runs named whole (
Partial::blame); the counters line, at most every 10 s and only when an interrupt arrived since the last. Not carried: theHEALTHverdict machine, the arming-edge bookkeeping,to_screenand the idle loop'sverdict_due.M1: what the benches read, and what each reading decided
The scout kernel of
b3637916a(scout-ps2) ran in place of the i8042 probe, once on each bench, staged bycargo test --test toyos-build -- --metal --metal-readback <dir> scout_ps2; both judges exited 0. Every exchange read each byte 7 µs after the status read that showed it and wrote only with IBF and OBF clear (C 14), with only that port's interrupt bit set. The readings: T14, AMD bench.0xAD 0xA70x770x77isa::ack,t_endin place oft_ack0xF0's, whose second is the0xEE's0xF0, then0x000xFA, then0xEEwaiting before the argument's write;0x00drew no byte in 100 ms0xFA,0xFA, then no byte in 120 ms0xFF0xFAat 2.5 ms,0xAA367 ms later,0x000xFA 0xAB 0x84, later bytes 30 and 40 µs after each read; TrackPoint0xFA 0x00, 1,000 µs0xFA 0xAB 0x41with bit 6 written and read back clear, 178 µs and 2,005 µsfirst_nanos − t_endcovers both (The stream). The AMD bench's EC translates regardless of bit 6 (83→41, C 5)M1's scout branch is deleted.
M2: whether each bench's keyboard answers a reset in time
The scout
wt/toyos-ps2server-m2at2b3433af7,mainat858da4d42and one commit, never landed: its kernel featurescout-ps2-resetreplaced the i8042 probe with two keyboard resets and logged each answer byte with its time from the read before it and the vector's deliveries at its read. It wrote the command byte with the keyboard's interrupt bit alone and the aux clock off, and left the translate bit as firmware left it (set on both benches, so0x65), the state the keyboard stage writes. The first reset was made from firmware's state, the second from the state the first left, a scanning set-2 keyboard behind translation, which is what a restarted ps2server finds. After each it logged every byte for 1 s and read the command byte back. The orchestrator ran its rowscout_ps2_reset, one boot per bench; both judges exited 0. The readings, masked: T14, AMD bench.0x77; GSI 1, edge, high0xFA, then0xAA0xFA80 µs after the write;0xAA516,362 µs after the0xFA's log line0xFA581 µs after the write;0xAA2,170 µs after0xFA, then0xAA0xFA79 µs;0xAA516,406 µs after0xFA226 µs;0xAA1,320 µs afterTOYOS_RESTARTEDgoes0xAAtime is from the scout's clock reading after the0xFA's log line, not after its read (last = now()followslog!inscout.rs, round 5's NOTE 5); the reset's summary line, write to last read, bounds the difference under 1 ms0xAAagainst K 11's 300–500 ms0xAAis accepted whenever it comes inside the keyboard stage's 750 ms ceiling, and IBM's window is enforced at neither end. The orchestrator's to accept: this is the row the staged table put to the orchestrator, "0xAAlater than 500 ms"0xAAis waited on, not polled0xAA: the stage waits for nothing more0x65, unchanged0x65, unchanged0xFCor another byteThe fake's T14 and AMD shapes are these readings.
#877
#877's A2 and A3 are designs, not built, and both edit files this change moves or deletes. A3's three
SET1_E0entries land in the movedkey.rs, which still decodes set 2 behind translation; whichever lands second carries the other's lines. A2 has no arm left in ps2server: it decides the AMD bench's unanswered set query from the translate bit, and ps2server makes no query. If A2 lands first, this change deletes its lines with the kernel's i8042 driver; if this change lands first, A2 has nothing to edit and is superseded. Round 5 ruled it: superseded if this lands first.The track's step 7.2, and its exit
The track's step 7.2 says ps2server feeds "the kernel's keyboard and mouse streams so the merge with USB HID stays where it is". The owner's ruling on #899 replaces that, so the build rewrites the step, the issue it takes up, to say: ps2server delivers over IPC to the owner of input; the kernel's merge is deleted, and its streams carry its own sources' records unmerged until usbd takes the last of them, which deletes them. The exit, mapped (round 1's BLOCKER 11):
arch/x86_64/i8042/,idt/i8042.rsand bothkeyboard_controllers gone fromkernel/src, andtoyos-ps2gone fromkernel/Cargo.tomlkernel/Cargo.toml'stoyos-ps2line. The build runsgit grep -n -i -e i8042 -e keyboard_controller -e toyos_ps2 -- kerneland names what is left (round 5's NOTE 4):pio::fill_i8042_rowandisa's docs, the row the claim is minted from, which name the function's ports and lines and speak no protocol;acpi_mode.rs:222's doc, which orders the SCI's row after the i8042's row; andkernel/cpuvuln/fixtures/tcg/console.txt:306-311, a captured guest console that is data, not kernel code.arch/x86_64/mod.rs:8-10's header, whosekeyboard_controllerexample and i8042 entry go stale, is edited in the buildisarow, so the test isisa_lines_reach_their_holder, the T14 row, with one new role:diesholds the claim, has the keyboard acknowledge so a record is pending, and ends without reading it;afterthen claims the row and must find no record. Its control: the row's release withIRQ[row].clear()removed (isa.rs:131) keeps the dead holder's record, andaftergoes red. The step's text is rewritten to name theisaclaima_lost_scancode_byte_never_wedges_the_prefix_stateanda_stream_truncated_at_any_offset_resyncs_within_two_packetstoyos-ps2unchanged, since the decoder's API does not change; the restart that reaches them is the supervisor's change 1, held by its module testThe superseded "typing resumes after ps2server is killed and restarted" and round 1's hand check are gone.
What is deleted
Whole files, at
858da4d42:kernel/src/arch/x86_64/i8042/mod.rskernel/src/arch/x86_64/i8042/tally.rskernel/src/arch/x86_64/idt/i8042.rskernel/src/arch/aarch64/keyboard_controller.rskernel/src/input_merge_test.rskernel/loom/tests/i8042_tally.rsissues/t14-hands-over-an-uninitialised-8042.md, closed (round 5's NOTE 2, as ruled): its subject, the fallback from firmware's byte, is deleted by the reset at every start, which reads no byte firmware leftHunks, each an estimate until the build counts it:
keyboard.rs(about 45),mouse.rs(about 75),device.rs's two source checks andset_screencall (about 12), xHCI's two declares; thetest-input-mergeactuator inactuator.rs, its call inmain.rs, and its guest test and list entries intests/toyos.rsandtests/metal/src/lib.rs. Why that guest test goes: it held the kernel's merge, and there is none left; the merge it checked, a shifted key across sources, a repeated make, a released source's buttons, istoyos-input's, held by its host tests below, the cheaper tier.0x24vector,I8042_VECTORandmod i8042inidt/mod.rs;i8042and thekeyboard_controllerseam in botharchmodules andaarch64/boot.rs;verdict_dueandserviceinsched/driver.rs;irq_ring'sI8042;irq_census'si8042source with its parsers intests/common/irqcensus.rsandtests/checks.rs; thei8042-withheldactuator with its uses intests/toyos.rs,tests/metal/src/lib.rs,tests/common/power.rsandtests/common/isa.rs;kernel/loom/src/lib.rs'si8042_tally;drivers/acpi.rs's andlib/acpi'siapc_boot_archwith its three tests, whose one caller only logged it.kernel/ps2(1,023 lines) leaveskernel/forsystem/ps2server/ps2; the "like toyos-ps2" clause in five other crates'Cargo.tomlheaders goes with it.kernel/src: 64,063 lines at858da4d42. About 1,900 go and none is added, so about 62,150 remain; the build reports the measured number. Two interrupts-off sections go: the arming write and its read-back (mod.rs:1192-1242) and the aux re-enable'sIrqGuard;mask_windowsmeasures them base against branch by step 2's rule.Added in userland, estimated: ps2server about 750 lines with its tests' fake;
toyos-inputabout 280, plus what moves out oftoyos-usbhid; the compositor and the console about 100 between them; the supervisor about 15 andtoyos-manifestabout 50 with its test.Checks
Host (
cargo run -- --ci host):toyos-ps2'sdecode.rsandfuzz.rs, moved unchanged.probe.rs, against a scripted fake controller. Its shapes:0xFA 0xAA, and a PS/2 mouse;0xFAat 80 µs and0xAA516 ms after; the TrackPoint's0xFA 0xAA 0x00;0xFAat 581 µs and0xAA2.2 ms after; no aux answer; and its EC translating whatever bit 6 says;0xAE, and is never drained, read as the command byte or let hold OBF against the aux answer;0xFC; its0xAAcoming 1 ms after the 750 ms ceiling; and no0xFA: each disables the keyboard by name;0xFF); a dropped command-byte write.0xADsets it,0xAEclears it, and0x60writes it with the rest of the byte; a keystroke the script offers while bit 4 is set waits in the fake keyboard, as K88 39 has it, and loads only once bit 4 clears.0xAA,0xAB, anything C does not list); a0x20written while the keyboard interface is enabled; a device answer read before its interrupt.stream.rs: an overrun code sendsLOST; an undecoded run is named whole; OBF still set after 32 reads ends the stream by name; a keyboard byte found waiting before the re-enable's write reaches the keyboard's decoder; three failed re-enables write the pointer off with0xA7; and a packet survives a delay longer thanPACKET_GAP_NSbetween any of its bytes' reads and the next wake, which arrival-to-arrival gaps would split.toyos-input: every refusal of a key, pointer andLOSTframe; Shift from one source andafrom another arrive as a shifteda; a repeated make from one source delivers nothing; a source's end releases what it held and nothing another source holds; two pointers' buttons OR, and one's zero-buttons report clears none of the other's; a connection's end clears its pointers' buttons; relative motion scales by the screen and absolute motion sets;rel_scale_for's test, moved.toyos-usbhid: its tests unchanged overKeys.toyos-manifest: the supervisor's restart decisions, as Restart lists them.The kernel's integration (T14 rows):
isa_ports_are_the_binders_aloneandisa_lines_reach_their_holder, on the plaintestcasesboot now that no kernel takes the row, withisa_lines' newdiesrole as the exit's test.The smoke test:
console_image_boots, an existing QEMU boot ofimages/console.toml, also requires ps2server's armed line for the keyboard. No new boot is added. Why QEMU: the guest suite is the one merge-queue check that starts ps2server under the supervisor from a shipped image, so it is what catches a manifest row, a claim or a connection that breaks the start; the metal rows reach the same, but only when the orchestrator runs them. QEMU's i8042 and keyboard are an implementation that is not ours, answering the reset with K 11 and 13 as the oracle.Metal, run by the orchestrator:
ps2server_armsridesMETALCASEon both benches: on each, the keyboard reset and armed set 2 translated, the line naming the0xAA's time after the ack; on the T14 the aux device armed, on the AMD bench the aux device absent; noi8042=source in the IRQ census.mask_windows, base against branch.Negative controls, each run and reported at the build:
ps2server_armsand the smoke test red, since nothing saysps2server:;probe.rsred;0x60written with bit 4 clear (round 5's BLOCKER 1): the keystroke-during-the-aux-reset shape and the dropped-command-byte shape red;0x20read-back's shapes red;0xAA's bound narrowed to K 11's 500 ms: the T14 shape red, which is M2's reading holding the ceiling where it is;toyos-manifest's test red;isa_lines_reach_their_holderred;toyos-input's tests red;stream.rs's packet test red.Oracles: C, K, K88 and TP at the pages cited; QEMU's i8042 and keyboard, an implementation that is not ours; both benches' ECs, read by M1 and M2; the HID Usage Tables, for the decoder's tables.
Where the moved code rested on Linux
i8042/mod.rs:892-895, the set read and never written, citing Linux'satkbd_select_setand EDK2'sPs2KeyboardDxe. Now the set is neither read nor written: the reset leaves set 2 (K 13), and M2 read both benches' keyboards answer it.kernel/ps2/src/key.rs:4and:172, set 2 behind translation as "Linux's default configuration". Now C 10, the PC-compatible mode.issues/t14-keyboard-will-not-report-its-scancode-set.mdjustifies the Refused arm by Linux'si8042.c/atkbdand withholds0xF2byatkbd_skip_getid. Now there is no Refused arm and no query, and ps2server sends no Read ID. The issue file is not edited.kernel/usbhid/src/keyboard.rs:21and:27cite Linux in the header of the fileKeysmoves out of, andkernel/usbhid/src/pointer.rs:17in the file the five-button mask moves into.issues/the-tree-names-linux-as-an-authority.mdowns all three by its exit (git grep -n -i linux -- kernel …), so they stay where they are.Roast
0xFEand0xD1reach the CPU's reset (C 13).issues/the-i8042s-holder-holds-the-machines-reset-line.mdrecords it, owned by the power broker's track; until now only test jobs held the row.Mergeand aPointer.restartrow, and a clean exit is not restarted. Both reach everyrestartrow.0x60disables the interface may be lost, once per probe, where K88 39 and C 12 disagree; no bench has shown it.LOST; nothing is timed on QEMU, and the T14's numbers are reported, not judged.ps2server_arms./logonly.Design-round questions, since ruled
Round 5's rulings decided the
0xAAbound, #877's A2 (superseded by this landing first, or deleted with the kernel driver if A2 lands first) and the uninitialised-8042 issue, which this build closes.🤖 Generated with Claude Code
https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy