summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/BootKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 19:19:12 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 19:19:12 +0100
commitf3e49a9d6b865e7a3f6361ed88863cd12a5f90f1 (patch)
treebb1ba85c3bc627be09f397f44eb216459f34d902 /Private/NewBoot/BootKit
parent6191833a26e887c2b91ba4ad655297bfe70c97d5 (diff)
HCR-13 : Optimize filesystem operations on UEFI.
- Stream concept, on demand. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit')
-rw-r--r--Private/NewBoot/BootKit/BootKit.hxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx
index 7a45e7e2..68d91deb 100644
--- a/Private/NewBoot/BootKit/BootKit.hxx
+++ b/Private/NewBoot/BootKit/BootKit.hxx
@@ -78,7 +78,7 @@ class BFileReader final {
Int32 &Error() { return mErrorCode; }
VoidPtr Blob() { return mBlob; }
EfiFileProtocol *File() { return mFile; }
- UInt32 &Size() { return mSizeFile; }
+ UInt64 &Size() { return mSizeFile; }
public:
BFileReader &operator=(const BFileReader &) = default;
@@ -90,7 +90,7 @@ class BFileReader final {
CharacterType mPath[kPathLen];
BTextWriter mWriter;
EfiFileProtocol *mFile{nullptr};
- UInt32 mSizeFile{0};
+ UInt64 mSizeFile{0};
};
#define kMaxReadSize (320)
@@ -157,27 +157,21 @@ const UInt32 kRgbBlue = 0x00FF0000;
const UInt32 kRgbBlack = 0x00000000;
const UInt32 kRgbWhite = 0x00FFFFFF;
-/** QT GOP. */
+/** QT GOP and related. */
inline EfiGraphicsOutputProtocol *kGop;
+inline UInt16 kStride;
+inline EfiGUID kGopGuid;
/**
@brief Init the QuickTemplate GUI framework.
*/
inline Void InitQT() noexcept {
- EfiGUID gopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID);
+ kGopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID);
kGop = nullptr;
extern EfiBootServices *BS;
- BS->LocateProtocol(&gopGuid, nullptr, (VoidPtr *)&kGop);
+ BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr *)&kGop);
- UInt16 kStride = 4;
-
- for (int x = 0; x < kGop->Mode->Info->VerticalResolution; ++x) {
- for (int y = 0; y < kGop->Mode->Info->HorizontalResolution; ++y) {
- *((UInt32 *)(kGop->Mode->FrameBufferBase +
- 4 * kGop->Mode->Info->PixelsPerScanLine * x + kStride * y)) =
- RGB(19, 19, 19);
- }
- }
+ kStride = 4;
}