Fix spurious input in PS/2 keyboard driver

While testing the keyboard driver, I noticed I once in a while get spurious
input characters like '7' or '&' (shift-7) which I never typed. These seem
to happen, but not always, after some pause in the user's input.

It turns out that for reasons I don't understand, the keyboard can send
instead of a normal input byte, a "transmit timeout" message. I don't
know why these happen, but when they do, the data register's content
(usually 0x0 or 0x8) should not be treated as a character (note that 0x8
is the scan code for "7").

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
VGA: do not answer status report escape sequence

The way our "console multiplexor" works is that the VGA driver is
always enabled in parallel with the serial console (when the latter
exists). If the user sends a status report escape sequence (\033[n)
*both* drivers respond, and the duplicate response confuses the
application (such as our cli.c).

In this patch, we disable the status response escape sequence from
the VGA driver; So now if the serial console is enabled, only the
host terminal emulator will respond, and if the serial console is
not enabled, nobody will respond (cli.c will give up waiting in 500ms).

After this patch, cli.c goes back to working on the serial console.
On the VGA console, we still have a bug, where a spurious escape
character (\033) is available to input initially, which still confuses
cli.c, that I still need to fix.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
cli.c: handle bizarre response from qemu's broken terminal emulator

This patch hopefully fixes the last bug causing issue #564 (keyboard
problems when not using the serial port), following several other
fixes in previous patches.

The remaining problem was that cli.c expects a terminal emulator to
either not support the ANSI Device Status Report escape sequence
(\033[6n) at all, or support it fully (returning \033[n;mR). But QEMU
has what appears to be a bug, where when "-serial stdio" is not used
and it defaults to "-serial vc", this qemu-builtin terminal emulator
returns for our DSR just a \033, and nothing more! In this patch we
recognize that nothing follows the \033, and quickly give up instead
of hanging until the user types a character.

Fixes #564.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>