SchOS/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 8c426b2077 irq: turn a PS/2 line over when its device waits and nothing comes
An ASUS TUF A15 booted with its internal keyboard dead and a USB one
fine. These AMD laptops' firmware describes IRQ 1's polarity wrongly --
Linux keeps a quirk list -- and an edge line programmed the wrong way
up never fires: the controller holds its byte, and only the interrupt
that never comes would read it.

irq_watch() lets a driver say how to ask its device whether something
is waiting. The poller asks every tick; 50 ms of waiting with nothing
delivered turns the line's polarity over and drains the device, which
re-arms the edge, and if it still says nothing the line is polled.
Both are announced. The keyboard and the PS/2 mouse are watched.

ISA lines now also take their mode from the MADT's override entries,
which were parsed and never read.

Tested in QEMU, which ignores polarity on edge lines, with the keyboard
line masked: the first key turns it over and typing works; masked again
after the flip, it is polled and typing still works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
2026-10-24 11:10:29 +02:00
..
arch kernel: load at 16 MB, clear of what firmware keeps low 2026-10-24 00:13:53 +02:00
core irq: turn a PS/2 line over when its device waits and nothing comes 2026-10-24 11:10:29 +02:00
dev include: one folder per subsystem, and includes that name it 2026-10-23 15:05:12 +02:00
fs epoll, eventfd, timerfd, signalfd 2026-10-24 10:59:52 +02:00
gfx include: one folder per subsystem, and includes that name it 2026-10-23 15:05:12 +02:00
net include: one folder per subsystem, and includes that name it 2026-10-23 15:05:12 +02:00
uapi include: one folder per subsystem, and includes that name it 2026-10-23 15:05:12 +02:00