diff options
| author | amlal <amlal@el-mahrouss-logic.com> | 2024-03-23 10:22:31 +0100 |
|---|---|---|
| committer | amlal <amlal@el-mahrouss-logic.com> | 2024-03-23 10:22:31 +0100 |
| commit | 57834666259af373d19b560108ed7bb322b68adb (patch) | |
| tree | fdf1d4fdced47b0ebf8c90d8f8d9f54e852ad75f /Private/Builtins/PS2 | |
| parent | 77bf7cab39fef40797e8832aaef91abbdf0098f5 (diff) | |
Kernel: PS2 mouse builtin works now.
- But doesnt draw at the exact position, we need to fix that.
Signed-off-by: amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/Builtins/PS2')
| -rw-r--r-- | Private/Builtins/PS2/PS2MouseInterface.hxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Private/Builtins/PS2/PS2MouseInterface.hxx b/Private/Builtins/PS2/PS2MouseInterface.hxx index f37d294e..beb98665 100644 --- a/Private/Builtins/PS2/PS2MouseInterface.hxx +++ b/Private/Builtins/PS2/PS2MouseInterface.hxx @@ -28,7 +28,9 @@ class PS2MouseInterface final { public: Void Init() noexcept { - HCore::kcout << "NewKernel.exe: Enabling PS/2 mouse...\r\n"; + HAL::rt_cli(); + + HCore::kcout << "HCoreKrnl.exe: Enabling PS/2 mouse...\r\n"; this->Write(0xFF); @@ -54,16 +56,20 @@ class PS2MouseInterface final { this->Write(0xF4); auto f4Dat = this->Read(); - HCore::kcout << "NewKernel.exe: PS/2 mouse is OK: " << hex_number(f6Dat); + HCore::kcout << "HCoreKrnl.exe: PS/2 mouse is OK: " << hex_number(f6Dat); HCore::kcout << ", " << hex_number(f4Dat) << end_line(); + + HAL::Out8(0x64, 0xAD); + + HAL::rt_sti(); } - private: + public: Bool WaitInput() noexcept { UInt64 timeout = 100000; while (timeout) { - if ((HAL::In8(0x64) & 0x1)) { + if ((HAL::In8(0x64) & 0x1) == 0x0) { HCore::kcout << "NewKernel.exe: Wait: OK\r\n"; return true; } @@ -94,11 +100,10 @@ class PS2MouseInterface final { } Void Write(UInt8 val) { - this->Wait(); HAL::Out8(0x64, 0xD4); this->Wait(); - HAL::Out8(0x60, val); + this->Wait(); } UInt8 Read() { |
