如何将键盘映射到linux中的控制台?

时间:2022-11-18 21:07:49

I am bringing up linux on an an ARM board.

我在一个ARM板上安装linux。

I have a screen connected and working, it boots up to a login prompt on tty1

我有一个连接和工作的屏幕,它引导到tty1上的登录提示。

I have a USB keyboard that, I believe, is being recognized as a input device.

我有一个USB键盘,我相信它被认为是一个输入设备。

How do I tell Linux to use the usb keyboard for input on tty1? I played with stty for an hour, but I'm not sure this is it. Is there some Udev rule I need to configure?

我如何告诉Linux使用usb键盘输入tty1?我和stty玩了一个小时,但我不确定是这样。我需要配置一些Udev规则吗?

thanks

谢谢

EDIT

编辑

Here is a dump of my kernel log; this is when I pull the plug:

这里是我的内核日志的转储;这是我拔掉插头的时候:

[56234.757446] usb 1-1: USB disconnect, device number 2
[56234.765391] evbug: Event. Dev: input0, Type: 0, Code: 0, Value: 1
[56234.769276] evbug: Disconnected device: input0

This is when I plug it back in.

这是我把它代回去的时候。

[56238.339500] usb 1-1: new low-speed USB device number 3 using ci_hdrc
[56238.949462] usb 1-1: device not accepting address 3, error -71
[56239.069499] usb 1-1: new low-speed USB device number 4 using ci_hdrc
[56239.248248] usb 1-1: New USB device found, idVendor=04d9, idProduct=1203
[56239.255036] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[56239.406428] usbhid 1-1:1.0: can't add hid device: -71
[56239.411605] usbhid: probe of 1-1:1.0 failed with error -71
[56239.478370] input: HID 04d9:1203 as /devices/soc.1/70000000.aips/73f80000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1/0003:04D9:1203.0002/input/input1
[56239.492158] evbug: Connected device: input1 (HID 04d9:1203 at usb-ci_hdrc.0-1/input1)
[56239.492754] hid-generic 0003:04D9:1203.0002: input,hidraw0: USB HID v1.11 Device [HID 04d9:1203] on usb-ci_hdrc.0-1/input1

I'm not sure what the error -71 is all about, I can't seem to find that error number in the source (kernel 3.15) . But it still appears to have succeeded as being recognized as an input device.

我不确定错误-71是什么,我似乎无法在源代码中找到错误编号(内核3.15)。但它似乎仍被认为是一种输入设备。

Further, when I plug/unplug the keyboard the screen blanking ends and I see the text again. This to me would imply that something is being recognized as an input device. And, sysfs recognizes it has a keyboard input device... at least that's what I think this means:

此外,当我插入/拔出键盘时,屏幕会消失,我又看到了文本。对我来说,这意味着某些东西被识别为输入设备。而且,sysfs承认它有一个键盘输入设备……至少我认为这意味着:

arm:/sys/devices/soc.1/70000000.aips/73f80000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1/0003:04D9:1203.0003/input/input2/capabilities# cat key
2000000 39fa d941d001 1e0000 0 0 0

2 个解决方案

#1


1  

First of all all try to make sure that the keyboard is really recognized as input device (watching the kernel boot log or call dmesg on a serial console, etc.) Chances are that that either the USB host or maybe even the keyboard input support is not enabled in your kernel config.

首先所有试图确保键盘是公认的输入设备(看内核引导日志或串行控制台调用dmesg,等等),USB主机,或者甚至没有启用键盘输入支持在你的内核配置。

#2


0  

It appears to have been a problem within the kernel. There must have been a missing feature. The requirement for having a keyboard has been dropped, and so I am not following up on this.

这似乎是内核中的一个问题。肯定有一个缺失的功能。键盘的要求已经降低了,所以我没有跟进。

#1


1  

First of all all try to make sure that the keyboard is really recognized as input device (watching the kernel boot log or call dmesg on a serial console, etc.) Chances are that that either the USB host or maybe even the keyboard input support is not enabled in your kernel config.

首先所有试图确保键盘是公认的输入设备(看内核引导日志或串行控制台调用dmesg,等等),USB主机,或者甚至没有启用键盘输入支持在你的内核配置。

#2


0  

It appears to have been a problem within the kernel. There must have been a missing feature. The requirement for having a keyboard has been dropped, and so I am not following up on this.

这似乎是内核中的一个问题。肯定有一个缺失的功能。键盘的要求已经降低了,所以我没有跟进。