summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/BootKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-04 17:07:33 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-04 17:07:33 +0100
commit9fe3b6e1e2447a11644307e83df2b109b24fe0d1 (patch)
treed6eafa0dee897572554d4519b1a9cd878591254c /Private/NewBoot/BootKit
parenta3d92ea68a74ef3cc3d3c9a34540754869e4d014 (diff)
HCR-11: Support for EFI GOP and SFP.
- SFP stands for Simple Filesystem Protocol, it's always reading through the ESP. - Add GOP for UI code. - Did also patch kernel Virtual Memory code. Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit')
-rw-r--r--Private/NewBoot/BootKit/BootKit.hxx31
1 files changed, 28 insertions, 3 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx
index 05780c53..61ad81f2 100644
--- a/Private/NewBoot/BootKit/BootKit.hxx
+++ b/Private/NewBoot/BootKit/BootKit.hxx
@@ -64,7 +64,7 @@ class BFileReader final {
explicit BFileReader(const CharacterType *path);
~BFileReader();
- HCore::VoidPtr Fetch(EfiHandlePtr ImageHandle, SizeT &Sz);
+ Void Fetch(EfiHandlePtr ImageHandle);
enum {
kOperationOkay,
@@ -76,6 +76,7 @@ class BFileReader final {
};
Int32 &Error() { return mErrorCode; }
+ VoidPtr Blob() { return mBlob; }
public:
BFileReader &operator=(const BFileReader &) = default;
@@ -86,7 +87,6 @@ class BFileReader final {
VoidPtr mBlob{nullptr};
CharacterType mPath[kPathLen];
BTextWriter mWriter;
- BDeviceATA mDevice;
bool mCached{false};
};
@@ -136,6 +136,10 @@ inline UInt32 In32(UInt16 port) {
return value;
}
+extern "C" VoidPtr __cr3();
+
+#endif // __EFI_x86_64__
+
/***********************************************************************************/
/// Framebuffer.
/***********************************************************************************/
@@ -148,4 +152,25 @@ const UInt32 kRgbBlue = 0x00FF0000;
const UInt32 kRgbBlack = 0x00000000;
const UInt32 kRgbWhite = 0x00FFFFFF;
-#endif // __EFI_x86_64__
+/** QT GOP. */
+inline EfiGraphicsOutputProtocol *kGop;
+
+/**
+@brief Init the QuickTemplate GUI framework.
+*/
+inline Void InitQT() noexcept {
+ EfiGUID gopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID);
+ kGop = nullptr;
+
+ extern EfiBootServices *BS;
+
+ BS->LocateProtocol(&gopGuid, nullptr, (VoidPtr *)&kGop);
+
+ for (int w = 0; w < kGop->Mode->Info->VerticalResolution; ++w) {
+ for (int h = 0; h < kGop->Mode->Info->HorizontalResolution; ++h) {
+ *((UInt32 *)(kGop->Mode->FrameBufferBase +
+ 4 * kGop->Mode->Info->PixelsPerScanLine * w + 4 * h)) =
+ RGB(10, 10, 10);
+ }
+ }
+}