From 5b2ec031ab578caec8fbbdbe5350b9c0df493fd3 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 16 May 2025 09:51:24 +0200 Subject: feat(kernel/ap): Improved and fixed the AP boot flow, also made sure that the segment loading for the long mode stub works. TODO: - Stack pointer shall be set when jumping to AP routine. Signed-off-by: Amlal El Mahrouss --- dev/kernel/HALKit/AMD64/Processor.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'dev/kernel/HALKit/AMD64/Processor.h') diff --git a/dev/kernel/HALKit/AMD64/Processor.h b/dev/kernel/HALKit/AMD64/Processor.h index 1b2e35f7..8fb69c0c 100644 --- a/dev/kernel/HALKit/AMD64/Processor.h +++ b/dev/kernel/HALKit/AMD64/Processor.h @@ -19,6 +19,8 @@ #include #include +#include + #define kPITControlPort (0x43) #define kPITChannel0Port (0x40) #define kPITFrequency (1193180) @@ -28,7 +30,8 @@ #define kPIC2Command (0xA0) #define kPIC2Data (0xA1) -#include +#define kIOAPICRegVal (4) +#define kIOAPICRegReg (0) #define rtl_nop_op() asm volatile("nop") @@ -229,16 +232,16 @@ namespace Detail { }; } // namespace Detail -class APICController final { +class LAPICDmaWrapper final { public: - explicit APICController(VoidPtr base); - ~APICController() = default; + explicit LAPICDmaWrapper(VoidPtr base); + ~LAPICDmaWrapper(); - NE_COPY_DEFAULT(APICController) + NE_COPY_DEFAULT(LAPICDmaWrapper) public: - UInt32 Read(UInt32 reg) noexcept; - Void Write(UInt32 reg, UInt32 value) noexcept; + UInt32 Read(UInt16 reg) noexcept; + Void Write(UInt16 reg, UInt32 value) noexcept; private: VoidPtr fApic{nullptr}; -- cgit v1.2.3