From 94141dbd7c1450d079f695d0e8d73e93795161f2 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 25 Aug 2024 09:07:21 +0200 Subject: [CG/FUI] CG's FlatUI library, made for pre-boot/pre-user environements. - FlatUI is used to install ZKA for example. - Or to indicate an error (using the ke_stop call). - Or to show a popup saying that system couldn't boot. The FlatUI's style will be replicated in user space as well, for consistency. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/Modules/PS2/PS2MouseInterface.hxx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'dev/ZKA/Modules/PS2') diff --git a/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx b/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx index 1cba256e..ec57b134 100644 --- a/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx +++ b/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx @@ -33,29 +33,32 @@ namespace Kernel /// @return Void Init() noexcept { - HAL::rt_cli(); - HAL::Out8(0x64, 0xA8); // enabling the auxiliary device - mouse this->Wait(); + HAL::Out8(0x64, 0x20); // tells the keyboard controller that we want to send a command to the mouse - this->WaitInput(); + + this->Wait(); UInt8 status = HAL::In8(0x60); - status |= 0b10; + status |= 0x02; - this->Wait(); HAL::Out8(0x64, 0x60); - this->Wait(); HAL::Out8(0x60, status); // setting the correct bit is the "compaq" status byte - this->Write(0xF6); - this->Read(); + HAL::Out8(0x64, 0xD4); + HAL::Out8(0x60, 0xFA); // setting the correct bit is the "compaq" status byte - this->Write(0xF4); this->Read(); - HAL::rt_sti(); + // Unmask mouse IRQ. + + // get slave PIC. + UInt8 old_pic = HAL::In8(0x21); + + // enable mosue interrupts + HAL::Out8(0x21, old_pic & (~0b00000100)); } public: -- cgit v1.2.3