Kernel: Increase PS/2 timeout and detect more keyboards

I was testing on a old T61
This commit is contained in:
Bananymous 2025-07-16 15:29:27 +03:00
parent 84f1ad4f26
commit 3ec7aad432
1 changed files with 14 additions and 5 deletions

View File

@ -12,7 +12,7 @@
namespace Kernel::Input namespace Kernel::Input
{ {
static constexpr uint64_t s_ps2_timeout_ms = 300; static constexpr uint64_t s_ps2_timeout_ms = 1000;
static PS2Controller* s_instance = nullptr; static PS2Controller* s_instance = nullptr;
@ -461,11 +461,20 @@ namespace Kernel::Input
} }
// MF2 Keyboard // MF2 Keyboard
if (index == 2 && (bytes[0] == 0xAB && (bytes[1] == 0x83 || bytes[1] == 0x41))) if (index == 2 && bytes[0] == 0xAB)
{ {
dprintln_if(DEBUG_PS2, "PS/2 found keyboard"); switch (bytes[1])
m_devices[device] = TRY(PS2Keyboard::create(*this, scancode_set)); {
return {}; case 0x41: // MF2 Keyboard (translated but my laptop uses this :))
case 0x83: // MF2 Keyboard
case 0xC1: // MF2 Keyboard
case 0x84: // Thinkpad KB
dprintln_if(DEBUG_PS2, "PS/2 found keyboard");
m_devices[device] = TRY(PS2Keyboard::create(*this, scancode_set));
return {};
default:
break;
}
} }
dprintln_if(DEBUG_PS2, "PS/2 unsupported device {2H} {2H} ({} bytes) on port {}", bytes[0], bytes[1], index, device); dprintln_if(DEBUG_PS2, "PS/2 unsupported device {2H} {2H} ({} bytes) on port {}", bytes[0], bytes[1], index, device);