Fix stack pointer miscalculation caused by adding KERNEL_STACK_SIZE twice
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 33s
Builds / ExectOS (amd64, release) (push) Successful in 31s
Builds / ExectOS (i686, release) (push) Successful in 38s
Builds / ExectOS (i686, debug) (push) Successful in 40s

This commit is contained in:
2026-05-17 14:38:44 +02:00
parent fc0e1384c4
commit 8080e07281
2 changed files with 4 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
* FILE: xtoskrnl/ke/amd64/krnlinit.cc
* DESCRIPTION: CPU architecture specific kernel initialization
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
* Aiken Harris <harraiken91@gmail.com>
*/
#include <xtos.hh>
@@ -180,7 +181,7 @@ KE::KernelInit::SwitchBootStack(VOID)
PVOID StartKernel;
/* Calculate the stack pointer at the top of the buffer, ensuring it is properly aligned as required by the ABI */
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() + KERNEL_STACK_SIZE) & ~(STACK_ALIGNMENT - 1);
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() & ~(STACK_ALIGNMENT - 1));
/* Get address of KernelInit::StartKernel() */
StartKernel = (PVOID)KE::KernelInit::BootstrapKernel;