fix(keyboard): 去掉重复初始化,键盘只由 service 层 init 一次
现场:explorer 能 open /dev/input/keyboard,但按下键后 [explorer] kbd 一次都不出现 —— 内核侧没有数据。devfs_register_keyboard() 与 services/keyboard.start() 各调了一次 keyboard.init(),而 init 会读-改-写 8042 的 CCB(含数据上报/中断掩码位);第二次执行时设备状态已变,容易把上报关掉。现在初始化只保留 service 层那一次(它更晚、是最终状态);kbd_thread 并未被启动(kbd_svc.th 从未创建),不存在抢数据的问题。
This commit is contained in:
1 parent
4003b0d286
commit
03e1137189
1 file changed
+2
-1
@@ -429,7 +429,8 @@ kbd_file: keyboard_device* = keyboard_device()
|
||||
def devfs_register_keyboard() -> int:
|
||||
global kbd_file
|
||||
kbd_file.__init__()
|
||||
keyboard.init()
|
||||
# 初始化只由 services/keyboard.start() 做一次:重复 init 会二次读改写 8042 的 CCB,
|
||||
# 把数据上报/中断掩码弄乱(现场:设备能 open,但键盘永远没有数据)。
|
||||
return devfs_create_file("/dev/input/keyboard", kbd_file, None)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user