summaryrefslogtreecommitdiffhomepage
path: root/Boot
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-17 17:21:57 +0200
committerAmlal <amlal@zka.com>2024-07-17 17:21:57 +0200
commit08ee53082f5c4d0f730336a821c154515c76f4de (patch)
tree01b8d5593929acae9651651a7ef59f12f58c1066 /Boot
parent7b8f6b0644e16614ebb07983ff2e8809581f8350 (diff)
[MHR-36] Rendering QR code when user is using AMD64 release of newosldr.
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Boot')
-rw-r--r--Boot/BootKit/Vendor/Qr.hxx8
-rw-r--r--Boot/Sources/HEL/AMD64/BootMain.cxx30
2 files changed, 15 insertions, 23 deletions
diff --git a/Boot/BootKit/Vendor/Qr.hxx b/Boot/BootKit/Vendor/Qr.hxx
index 3616aaac..d1820330 100644
--- a/Boot/BootKit/Vendor/Qr.hxx
+++ b/Boot/BootKit/Vendor/Qr.hxx
@@ -1,6 +1,7 @@
#ifndef QR_HXX
#define QR_HXX
+#include "BootKit/BootKit.hxx"
extern "C" {
#include <math.h>
#include <stddef.h>
@@ -369,6 +370,11 @@ namespace qr
if (!this->status)
return false; // it may be invalid.
+ BTextWriter writer;
+ writer.Write(L"Printing QR-code...\r");
+
+ CGInit();
+
for (int y = 0; y < (this->side_size()); ++y)
{
for (int x = 0; x < (this->side_size()); ++x)
@@ -380,6 +386,8 @@ namespace qr
}
}
+ CGFini();
+
return false;
}
diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx
index 13c887ff..51f8e8cf 100644
--- a/Boot/Sources/HEL/AMD64/BootMain.cxx
+++ b/Boot/Sources/HEL/AMD64/BootMain.cxx
@@ -58,7 +58,7 @@ STATIC Void InitVideoFB() noexcept
for (SizeT i = 0; i < kGop->Mode->MaxMode; ++i)
{
EfiGraphicsOutputProtocolModeInformation* infoPtr = nullptr;
- UInt32 sz = 0U;
+ UInt32 sz = 0U;
kGop->QueryMode(kGop, i, &sz, &infoPtr);
@@ -69,7 +69,6 @@ STATIC Void InitVideoFB() noexcept
break;
}
}
-
}
/// @brief check the BootDevice if suitable.
@@ -98,14 +97,6 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
.Write(BVersionString::The())
.Write("\r");
-#ifndef __DEBUG__
- writer.Write(L"\rnewosldr: AMD64 is only supported in debug mode.\r");
-
- EFI::Stop();
-
- CANT_REACH();
-#endif
-
UInt32* MapKey = new UInt32();
UInt32* SizePtr = new UInt32();
EfiMemoryDescriptor* Descriptor = nullptr;
@@ -158,20 +149,13 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle,
kHandoverHeader = handoverHdrPtr;
- // Start drawing the 'zka' icon.
-
- CGInit();
-
- CGDrawInRegion(cCGClearClr, handoverHdrPtr->f_GOP.f_Height,
- handoverHdrPtr->f_GOP.f_Width, 0, 0);
-
- CGFini();
-
- CGDrawBitMapInRegion(NewBoot, NEWBOOT_HEIGHT, NEWBOOT_WIDTH,
- (handoverHdrPtr->f_GOP.f_Width - NEWBOOT_WIDTH) / 2,
- (handoverHdrPtr->f_GOP.f_Height - NEWBOOT_HEIGHT) / 2);
+ // check if we are in AMD64
+#if defined(__NEWOS_AMD64__)
+ writer.Write(L"\rnewosldr: AMD64 support is not official.\r");
+ EFI::ThrowError(L"Beta-Software", L"Beta Software.");
+#endif
- CGFini();
+ // get memory map.
BS->GetMemoryMap(SizePtr, Descriptor, MapKey, SzDesc, RevDesc);