From 4068a0cda2b014d16e513b912f7fba9436b703e1 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 13 Oct 2026 06:38:43 +0200 Subject: [PATCH 1/4] issues: the kernel-is-small track's input steps deliver to the screen's owner over the `input` port Step 10 sent USB HID to the kernel's keyboard claim, and stage 7 step 2 had ps2server feed the kernel's keyboard and mouse streams so the merge stayed in the kernel. The ruling on #899 (issuecomment-6137234392), applied to usbd on #901 (issuecomment-6137234651, and the review's NOTE 6 there, issuecomment-6137611615), puts the merge in userland with no kernel feed. Both clauses now say the drivers deliver to the screen's owner over the `input` port, and that the kernel's keyboard and mouse streams go when their last kernel source leaves. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy --- ...el-is-small-interrupts-post-and-threads-wait.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md index f5309e3018..7785960650 100644 --- a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md +++ b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md @@ -179,9 +179,11 @@ Beside that order, each waiting on something outside it: Each half measures the kernel's lines and its longest interrupts-off and preemption-off windows, by stage 6 step 2's rule. - 10. **usbd**, stage 5's second half: the whole xHCI moves, HID to the - keyboard claim and mass storage over `toyos-blockring`. A USB - keyboard's transitions reach the kernel only as usbd's keyboard claim. + 10. **usbd**, stage 5's second half: the whole xHCI moves, HID delivered + to the screen's owner over the `input` port and mass storage over + `toyos-blockring`. A USB keyboard's transitions never reach the + kernel, whose keyboard and mouse streams go when their last kernel + source leaves (the ruling on #899, applied to usbd on #901). Its decoders are `toyos-xhci`'s Bulk-Only and SCSI modules and `toyos-usbhid`. **Exit**: the kernel's part, usbd's claims handed over again at its death: the controller's by `usbd_drives_the_spare` @@ -305,8 +307,10 @@ Beside that order, each waiting on something outside it: **Partly done**: step 1. 1. **The panic console takes no input, and an `isa` claim grants a process exact ports and its ISA lines.** **Done** (#592). - 2. **ps2server**, the server over that claim, feeding the kernel's keyboard - and mouse streams so the merge with USB HID stays where it is; the + 2. **ps2server**, the server over that claim, delivering to the screen's + owner over the `input` port, where userland merges it with USB HID (the + ruling on #899); the kernel's keyboard and mouse streams go when their + last kernel source leaves; the kernel's driver, its vector, its actuators and the `keyboard_controller` seam deleted. A keyboard claim is refused while no source exists, which the supervisor's order of endowment then decides. From 8728cbf9776be5b55123017b27babfd099630f62 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 13 Oct 2026 07:22:07 +0200 Subject: [PATCH 2/4] issues: the track's input exits name the `isa` claim and the owner's 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 Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy --- ...-small-interrupts-post-and-threads-wait.md | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md index 7785960650..6d250b945c 100644 --- a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md +++ b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md @@ -188,8 +188,11 @@ Beside that order, each waiting on something outside it: `toyos-usbhid`. **Exit**: the kernel's part, usbd's claims handed over again at its death: the controller's by `usbd_drives_the_spare` on the default `qemu-xhci` (below) and - `usbd_drives_the_type_c_controller`, the keyboard's by stage 7 step - 2's kernel test on usbd's claim. usbd's, a device that stops answering + `usbd_drives_the_type_c_controller`; there is no keyboard claim. The + owner of input's, a key usbd held at its death released: + `toyos-input`'s test that a connection's end releases every device it + carried and a `gone` only its own `source`, red with either release + widened or removed. usbd's, a device that stops answering costing only itself: `toyos-xhci-sim`'s `a_controller_that_never_answers_still_releases_the_port`, `a_recovery_the_controller_refuses_lets_the_device_go` and @@ -312,16 +315,17 @@ Beside that order, each waiting on something outside it: ruling on #899); the kernel's keyboard and mouse streams go when their last kernel source leaves; the kernel's driver, its vector, its actuators and the - `keyboard_controller` seam deleted. A keyboard claim is refused while no - source exists, which the supervisor's order of endowment then decides. + `keyboard_controller` seam deleted. ps2server's one kernel claim is the + `isa` row; it takes no keyboard claim, and the owner reads its + transitions from its `input` acceptor's connections. **Exit**: no i8042 code in the kernel (`arch/x86_64/i8042/`, `arch/x86_64/idt/i8042.rs` and both architectures' `keyboard_controller` gone from `kernel/src`, and `toyos-ps2`, whose one kernel user is `kernel/src/arch/x86_64/i8042/mod.rs`, gone from - `kernel/Cargo.toml`); a kernel test this step owes, that a keyboard - claim whose holder dies is handed to the next claimant and the - keyboard stream delivers its transitions and none of the dead - holder's, red on a kernel that keeps the dead holder as the source; + `kernel/Cargo.toml`); a kernel test this step owes, that the `isa` + row whose holder dies is handed to the next claimant with none of the + dead holder's records pending (`isa_lines_reach_their_holder`), red + on a kernel whose release keeps the dead holder's record; and ps2server's restart mid-packet held by `toyos-ps2`'s `a_lost_scancode_byte_never_wedges_the_prefix_state` and `a_stream_truncated_at_any_offset_resyncs_within_two_packets`. From a5c8e226ed129292b273348518e1a418f87dd7e5 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 13 Oct 2026 07:32:02 +0200 Subject: [PATCH 3/4] issues: step 10's exit checks the kernel's input streams deleted; the 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 Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy --- ...-small-interrupts-post-and-threads-wait.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md index 6d250b945c..3637873c8a 100644 --- a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md +++ b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md @@ -180,7 +180,7 @@ Beside that order, each waiting on something outside it: Each half measures the kernel's lines and its longest interrupts-off and preemption-off windows, by stage 6 step 2's rule. 10. **usbd**, stage 5's second half: the whole xHCI moves, HID delivered - to the screen's owner over the `input` port and mass storage over + to the owner of input over the `input` port and mass storage over `toyos-blockring`. A USB keyboard's transitions never reach the kernel, whose keyboard and mouse streams go when their last kernel source leaves (the ruling on #899, applied to usbd on #901). @@ -189,10 +189,14 @@ Beside that order, each waiting on something outside it: over again at its death: the controller's by `usbd_drives_the_spare` on the default `qemu-xhci` (below) and `usbd_drives_the_type_c_controller`; there is no keyboard claim. The + kernel's input streams, deleted: `keyboard.rs`, `mouse.rs` and + `input_merge_test.rs` gone from `kernel/src`, and no `Keyboard` or + `Mouse` in `sdk/abi`'s `DeviceType` or `FileType`. The owner of input's, a key usbd held at its death released: `toyos-input`'s test that a connection's end releases every device it - carried and a `gone` only its own `source`, red with either release - widened or removed. usbd's, a device that stops answering + carried and a `gone` only its own `source`, red with `Merge`'s release + on a connection's end removed, and red with `gone` releasing its whole + connection. usbd's, a device that stops answering costing only itself: `toyos-xhci-sim`'s `a_controller_that_never_answers_still_releases_the_port`, `a_recovery_the_controller_refuses_lets_the_device_go` and @@ -310,10 +314,11 @@ Beside that order, each waiting on something outside it: **Partly done**: step 1. 1. **The panic console takes no input, and an `isa` claim grants a process exact ports and its ISA lines.** **Done** (#592). - 2. **ps2server**, the server over that claim, delivering to the screen's - owner over the `input` port, where userland merges it with USB HID (the - ruling on #899); the kernel's keyboard and mouse streams go when their - last kernel source leaves; the + 2. **ps2server**, the server over that claim, delivering to the owner + of input over the `input` port, where userland merges it with USB HID + (the ruling on #899); the kernel's merge (`HELD`, `merged_buttons`, + `SOURCE_EXISTS`) is deleted, and its streams carry its own sources' + records unmerged until usbd takes the last of them; the kernel's driver, its vector, its actuators and the `keyboard_controller` seam deleted. ps2server's one kernel claim is the `isa` row; it takes no keyboard claim, and the owner reads its From ee3d8d62c76db20679ddc7a7b84d967f3b56ebe5 Mon Sep 17 00:00:00 2001 From: japabu Date: Tue, 13 Oct 2026 07:42:33 +0200 Subject: [PATCH 4/4] issues: step 10 depends on stage 7 step 2 landing first At step 10 usbd's is the kernel's last input source, so its exit's deletion of the kernel's input streams is met only once ps2server holds the i8042. The owner's ruling on #904 puts 7.2 before step 10. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015xhaydXCVRNscoccHYFUWy --- .../the-kernel-is-small-interrupts-post-and-threads-wait.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md index 3637873c8a..764d97701c 100644 --- a/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md +++ b/issues/the-kernel-is-small-interrupts-post-and-threads-wait.md @@ -183,7 +183,10 @@ Beside that order, each waiting on something outside it: to the owner of input over the `input` port and mass storage over `toyos-blockring`. A USB keyboard's transitions never reach the kernel, whose keyboard and mouse streams go when their last kernel - source leaves (the ruling on #899, applied to usbd on #901). + source leaves (the ruling on #899, applied to usbd on #901). It + depends on stage 7 step 2 landing first, because at step 10 usbd's + is the kernel's last input source (the ruling on #904, + https://github.com/ToyOSOrg/ToyOS/pull/904#issuecomment-6139079945). Its decoders are `toyos-xhci`'s Bulk-Only and SCSI modules and `toyos-usbhid`. **Exit**: the kernel's part, usbd's claims handed over again at its death: the controller's by `usbd_drives_the_spare`