diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 18:15:54 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-26 18:15:54 +0100 |
| commit | c0f7f3f300d603d355fc7ec5be317afe1f0ee1b6 (patch) | |
| tree | 87189340d1b6f36474c52c0cf951310862fe9db7 /dev/BootLoader/src/BootThread.cc | |
| parent | 4ed658c633ce5d7c5bde4acdbe322e5f51592369 (diff) | |
IMPL: Improvements and fixes.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/BootLoader/src/BootThread.cc')
| -rw-r--r-- | dev/BootLoader/src/BootThread.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/dev/BootLoader/src/BootThread.cc b/dev/BootLoader/src/BootThread.cc index 6d78d0d1..ae494a15 100644 --- a/dev/BootLoader/src/BootThread.cc +++ b/dev/BootLoader/src/BootThread.cc @@ -122,7 +122,7 @@ namespace Boot #ifdef __ZKA_AMD64__ if (handover_struc->HandoverArch != HEL::kArchAMD64) { - fb_render_string("BootZ: NOT AN HANDOVER IMAGE, BAD ARCHITECTURE...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); ::EFI::Stop(); } #endif @@ -130,11 +130,11 @@ namespace Boot #ifdef __ZKA_ARM64__ if (handover_struc->HandoverArch != HEL::kArchARM64) { - fb_render_string("BootZ: NOT AN HANDOVER IMAGE, BAD ARCHITECTURE...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + fb_render_string("BootZ: Not an handover header, bad CPU...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); ::EFI::Stop(); } #endif - fb_render_string("BootZ: NOT AN HANDOVER IMAGE...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); + fb_render_string("BootZ: Not an handover header...", 40, 10, RGB(0xFF, 0xFF, 0xFF)); ::EFI::Stop(); } @@ -160,18 +160,20 @@ namespace Boot } else { - writer.Write("BootZ: INVALID EXECUTABLE.\r"); + writer.Write("BootZ: Invalid Executable.\r"); } fStack = new UInt8[mib_cast(8)]; } /// @note handover header has to be valid! - Void BThread::Start(HEL::BootInfoHeader* handover, Bool own_stack) + Int32 BThread::Start(HEL::BootInfoHeader* handover, Bool own_stack) { - HEL::HandoverProc err_fn = [](HEL::BootInfoHeader* rcx) -> void { - fb_render_string("BootZ: INVALID IMAGE! ABORTING...", 50, 10, RGB(0xFF, 0xFF, 0xFF)); + HEL::HandoverProc err_fn = [](HEL::BootInfoHeader* rcx) -> Int32 { + fb_render_string("BootZ: Invalid Boot Image...", 50, 10, RGB(0xFF, 0xFF, 0xFF)); ::EFI::Stop(); + + return NO; }; if (!fStartAddress) @@ -182,12 +184,16 @@ namespace Boot fHandover = handover; if (own_stack) + { rt_jump_to_address(fStartAddress, fHandover, &fStack[mib_cast(8) - 1]); + } else { delete[] fStack; - reinterpret_cast<HEL::HandoverProc>(fStartAddress)(fHandover); + return reinterpret_cast<HEL::HandoverProc>(fStartAddress)(fHandover); } + + return NO; } const Char* BThread::GetName() |
