summaryrefslogtreecommitdiffhomepage
path: root/dev/ZBA/Sources
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-26 18:08:06 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-26 18:21:47 +0200
commit60cc51ae3bc8de2276a7c7a5f3e7117dc0473c98 (patch)
treecdfd89dd332845a65129422e1160cb2e199b1615 /dev/ZBA/Sources
parent9a86282760e642734bf5b6e233bc3728991fb4e4 (diff)
[IMP] Detect MP support, redirect interrupt to startup routine.
[FIX] Use RCX instead of RAX, move RAX to R9, instead of opposite Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/ZBA/Sources')
-rw-r--r--dev/ZBA/Sources/HEL/AMD64/BootMain.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
index 9cdaf603..6925a05a 100644
--- a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
+++ b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx
@@ -126,23 +126,28 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
handoverHdrPtr->f_GOP.f_PixelFormat = kGop->Mode->Info->PixelFormat;
handoverHdrPtr->f_GOP.f_Size = kGop->Mode->FrameBufferSize;
- auto guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID);
- VoidPtr mp = nullptr;
+ auto guid_mp = EfiGUID(EFI_MP_SERVICES_PROTOCOL_GUID);
+ EfiMpServicesProtocol* mp = nullptr;
extern EfiBootServices* BS;
- BS->LocateProtocol(&guid_mp, nullptr, &mp);
+ BS->LocateProtocol(&guid_mp, nullptr, reinterpret_cast<VoidPtr*>(&mp));
- handoverHdrPtr->f_HardwareTables.f_MPPtr = mp;
+ handoverHdrPtr->f_MultiProcessingEnabled = mp != nullptr;
kHandoverHeader = handoverHdrPtr;
CGInit();
- CGDrawInRegion(CGColor(0xff, 0x3a, 0x3a), handoverHdrPtr->f_GOP.f_Height, handoverHdrPtr->f_GOP.f_Width, 0, 0);
+ CGDrawInRegion(CGColor(0xFF, 0x3A, 0x3A), handoverHdrPtr->f_GOP.f_Height, handoverHdrPtr->f_GOP.f_Width, 0, 0);
CGFini();
+ UInt32 cnt_enabled = 0;
+ UInt32 cnt_disabled = 0;
+
+ mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled);
+
CGDrawString("NEWOSLDR (C) ZKA TECHNOLOGIES.", 10, 10, RGB(0xFF, 0xFF, 0xFF));
- CGDrawString(BVersionString::The(), 20, 10, RGB(0xFF, 0xFF, 0xFF));
+ CGDrawString((cnt_enabled > 1) ? "MULTIPROCESSOR SYSTEM." : "UNIPROCESSOR SYSTEM.", 20, 10, RGB(0xFF, 0xFF, 0xFF));
// Fill handover header now.