diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 23:03:30 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 23:03:30 +0100 |
| commit | 71a35e96d5597fca8882e96976e9461dc3dd85e9 (patch) | |
| tree | 9b5964cad0edefd00cb2a4eb3842c6e1b428e6bd /Private/NewBoot/BootKit | |
| parent | df44a789fc90497325ba91be515c02145ae39142 (diff) | |
Bootloader: have been working on unifing the BTextWriter class.
Next commit will be about the BFileReader class. It's going to read files
from EFI.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit')
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 70607a9c..9c0ec863 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -18,7 +18,8 @@ using namespace HCore; -typedef void *PEFImage; +typedef VoidPtr PEFImagePtr; +typedef VoidPtr PEImagePtr; enum { kSegmentCode = 2, @@ -26,50 +27,27 @@ enum { kSegmentBss = 6, }; +typedef wchar_t CharacterType; + /** * @brief BootKit Text Writer class * Writes to VGA. */ -class BKTextWriter final { - volatile UInt16 *fWhere{nullptr}; - +class BTextWriter final { public: - void WriteString(const char *c, unsigned char forecolour, - unsigned char backcolour, int x, int y); + void WriteString(const CharacterType *str); - void WriteCharacter(char c, unsigned char forecolour, - unsigned char backcolour, int x, int y); + void WriteCharacter(CharacterType c); public: - BKTextWriter() = default; - ~BKTextWriter() = default; + BTextWriter() = default; + ~BTextWriter() = default; public: - BKTextWriter &operator=(const BKTextWriter &) = default; - BKTextWriter(const BKTextWriter &) = default; -}; - -enum { - kBlack, - kBlue, - kGreen, - kCyan, - kRed, - kMagenta, - kBrown, - kLightGray, - kDarkGray, - kLightBlue, - kLightGreen, - kLightCyan, - kLightRed, - kLightMagenta, - kYellow, - kWhite, + BTextWriter &operator=(const BTextWriter &) = default; + BTextWriter(const BTextWriter &) = default; }; -#define BK_START_KERNEL (0x8000000) - HCore::SizeT BStrLen(const char *ptr); HCore::SizeT BSetMem(char *src, const char byte, const HCore::SizeT len); |
