summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-16 10:54:40 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-16 10:54:40 +0200
commitc25424d882fcadf0a37a4bc0cd9e08a605bc91a7 (patch)
tree85808d84d5641f6a63dde4817c2953f6892a6fca /dev
parent5b2ec031ab578caec8fbbdbe5350b9c0df493fd3 (diff)
fix(hal/ap): Use a safer origin address on the AMD64 HAL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev')
-rw-r--r--dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc6
-rw-r--r--dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm2
2 files changed, 4 insertions, 4 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc
index 98e96687..f7aa2a70 100644
--- a/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc
+++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessor.cc
@@ -15,7 +15,7 @@
#include <modules/CoreGfx/TextGfx.h>
#include "NewKit/Defines.h"
-#define APIC_Signature "APIC"
+#define APIC_MAG "APIC"
#define AP_BLOB_SIZE 126
@@ -172,7 +172,7 @@ Void mp_init_cores(VoidPtr vendor_ptr) noexcept {
PowerFactoryInterface hw_and_pow_int{vendor_ptr};
- kRawMADT = hw_and_pow_int.Find(APIC_Signature).Leak().Leak();
+ kRawMADT = hw_and_pow_int.Find(APIC_MAG).Leak().Leak();
kMADTBlock = reinterpret_cast<HAL_APIC_MADT*>(kRawMADT);
kSMPAware = NO;
@@ -202,7 +202,7 @@ Void mp_init_cores(VoidPtr vendor_ptr) noexcept {
controller.Write(LAPIC_REG_TIMER_LVT, 32 | (1 << 17));
controller.Write(LAPIC_REG_TIMER_INITCNT, 1000000);
- const UIntPtr trampoline_phys = 0x8000;
+ const UIntPtr trampoline_phys = 0x7c00;
HAL::mm_map_page((VoidPtr)trampoline_phys, (VoidPtr)trampoline_phys, HAL::kMMFlagsWr | HAL::kMMFlagsPresent);
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
index 181937ab..2adc8fed 100644
--- a/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
+++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.asm
@@ -10,7 +10,7 @@
;; */
[bits 16]
-[org 0x8000]
+[org 0x7c00]
hal_ap_start:
mov ax, 0x0