Re: [initramfs] wait_for_keypress() and ->wait_key()

Russell King (rmk@arm.linux.org.uk)
Fri, 13 Jul 2001 11:45:45 +0100


On Thu, Jul 12, 2001 at 08:00:27PM -0400, Alexander Viro wrote:
> ... On some of them (e.g. serial console) it actually
> eats the character it had receieved.
> ...
> Better yet, attach a VT220 to serial console and press any key that
> would send multiple characters. Yup, that will eat one of them. Have fun
> if you call wait_for_keypress() more than once. (On a normal keyboard
> the effect will differ - next call will block).

We could get round this easily by draining the serial port of charactesr
on entry to the wait_key method. This would mean that the user would
have to press the key after the message has been displayed, which I don't
think is unreasonable, and probably reflects the keyboard behaviour more
accurately.

Note that as long as the device (whether it be VT or serial port) isn't
actually open, the characters pressed will be discarded in both the serial
port and keyboard case, so its not like you're storing up trouble later on.
Currently that is the case.

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/