diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-03 15:47:49 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-03 15:47:49 +0100 |
| commit | 0ca5d0d92ee326f3deda797403c27090bd0784ab (patch) | |
| tree | 684e50fca73f3d95931726a68a3840af1905c28c /Private/NewBoot | |
| parent | fcccf780db4cdc23858c108c6cde1d08360ee88f (diff) | |
Bootloader add GOP support and working on NewFS support.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot')
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 13 | ||||
| -rw-r--r-- | Private/NewBoot/Source/Entrypoint.cxx | 19 | ||||
| -rw-r--r-- | Private/NewBoot/Source/ImageReader.cxx | 2 |
3 files changed, 32 insertions, 2 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 766749bd..6fdbacaf 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -86,6 +86,7 @@ class BImageReader final { CharacterType mPath[kPathLen]; BTextWriter mWriter; BATADevice mDevice; + bool mCached{false}; }; /***********************************************************************************/ @@ -134,4 +135,16 @@ inline UInt32 In32(UInt16 port) { return value; } +/***********************************************************************************/ +/// Framebuffer. +/***********************************************************************************/ + +#define RGB(R, G, B) (UInt32)(0x##R##G##B) + +const UInt32 kRgbRed = 0x000000FF; +const UInt32 kRgbGreen = 0x0000FF00; +const UInt32 kRgbBlue = 0x00FF0000; +const UInt32 kRgbBlack = 0x00000000; +const UInt32 kRgbWhite = 0x00FFFFFF; + #endif // __EFI_x86_64__ diff --git a/Private/NewBoot/Source/Entrypoint.cxx b/Private/NewBoot/Source/Entrypoint.cxx index 6a778143..ff118f8a 100644 --- a/Private/NewBoot/Source/Entrypoint.cxx +++ b/Private/NewBoot/Source/Entrypoint.cxx @@ -7,6 +7,7 @@ * ======================================================== */ +#include "EFIKit/EFI.hxx" #define __BOOTLOADER__ 1 #include <BootKit/BootKit.hxx> @@ -14,11 +15,25 @@ #include <KernelKit/PE.hpp> #include <NewKit/Ref.hpp> -// don't remove EfiGUID, it will call initializer_list! +STATIC Void DrawBackground() { + EfiGUID gopGuid = EfiGUID(EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID); + EfiGraphicsOutputProtocol* gop = nullptr; -EFI_EXTERN_C int EfiMain(EfiHandlePtr ImageHandle, + BS->LocateProtocol(&gopGuid, nullptr, (void**)&gop); + + for (int w = 0; w < gop->Mode->Info->VerticalResolution; ++w) { + for (int h = 0; h < gop->Mode->Info->HorizontalResolution; ++h) { + *((UInt32*)(gop->Mode->FrameBufferBase + + 4 * gop->Mode->Info->PixelsPerScanLine * w + 4 * h)) = + RGB(20, 20, 20); + } + } +} + +EFI_EXTERN_C Int EfiMain(EfiHandlePtr ImageHandle, EfiSystemTable* SystemTable) { InitEFI(SystemTable); + DrawBackground(); BTextWriter writer; diff --git a/Private/NewBoot/Source/ImageReader.cxx b/Private/NewBoot/Source/ImageReader.cxx index b714c21f..98e025a8 100644 --- a/Private/NewBoot/Source/ImageReader.cxx +++ b/Private/NewBoot/Source/ImageReader.cxx @@ -66,5 +66,7 @@ HCore::VoidPtr BImageReader::Fetch(SizeT &size) { /// get file catalog with mPath inside it. + this->mCached = true; + return nullptr; } |
