I have an old kernel stub with PS/2 logic for keyboard input. It works well in QEMU and Virtualbox, but miserably fails on my physical machine (laptop). I suspect a bug in it (obviously), and I'll be writing it again from scratch soon. No big deal really, but it raised at lot of questions.
At the start, I thought that my laptop could have a USB keyboard, while I was sending orders to the PS/2 controller. I'm originally from the userspace programming world, and I like things that are properly defined and reliable. Clearly this (Brendan) lit a red blinking LED in my brain :
I'm assuming there is no reliable way of detecting which operations will be supported by the firmware, so here is my first question:Brendan wrote:I'm guessing it doesn't and it's actually a USB keyboard, and you're relying on the "dodgy beyond belief" PS/2 emulation the firmware tries to do.
Is there a set of PS/2 operations that is considered "safe" to perform on emulated PS/2 controllers?
I searched the wiki and the forum for mentions of USB keyboards but found little. I may have missed crucial info; what came up is mainly this (LtG):
My main question is the following:LtG wrote:There are also USB keyboards, most (all?) MoBo's support translating USB keyboard into a PS/2, so you don't have to deal with USB. USB is significantly more complex and takes a lot more effort. PS/2 I think is pretty simple, read the wiki and the specs.
Is it suitable for a full-fledged OS to rely on this translation and consider keyboards to be PS/2 devices?
It seems to me that Linux views my keyboard as a PS/2 device. Here is the output of hwinfo --keyboard (/dev/input/event0 is indeed my laptop's keyboard):
Code: Select all
18: PS/2 00.0: 10800 Keyboard
[Created at input.226]
Unique ID: nLyy.+49ps10DtUF
Hardware Class: keyboard
Model: "AT Translated Set 2 keyboard"
Vendor: 0x0001
Device: 0x0001 "AT Translated Set 2 keyboard"
Compatible to: int 0x0211 0x0001
Device File: /dev/input/event0
Device Number: char 13:64
Driver Info #0:
XkbRules: xfree86
XkbModel: pc104
Config Status: cfg=new, avail=yes, need=no, active=unknown
Any help would be greatly appreciated.