The keyboard did not send scancodes until it got the Enable command,
not even after a reset, and the controller started with scancode
translation off. A PS/2 keyboard scans after its power-on reset and
after the Reset command, and PC firmware leaves the controller
translating to scancode set 1.
A guest started with the UEFI firmware does not notice, as the firmware
sends Enable and turns the translation on. FreeBSD's atkbd(4) does
neither: it resets the keyboard and keeps the translation as it finds
it. So a FreeBSD guest loaded with bhyveload(8) got no key at all from
a VNC client, and, with the keyboard enabled by hand, scancodes of set 2
that it took for set 1.
Start with the keyboard scanning and the translation on, and let the
Reset command turn scanning on.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev