console: no USB keyboard!

16 views
Skip to first unread message

Hartmann, O.

unread,
Mar 13, 2021, 2:01:51 PM3/13/21
to FreeBSD CURRENT
Running 14-CURRENT on several boxes (i.e. FreeBSD 14.0-CURRENT #49
main-n245422-cecfaf9bede9: Fri Mar 12 16:08:09 CET 2021 amd64) with custom and/or GENERIC
kernel and USB-only equipment (mouse if available, keyboard).
In multiuser mode, there is no problem using the USB keyboard. On single user console
(for maintenance purposes), no USB keyboard is available. The same is true while booting
and the rc scripts are worked on. Usually, one can hit the enter key and inserts a
newline, this doesn't work anymore until the box is completely up!

I do not know when this problem as been introduced, the very same config is used since
13-CURRENT in its earlier time and has been modified accordingly, but I can't see obvios
changes which would explain the wrecked behaviour now.

I got aware of this problem, when a small mistake in /etc/fstab rendered a box
unbootable, I had to head for the datacenter and wasn't even capable of interrupting the
stuck system. Checking on other boxes running recent 14-CURRENT revealed the same problem.

The interesting part is, that as long as those boxes are with the loader present (all
boxes are UEFI booting!), the USB keyboard works as expected and I'm able to select
kernel/kernel.old and so on.

How to fix this?

Thanks in advance and kind regards,

O. Hartmann

Andriy Gapon

unread,
Mar 14, 2021, 5:42:35 AM3/14/21
to Hartmann, O., FreeBSD CURRENT
Can't help with fixing the problem, but here's some info.
When you are at the loader prompt, BIOS provides emulation of a standard /
legacy keyboard for the USB keyboard. That's why loader can work even though it
doesn't know much about USB.
When a FreeBSD driver for the USB controller takes over then the BIOS emulation
stops. Until a FreeBSD peripheral driver like ukbd attaches, it's not possible
to use the keyboad, unfortunately. You can check your dmesg to see when that
happens.

Personally, I try to avoid "legacy free" solutions and always have a PS/2
keyboard (even if it's a really a USB one using PS/2 <-> USB adapter).

Of course, it would be great to reduce the dead window for USB keyboards and I
think that it is doable.


--
Andriy Gapon
_______________________________________________
freebsd...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Hartmann, O.

unread,
Mar 14, 2021, 8:17:22 AM3/14/21
to Andriy Gapon, Hartmann, O., FreeBSD CURRENT
Hello,

thank you very much for the explanation. For usual, I compile all necessary module
staticlly into the kernel, the USB mouse, massstorage, keyboard. There was a message
about some changes with uhid/hid, I tried all variants coming to my mind, starting from
GENERIC up to add-ons statically compiled in. The systems in question I observed this
the first time are quite old (Z77/IvyBridge era) and do have PS/2 sockets, but others
(KabyLake) doesn't. Most KVM we use today in the datacenters are VGA/USB based, so there
is no chance to attach PS/2 equipment :-(

Kind regards,

oh

Tomoaki AOKI

unread,
Mar 14, 2021, 10:11:23 AM3/14/21
to freebsd...@freebsd.org
I usually try these kind of things though /boot/loader.conf whenever
possible.

If you prefer usbhid drivers, add BOTH

hw.usb.usbhid.enable=1
usbhid_load="YES"

lines to loader.conf. IIUC, these should not specified
in /etc/sysctl.conf and /etc/rc.conf respectively (it's too late to work
properly). It would automatically pull hidbus.ko in as a dependency.

IIRC, at least for some trackpads are forcibly handled by i2c and don't
work with legacy usb driver (ums).

OTOH, if USB devices are accidentally (non-intended) handled by usbhid
and causing problems, you shoud intentionally add

hw.usb.usbhid.enable=0

in /boot/loader.conf. This is default, IIRC.

HTH.

--
Tomoaki AOKI <junc...@dec.sakura.ne.jp>
Reply all
Reply to author
Forward
0 new messages