[bootloader] Made bootloader Upsilon-aware

This commit is contained in:
M4x1m3
2022-03-01 20:30:08 +01:00
parent 370eb14a04
commit 209428ca9d
3 changed files with 20 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ void Interface::drawImage(KDContext* ctx, const Image* image, int offset) {
void Interface::draw() {
KDContext * ctx = KDIonContext::sharedContext();
ctx->fillRect(KDRect(0,0,320,240), KDColorBlack);
drawImage(ctx, ImageStore::Computer, 70);
drawImage(ctx, ImageStore::Cable, 172);
@@ -61,7 +62,10 @@ void Interface::draw() {
Slot slot = slots[i];
if (slot.kernelHeader()->isValid() && slot.userlandHeader()->isValid()) {
if (slot.userlandHeader()->isOmega()) {
if (slot.userlandHeader()->isOmega() && slot.userlandHeader()->isUpsilon()) {
ctx->drawString("Upsilon", KDPoint(56, i*13), KDFont::SmallFont, KDColorWhite, KDColorBlack);
ctx->drawString(slot.userlandHeader()->upsilonVersion(), KDPoint(112, i*13), KDFont::SmallFont, KDColorWhite, KDColorBlack);
} else if (slot.userlandHeader()->isOmega()) {
ctx->drawString("Omega", KDPoint(56, i*13), KDFont::SmallFont, KDColorWhite, KDColorBlack);
ctx->drawString(slot.userlandHeader()->omegaVersion(), KDPoint(112, i*13), KDFont::SmallFont, KDColorWhite, KDColorBlack);
} else {

View File

@@ -22,4 +22,12 @@ const char * UserlandHeader::omegaVersion() const {
return m_omegaVersion;
}
const bool UserlandHeader::isUpsilon() const {
return m_ups_header == UpsilonMagic && m_ups_footer == UpsilonMagic;
}
const char * UserlandHeader::upsilonVersion() const {
return m_UpsilonVersion;
}
}

View File

@@ -13,11 +13,14 @@ public:
const bool isValid() const;
const bool isOmega() const;
const char * omegaVersion() const;
const bool isUpsilon() const;
const char * upsilonVersion() const;
private:
UserlandHeader();
constexpr static uint32_t Magic = 0xDEC0EDFE;
constexpr static uint32_t OmegaMagic = 0xEFBEADDE;
constexpr static uint32_t UpsilonMagic = 0x55707369;
uint32_t m_header;
const char m_expectedEpsilonVersion[8];
void * m_storageAddressRAM;
@@ -33,6 +36,10 @@ private:
const char m_omegaVersion[16];
const volatile char m_username[16];
uint32_t m_ohm_footer;
uint32_t m_ups_header;
const char m_UpsilonVersion[16];
uint32_t m_osType;
uint32_t m_ups_footer;
};
extern const UserlandHeader* s_userlandHeaderA;