summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Modules
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-27 19:37:29 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-27 19:37:29 +0200
commitc9e0e4b6058f833f39c2193e217dc38f4edd8b82 (patch)
tree7eadd57a88b51fc70ffd2668c7adc29386650e91 /dev/ZKA/Modules
parentfdbcbba07cac3dbf9ef377f2f5248dd662f6babd (diff)
[WIP] Finishing SMP support, and then working on system driver and
loader. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Modules')
-rw-r--r--dev/ZKA/Modules/ACPI/ACPI.hxx4
-rw-r--r--dev/ZKA/Modules/ACPI/ACPIFactoryInterface.hxx4
-rw-r--r--dev/ZKA/Modules/PS2/PS2MouseInterface.hxx115
3 files changed, 4 insertions, 119 deletions
diff --git a/dev/ZKA/Modules/ACPI/ACPI.hxx b/dev/ZKA/Modules/ACPI/ACPI.hxx
index 44e9fa1b..c959d6c1 100644
--- a/dev/ZKA/Modules/ACPI/ACPI.hxx
+++ b/dev/ZKA/Modules/ACPI/ACPI.hxx
@@ -48,7 +48,7 @@ namespace Kernel
UInt32 Reserved;
};
- enum class ACPI_ADDRESS_SPACE_KIND : UInt8
+ enum ACPI_ADDRESS_SPACE_KIND : UInt8
{
eSystemMemory = 0,
eSystemIO = 1,
@@ -62,7 +62,7 @@ namespace Kernel
class PACKED ACPI_ADDRESS final
{
public:
- ACPI_ADDRESS_SPACE_KIND AddressSpaceId;
+ UInt8 AddressSpaceId;
UInt8 RegisterBitWidth;
UInt8 RegisterBitOffset;
UInt8 Reserved;
diff --git a/dev/ZKA/Modules/ACPI/ACPIFactoryInterface.hxx b/dev/ZKA/Modules/ACPI/ACPIFactoryInterface.hxx
index a8f22c10..0d724f3b 100644
--- a/dev/ZKA/Modules/ACPI/ACPIFactoryInterface.hxx
+++ b/dev/ZKA/Modules/ACPI/ACPIFactoryInterface.hxx
@@ -29,8 +29,8 @@ namespace Kernel
ACPIFactoryInterface(const ACPIFactoryInterface&) = default;
public:
- void Shutdown(); // shutdown
- void Reboot(); // soft-reboot
+ Void Shutdown(); // shutdown
+ Void Reboot(); // soft-reboot
public:
/// @brief Descriptor find factory.
diff --git a/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx b/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx
deleted file mode 100644
index ec57b134..00000000
--- a/dev/ZKA/Modules/PS2/PS2MouseInterface.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
- File: PS2MouseInterface.hxx
- Purpose: PS/2 mouse.
-
- Revision History:
-
- 03/02/24: Added file (amlel)
-
-------------------------------------------- */
-
-#pragma once
-
-#include <ArchKit/ArchKit.hxx>
-#include <CompilerKit/CompilerKit.hxx>
-#include <NewKit/Defines.hxx>
-
-namespace Kernel
-{
- /// @brief PS/2 Mouse driver interface
- class PS2MouseInterface final
- {
- public:
- explicit PS2MouseInterface() = default;
- ~PS2MouseInterface() = default;
-
- ZKA_COPY_DEFAULT(PS2MouseInterface);
-
- public:
- /// @brief Enables PS2 mouse for kernel.
- /// @return
- Void Init() noexcept
- {
- 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->Wait();
-
- UInt8 status = HAL::In8(0x60);
- status |= 0x02;
-
- HAL::Out8(0x64, 0x60);
- HAL::Out8(0x60, status); // setting the correct bit is the "compaq" status byte
-
- HAL::Out8(0x64, 0xD4);
- HAL::Out8(0x60, 0xFA); // setting the correct bit is the "compaq" status byte
-
- this->Read();
-
- // Unmask mouse IRQ.
-
- // get slave PIC.
- UInt8 old_pic = HAL::In8(0x21);
-
- // enable mosue interrupts
- HAL::Out8(0x21, old_pic & (~0b00000100));
- }
-
- public:
- Bool WaitInput() noexcept
- {
- UInt64 timeout = 100000;
-
- while (timeout)
- {
- if ((HAL::In8(0x64) & 0x1))
- {
- return true;
- }
-
- --timeout;
- } // wait until we can read
-
- // return the ack bit.
- return false;
- }
-
- Bool Wait() noexcept
- {
- UInt64 timeout = 100000;
-
- while (timeout)
- {
- if ((HAL::In8(0x64) & 0b10) == 0)
- {
- return true;
- }
-
- --timeout;
- } // wait until we can read
-
- // return the ack bit.
- return false;
- }
-
- Void Write(UInt8 val)
- {
- HAL::Out8(0x64, 0xD4);
- this->Wait();
- HAL::Out8(0x60, val);
- this->Wait();
- }
-
- UInt8 Read()
- {
- this->WaitInput();
- return HAL::In8(0x60);
- }
- };
-} // namespace Kernel