Kernel: Implement PS/2 mouse driver

This is realtively simple driver that queries extensions (scroll +
extra buttons) from mouse and reads mouse packages.
This commit is contained in:
2024-01-04 12:17:55 +02:00
parent d1e187570e
commit e45b544a39
5 changed files with 309 additions and 3 deletions
+3 -3
View File
@@ -5,6 +5,7 @@
#include <kernel/Input/PS2/Config.h>
#include <kernel/Input/PS2/Controller.h>
#include <kernel/Input/PS2/Keyboard.h>
#include <kernel/Input/PS2/Mouse.h>
#include <kernel/InterruptController.h>
#include <kernel/IO.h>
#include <kernel/Timer/Timer.h>
@@ -213,10 +214,9 @@ namespace Kernel::Input
// Standard PS/2 Mouse
if (index == 1 && (bytes[0] == 0x00))
return BAN::Error::from_error_code(ErrorCode::PS2_UnsupportedDevice);
m_devices[device] = TRY(PS2Mouse::create(*this));
// MF2 Keyboard
if (index == 2 && (bytes[0] == 0xAB && bytes[1] == 0x83))
else if (index == 2 && (bytes[0] == 0xAB && bytes[1] == 0x83))
m_devices[device] = TRY(PS2Keyboard::create(*this));
if (m_devices[device])