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/HalHandoverStub.asm | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 dev/kernel/HALKit/AMD64/HalHandoverStub.asm (limited to 'dev/kernel/HALKit/AMD64/HalHandoverStub.asm') diff --git a/dev/kernel/HALKit/AMD64/HalHandoverStub.asm b/dev/kernel/HALKit/AMD64/HalHandoverStub.asm new file mode 100644 index 00000000..a337a223 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalHandoverStub.asm @@ -0,0 +1,30 @@ +;; /* +;; * ======================================================== +;; * +;; * NeKernel +;; * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. +;; * +;; * ======================================================== +;; */ + +[bits 64] + +%define kTypeKernel 100 +%define kArchAmd64 122 +%define kHandoverMagic 0xBADCC + +global _HandoverMagic +global _HandoverType +global _HandoverPad +global _HandoverArch + +section .ldr + +_HandoverMagic: + dq kHandoverMagic +_HandoverType: + dw kTypeKernel +_HandoverPad: + dw 0 +_HandoverArch: + dw kArchAmd64 -- cgit v1.2.3