From a45872967f07906297782cd04223706cfc326219 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 4 Apr 2024 19:46:31 +0200 Subject: NewBoot: Major bootloader improvements, use __EFI_x86_64__ on EFI platforms, add common device class. Meta: Upate specs and kernel-design. Signed-off-by: Amlal El Mahrouss --- Private/NewBoot/BootKit/BootKit.hxx | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'Private/NewBoot/BootKit/BootKit.hxx') diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index be46f64c..66a9aa67 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -16,11 +16,13 @@ class BFileReader; class BFileRunner; class BVersionString; -#include +#include #include +#ifdef __EFI_x86_64__ #include -#include +#endif // ifdef __EFI_x86_64__ #include +#include using namespace NewOS; @@ -42,6 +44,7 @@ typedef Char CharacterTypeUTF8; */ class BTextWriter final { BTextWriter &_Write(const Long &num); + public: BTextWriter &Write(const Long &num); BTextWriter &Write(const UChar *str); @@ -76,7 +79,8 @@ NewOS::SizeT BSetMem(CharacterTypeUTF16 *src, const CharacterTypeUTF16 byte, */ class BFileReader final { public: - explicit BFileReader(const CharacterTypeUTF16 *path, EfiHandlePtr ImageHandle); + explicit BFileReader(const CharacterTypeUTF16 *path, + EfiHandlePtr ImageHandle); ~BFileReader(); Void ReadAll(); @@ -163,9 +167,7 @@ inline UInt32 In32(UInt16 port) { return value; } -inline Void rt_hlt() { - asm volatile("hlt"); -} +inline Void rt_hlt() { asm volatile("hlt"); } #endif // __EFI_x86_64__ @@ -181,7 +183,8 @@ const UInt32 kRgbBlue = 0x00FF0000; const UInt32 kRgbBlack = 0x00000000; const UInt32 kRgbWhite = 0x00FFFFFF; -/** QT GOP and related. */ +#ifdef __EFI_x86_64__ +/** GOP and related. */ inline EfiGraphicsOutputProtocol *kGop; inline UInt16 kStride; inline EfiGUID kGopGuid; @@ -199,10 +202,18 @@ inline Void InitGOP() noexcept { kStride = 4; } +#endif // __EFI_x86_64__ class BVersionString final { public: static const CharacterTypeUTF16 *Shared() { return BOOTLOADER_VERSION; } }; -EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLength, BootDeviceATA* ataInterface); +/// @brief Writes an EPM partition on the main disk. +/// @param namePart the partition's name +/// @param namePartLength the partition name's length +/// @param bootDev the disk interface. +/// @return +EXTERN_C Boolean boot_write_epm_partition(const Char *namePart, + SizeT namePartLength, + BootDevice *bootDev); -- cgit v1.2.3