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/HalAPICController.cc | 38 ---------------------------- 1 file changed, 38 deletions(-) delete mode 100644 dev/kernel/HALKit/AMD64/HalAPICController.cc (limited to 'dev/kernel/HALKit/AMD64/HalAPICController.cc') diff --git a/dev/kernel/HALKit/AMD64/HalAPICController.cc b/dev/kernel/HALKit/AMD64/HalAPICController.cc deleted file mode 100644 index e547d982..00000000 --- a/dev/kernel/HALKit/AMD64/HalAPICController.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. - -------------------------------------------- */ - -#include -#include - -#define kIOAPICRegVal (4) -#define kIOAPICRegReg (0) - -namespace Kernel::HAL { -APICController::APICController(VoidPtr base) : fApic(base) {} - -/// @brief Read from APIC controller. -/// @param reg register. -UInt32 APICController::Read(UInt32 reg) noexcept { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; - io_apic[kIOAPICRegReg] = (reg & 0xFF); - - return io_apic[kIOAPICRegVal]; -} - -/// @brief Write to APIC controller. -/// @param reg register. -/// @param value value. -Void APICController::Write(UInt32 reg, UInt32 value) noexcept { - MUST_PASS(this->fApic); - - UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; - - io_apic[kIOAPICRegReg] = (reg & 0xFF); - io_apic[kIOAPICRegVal] = value; -} -} // namespace Kernel::HAL -- cgit v1.2.3