diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 17:59:15 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 17:59:15 +0100 |
| commit | 1be243700efc9e36060c5fb65c951d5db6b98e94 (patch) | |
| tree | 2f57d5092f4de4798e80e80b6dd29f984edb7683 /Private/NewBoot/BootKit/BootKit.hxx | |
| parent | 1d3bed385c9666db5b1803ee8e02a2c4fdcc9f29 (diff) | |
Add ROADMAP details, add EFI Library for bootloader.
Add assignee to code in MailMap.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit/BootKit.hxx')
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx new file mode 100644 index 00000000..70607a9c --- /dev/null +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -0,0 +1,81 @@ +/* + * ======================================================== + * + * NewBoot + * Copyright 2024 Mahrouss Logic, all rights reserved. + * + * ======================================================== + */ + +/***********************************************************************************/ +/// @file Boot.hxx +/// @brief Bootloader API. +/***********************************************************************************/ + +#pragma once + +#include <NewKit/Defines.hpp> + +using namespace HCore; + +typedef void *PEFImage; + +enum { + kSegmentCode = 2, + kSegmentData = 4, + kSegmentBss = 6, +}; + +/** + * @brief BootKit Text Writer class + * Writes to VGA. + */ +class BKTextWriter final { + volatile UInt16 *fWhere{nullptr}; + + public: + void WriteString(const char *c, unsigned char forecolour, + unsigned char backcolour, int x, int y); + + void WriteCharacter(char c, unsigned char forecolour, + unsigned char backcolour, int x, int y); + + public: + BKTextWriter() = default; + ~BKTextWriter() = 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, +}; + +#define BK_START_KERNEL (0x8000000) + +HCore::SizeT BStrLen(const char *ptr); +HCore::SizeT BSetMem(char *src, const char byte, const HCore::SizeT len); + +/***********************************************************************************/ +/// Include other APIs. +/***********************************************************************************/ + +#include <BootKit/Processor.hxx> +#include <BootKit/Protocol.hxx> |
