From 58b3d776ab5435de352217b2a3a525aeb9316e99 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 16 Apr 2025 17:13:31 +0200 Subject: dev, kernel, boot: fix dumb early-init which caused the kernel to jump at IVT. Signed-off-by: Amlal El Mahrouss --- dev/boot/src/BootThread.cc | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'dev/boot/src/BootThread.cc') diff --git a/dev/boot/src/BootThread.cc b/dev/boot/src/BootThread.cc index 3f399d66..f1866a76 100644 --- a/dev/boot/src/BootThread.cc +++ b/dev/boot/src/BootThread.cc @@ -166,40 +166,18 @@ namespace Boot /// @note handover header has to be valid! Int32 BootThread::Start(HEL::BootInfoHeader* handover, Bool own_stack) { - HEL::HandoverProc err_fn = [](HEL::BootInfoHeader* rcx) -> Int32 { - NE_UNUSED(rcx); - - fb_render_string("BootZ: Invalid Boot Image...", 50, 10, RGB(0xFF, 0xFF, 0xFF)); - ::Boot::Stop(); - - return NO; - }; - - if (!fStartAddress) - { - err_fn(handover); - } - fHandover = handover; if (own_stack) { - UInt8* aligned_stack = &fStack[mib_cast(16) - 1]; - aligned_stack = (UInt8*)((UIntPtr)aligned_stack & ~0xF); - - rt_jump_to_address(fStartAddress, fHandover, aligned_stack); + return rt_jump_to_address(fStartAddress, fHandover, &fStack[mib_cast(16) - 1]); } else { - if (fStack) - delete[] fStack; - - fStack = nullptr; - return reinterpret_cast(fStartAddress)(fHandover); } - return kEfiOk; + return kEfiFail; } const Char* BootThread::GetName() -- cgit v1.2.3