diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-07 09:39:07 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-07 09:39:07 +0200 |
| commit | eb076dbf3754f44efdda926e1cc55a5c86136f5c (patch) | |
| tree | 6391d97d885dcf6d85f8824aec29c60c4dea2d78 /Boot/BootKit | |
| parent | e477d85ffea45a92aea7a2942bdfb9240fed80bc (diff) | |
MHR-36: IMP: Add ProgramLoader class, *_cast macros and patching capability.
FIX: Device constructor marked as explicit.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Boot/BootKit')
| -rw-r--r-- | Boot/BootKit/BootKit.hxx | 1 | ||||
| -rw-r--r-- | Boot/BootKit/Device.hxx | 2 | ||||
| -rw-r--r-- | Boot/BootKit/ProgramLoader.hxx | 41 |
3 files changed, 43 insertions, 1 deletions
diff --git a/Boot/BootKit/BootKit.hxx b/Boot/BootKit/BootKit.hxx index c83b3c63..850f3896 100644 --- a/Boot/BootKit/BootKit.hxx +++ b/Boot/BootKit/BootKit.hxx @@ -135,6 +135,7 @@ private: BTextWriter mWriter; EfiFileProtocol* mFile{nullptr}; UInt64 mSizeFile{0}; + EfiFileProtocol* mRootFs; }; typedef UInt8* BlobType; diff --git a/Boot/BootKit/Device.hxx b/Boot/BootKit/Device.hxx index 234ab6bd..2c6ddd6b 100644 --- a/Boot/BootKit/Device.hxx +++ b/Boot/BootKit/Device.hxx @@ -14,7 +14,7 @@ using namespace Kernel; class Device { public: - Device() = default; + explicit Device() = default; virtual ~Device() = default; NEWOS_MOVE_DEFAULT(Device); diff --git a/Boot/BootKit/ProgramLoader.hxx b/Boot/BootKit/ProgramLoader.hxx new file mode 100644 index 00000000..9e14710c --- /dev/null +++ b/Boot/BootKit/ProgramLoader.hxx @@ -0,0 +1,41 @@ +/* ------------------------------------------- + + Copyright Zeta Electronics Corporation + +------------------------------------------- */ + +#pragma once + +#include <KernelKit/PE.hxx> +#include <KernelKit/MSDOS.hxx> +#include <FirmwareKit/Handover.hxx> + +namespace Boot +{ + using namespace Kernel; + + class ProgramLoader; + + /// @brief Program loader class + /// @package nl.zeta.boot.api + class ProgramLoader final + { + public: + explicit ProgramLoader() = delete; + ~ProgramLoader() = default; + + explicit ProgramLoader(Kernel::VoidPtr blob); + + ProgramLoader& operator=(const ProgramLoader&) = default; + ProgramLoader(const ProgramLoader&) = default; + + void Start(HEL::HandoverInformationHeader* handover); + const char* GetName(); + void SetName(const char* name); + + private: + Char fBlobName[255]; + VoidPtr fStartAddress{nullptr}; + VoidPtr fBlob{nullptr}; + }; +} // namespace Kernel
\ No newline at end of file |
