From 384e221216493009195686be69cb08c57efb15cd Mon Sep 17 00:00:00 2001 From: vasilito Date: Wed, 5 Aug 2026 12:34:45 +0300 Subject: [PATCH] kernel: bump gitlink for i8042 verdict + TSC fixes (task 8) --- .../task-8-ryzen-7000-x670e-compat.txt | 94 +++++++++++++++++++ local/sources/kernel | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .omo/evidence/task-8-ryzen-7000-x670e-compat.txt diff --git a/.omo/evidence/task-8-ryzen-7000-x670e-compat.txt b/.omo/evidence/task-8-ryzen-7000-x670e-compat.txt new file mode 100644 index 0000000000..648a2ba4e7 --- /dev/null +++ b/.omo/evidence/task-8-ryzen-7000-x670e-compat.txt @@ -0,0 +1,94 @@ + Finished `test` profile [unoptimized + debuginfo] target(s) in 0.00s + Running unittests src/lib.rs (local/sources/kernel/host-tests/i8042-verdict/target/debug/deps/i8042_verdict_test-616736c5ad6fa945) + +running 14 tests +test fadt_all_possible_boot_arch_absent_patterns ... ok +test fadt_flag_clear_ambiguous_probe_fail ... ok +test fadt_flag_clear_absent_even_with_other_bits_zero ... ok +test fadt_flag_clear_ambiguous_probe_pass ... ok +test fadt_flag_clear_ambiguous_probe_timeout ... ok +test fadt_flag_on_both_bit1_and_bit0_present ... ok +test fadt_flag_set_bit1_ignores_probe ... ok +test fadt_flag_set_i8042_present ... ok +test fadt_flag_set_other_bit_i8042_absent ... ok +test fadt_no_bits_set_probe_determines ... ok +test ps2d_decision_is_deterministic ... ok +test ps2d_verdict_absent_exit_0 ... ok +test ps2d_verdict_present_full_startup ... ok +test ps2d_verdict_unavailable_exit_0_safe_default ... ok + +test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + Doc-tests i8042_verdict_test + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s + + +--- +## QA Fixture Design + +### Verdict matrix host tests (GREEN — 14/14) +All combinations of FADT BOOT_ARCH flags × active probe result are covered. +The verdict function mirror at `host-tests/i8042-verdict/src/lib.rs:30` matches +the kernel logic in `src/acpi/i8042.rs:74-97` line-for-line. + +### QEMU regression (orchestrator runs after commit): +1. **i8042 present (QEMU default):** QEMU exposes a PS/2 controller. + - Build `redbear-mini` → boot → `ps2d` reads `/scheme/serio/present` → "1" → full startup. + - Keyboard input works via `serio:0`. + - No spurious exit-0 lines. + +2. **i8042 absent (QA-only fixture — not shipped):** Kernel built with + `IA_PC_BOOT_ARCH` cleared in the FADT fixture + `redbear-mini` built against + that kernel. + - Boot → kernel does NOT wire IRQ1/12. + - `ps2d` reads `/scheme/serio/present` → "0" → logs ONE info line + "no PS/2 controller present; USB HID is the input path" and exits 0. + - Init continues to login on USB HID (usbhidd). + - Zero spurious serio input events. + +3. **False-positive prevention (QA scenario):** Floating legacy I/O ports + (no hardware), FADT flag clear → verdict absent. Even if a spurious probe + returned transient data, the FADT flag takes precedence when present. + +### Test harness +Single command (no build needed): + cargo test --manifest-path local/sources/kernel/host-tests/i8042-verdict/Cargo.toml + +--- +## Files Changed + +### Kernel fork (`local/sources/kernel/`, submodule/kernel): +- `src/acpi/fadt.rs` — ADD: IA_PC_BOOT_ARCH static + parsing (offset 109, + bit 1 = I8042), accessor `ia_pc_boot_arch()`, FADT_MIN_SIZE_ACPI_5_0 +- `src/acpi/i8042.rs` — NEW: i8042 presence verdict logic (FADT flag + + bounded active probe at ports 0x60/0x64), AtomicBool static `I8042_PRESENT`, + public `i8042_present()` + `init_i8042_verdict()` +- `src/acpi/mod.rs` — ADD: `pub mod i8042`, call `fadt::init()` + + `i8042::init_i8042_verdict()` in `init_after_mem` +- `src/scheme/serio.rs` — ADD: `HandleKind::Present`, path "present" in + `kopenat`, `kread` returns "1\n"/"0\n", `kfpath` returns "serio:present" +- `src/arch/x86_shared/interrupt/irq.rs` — MODIFY: `keyboard` (IRQ1) and + `mouse` (IRQ12) handlers check `i8042_present()` — EOI only when absent + +### Base fork (`local/sources/base/`, submodule/base): +- `drivers/input/ps2d/src/main.rs` — ADD: presence check via + `/scheme/serio/present` before opening serio devices; if absent, log ONE + info line and `process::exit(0)` + +### Host tests: +- `host-tests/i8042-verdict/Cargo.toml` — NEW standalone test crate +- `host-tests/i8042-verdict/src/lib.rs` — NEW: 14 tests (10 verdict matrix + + 4 ps2d decision table) + +### NOT CHANGED (per MUST NOT DO): +- No config TOML modified (ps2d stays in all redbear-* configs) +- No BINS entries removed +- No init service files changed +- No usbhidd gated on ps2d +- No unwrap()/expect() in kernel code +- No `src/scheme/irq.rs` cpu- path handling touched +- No retries/warning noise on absence +- No recipe files modified diff --git a/local/sources/kernel b/local/sources/kernel index 46ea4facf4..088ab2dd67 160000 --- a/local/sources/kernel +++ b/local/sources/kernel @@ -1 +1 @@ -Subproject commit 46ea4facf42948255a26e49515630019059996f1 +Subproject commit 088ab2dd670e611bc2a34a40ad0f4b0bd4717351