Re: keyboard raw mode?

H. Peter Anvin (hpa@transmeta.com)
21 Jun 1998 19:58:16 GMT


Followup to: <199806210559.BAA07250@saturn.cs.uml.edu>
By author: "Albert D. Cahalan" <acahalan@cs.uml.edu>
In newsgroup: linux.dev.kernel
>
> Mathieu Bouchard writes:
>
> > afaik, there is nothing at the kernel level to prevent a crash of the
> > keyboard when running root or suidroot programs such as the X Server,
> > DosEmu, SvgaLib-based programs (mostly games and demoscene stuff)...
>
> I looked into this a bit. The problem is that keyboard mode is
> associated with the device, not the file descriptor. It seems that
> the device does the keyboard code translations before putting data
> into a TTY flip buffer, from which multiple processes can read the
> data. To fix, conversion must happen on the other side of the TTY
> buffer or the TTY buffer must be eliminated AFAIK.
>

Why?

>
> > keyboard anymore, and no mouse either because X overrides GPM
> > (GPM has a feature for rebooting the system in case of keyboard
> > lock, but if GPM is disabled by X, it's worthless, and anyway,
> > the mouse is not the responsibility of the kernel).
>
> No, the kernel should have better mouse support. SysV systems have
> an event queue that includes both mouse and keyboard. If that is
> not offered, then both mouse and keyboard need to supply high-resolution
> timestamps so that user-space can be sure of event order. Without
> the combined queue and/or timestamps, keystrokes can go to the wrong
> window and a shift-click might be seen as shift followed by click.
> I think GGI's EvStack provides both. Real-time scheduling can hide the
> problem most of the time, but it doesn't completely eliminate the race.
>

Timestamps are a good idea anyway.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu