This is the code for how it's reading keyboard input. Seems like it's just dead simple? From what I understand about how BugChecker works, I don't think anything else matters, except maybe ensuring stability.
I wonder how much abstraction is living in the BIOS and hardware bits to make this work, vs those I/O ports literally being a direct interface to the PS/2 keyboard.
The purpose of "USB Legacy Mode" as I understood it was to make a USB keyboard appear to be a PS/2 keyboard during boot, so if you could somehow make that mode stay active even after windows boots, maybe it would work with this?
>I wonder how much abstraction is living in the BIOS and hardware bits to make this work
I think any modern chipset that supports PS/2 still includes a keyboard controller that is essentially the same as it was 30+ years ago, only the ISA bus is emulated over a serial connection[0].
The interesting thing is that even back then, that controller was translating the raw scancodes sent from the keyboard, in order to be compatible with the original IBM PC. And for compatibility with the first (84 key IIRC) AT keyboard, the keyboard itself also sends certain keys as sequences starting with a "fake" Ctrl or Shift keypress, instead of a single number for each key.
There are commands to turn all (or most) of this translation off in both the controller and the keyboard itself, but on newer system or with USB->legacy translation they may not work [1]. So any keyboard driver today is essentially stuck interpreting these translated scancodes.
> I wonder how much abstraction is living in the BIOS and hardware bits to make this work, vs those I/O ports literally being a direct interface to the PS/2 keyboard.
Depends on that Legacy USB flag. For a real PS/2 device that I/O port is a pretty direct line to a microcontroller living on the southbridge (or a Super I/O chip sitting off of an LPC bus) that babysits the PS/2 bus. But with that Legacy USB flag enabled it's a trap to System Management Mode to emulate it the same way an I/O port access in user space might trap into the kernel.
https://wiki.osdev.org/%228042%22_PS/2_Controller
https://github.com/vitoplantamura/BugChecker/blob/master/Bug...
This is the code for how it's reading keyboard input. Seems like it's just dead simple? From what I understand about how BugChecker works, I don't think anything else matters, except maybe ensuring stability.