From 60cc51ae3bc8de2276a7c7a5f3e7117dc0473c98 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Mon, 26 Aug 2024 18:08:06 +0200 Subject: [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 --- dev/ZBA/Sources/HEL/AMD64/BootMain.cxx | 17 +++++++++++------ dev/ZBA/amd64-efi.make | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'dev/ZBA') 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(&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. diff --git a/dev/ZBA/amd64-efi.make b/dev/ZBA/amd64-efi.make index f5c19801..44253e42 100644 --- a/dev/ZBA/amd64-efi.make +++ b/dev/ZBA/amd64-efi.make @@ -29,7 +29,7 @@ IMG=epm-master-1.img IMG_2=epm-slave.img IMG_3=epm-master-2.img -EMU_FLAGS=-net none -smp 4 -m 8G -M q35 \ +EMU_FLAGS=-net none -m 8G -M q35 \ -bios $(BIOS) -device piix3-ide,id=ide \ -drive id=disk,file=$(IMG),format=raw,if=none \ -device ide-hd,drive=disk,bus=ide.0 -drive \ -- cgit v1.2.3