Keyboard/Mouse drivers on SGI
Quoted 4 lines · Miguel de Icaza
I see that the Xsgi server uses
/dev/input/mouseand/dev/output/keyboard. I can see from par's output that it does some STREAMS ioctls it I_PUSH'es something (I am not even remotely familiar to STREAMS, so I dunno what thoseI_PUSHesdo).
I am not the best person to explain this, but my understanding is that the keyboard and mouse (or spaceball, etc...) are linked (I_LINKed) under a driver called 'shmiq,' which is the shared-memory event queue driver. This driver takes STREAMS data from the underlying devices and converts it into some sort of standard event queue. This allows events to be given to the X server in a standard format, and I believe that this is done by pinning memory in the X server and then copying events into this memory; I have no idea what happens if the server doesn't respond fast enough.
My guess is that /dev/input/{keyboard,mouse} are both some sort of standard serial port driver and that the modules I_PUSHed on top are what interpret the low-level keyboard/mouse protocols.
SCO use a similar approach; their driver is called 'ev' if I remember correctly.
So, if my theory is correct, what I'd expect to see is:
mfd = open /dev/input/mouse
I_PUSH mfd "mouse"
kfd = open /dev/input/keyboard
I_PUSH kfd "keyboard"
sfd = open /dev/shmiq
I_LINK sfd mfd
I_LINK sfd kfd
More than that, I don't know.
-- Steve
Steve Alexander writes:
...
Quoted 14 lines
My guess is that
/dev/input/{keyboard,mouse}are both some sort of standard serial port driver and that the modulesI_PUSHedon top are what interpret the low-level keyboard/mouse protocols.SCO use a similar approach; their driver is called 'ev' if I remember correctly.
So, if my theory is correct, what I'd expect to see is:
mfd = open
/dev/input/mouse
I_PUSHmfd "mouse"
kfd = open/dev/input/keyboard
I_PUSHkfd "keyboard"
Quoted 5 lines
sfd = open
/dev/shmiq
I_LINKsfd mfd
I_LINKsfd kfdMore than that, I don't know.
There are drivers for the actual devices, such as pckm on Indy,
to operate the actual keyboard controller, and then there are higher level streams modules, such as pckbd and pcmouse on Indy, which know about the keyboard and mouse devices (and other devices, such as tablets). The IRIX pckeyboard(7) and pcmouse(7) man pages document the supported keyboards and mice. As far as I know, the interface to the streams modules is not well-documented, as it is used directly only by the X server and the textport driver.
For the time being, I recommend that you go with the usual linux
driver for PC keyboard/mouse controller, which the Indy hardware emulates.
Quoted 4 lines
For the time being, I recommend that you go with the usual linux
driver for PC keyboard/mouse controller, which the Indy hardware emulates.
I may probably go with a SunOS-like mode of this, since it may be the easier to hack on the X server I am using right now (X11R6.1, and I plan to move to X11R6.3 once I have the thing demoable).
Later I could sit down and write the emulation mode for a couple of the STREAMS ioctls.
Cheers,
Miguel
Quoted 11 lines · Miguel de Icaza
Quoted 4 lines
For the time being, I recommend that you go with the usual linux
driver for PC keyboard/mouse controller, which the Indy hardware emulates.I may probably go with a SunOS-like mode of this, since it may be the easier to hack on the X server I am using right now (X11R6.1, and I plan to move to X11R6.3 once I have the thing demoable).
Later I could sit down and write the emulation mode for a couple of the STREAMS ioctls.
The streams ioctl's don't do much in themselves, except in the sense
that they turn on other behavior by pushing streams modules. The latter have more complex behavior. You could hack I_PUSH of a given name to enable specific behavior, and then implement that behavior. The pushed streams module is responsible for controlling the device (keyboard, mouse, tablet, and so on), whereas the driver is mostly responsible for managing the link controller or serial port to which the device is attached.