Print all BIOS information

This commit is contained in:
jaby 2024-03-30 14:42:32 -05:00
parent 58eaa8348a
commit f8f6322363
3 changed files with 15 additions and 6 deletions

View File

@ -52,15 +52,16 @@ namespace BIOSInfo {
const BIOSStringOffset bios_str_offset;
const char*const display_str;
FontSlider font_slider;
} BIOSStringInfo[3] = {
} BIOSStringInfo[] = {
{.bios_str_offset = &SysCall::BIOSVersion::kernel_maker, .display_str = "Kernel-Maker"},
{.bios_str_offset = &SysCall::BIOSVersion::version_str, .display_str = "Version"},
{.bios_str_offset = &SysCall::BIOSVersion::gui_version, .display_str = "GUI-Version"},
{.bios_str_offset = &SysCall::BIOSVersion::copyright, .display_str = "Copyright"}
{.bios_str_offset = &SysCall::BIOSVersion::copyright, .display_str = "Copyright"},
};
static GPU::TILE::Linked border_tiles[2] = {
Make::TILE(Make::AreaI16(0, 0, TextOffset.x, GPU::Display::Height), GPU::Color24::Black()).linked(),
Make::TILE(Make::AreaI16(GPU::Display::Width - TextOffset.x, 0, TextOffset.x, GPU::Display::Height), GPU::Color24::Black()).linked()
Make::TILE(Make::AreaI16(0, 0, TextOffset.x, GPU::Display::Height - 32), GPU::Color24::Black()).linked(),
Make::TILE(Make::AreaI16(GPU::Display::Width - TextOffset.x, 0, TextOffset.x, GPU::Display::Height - 32), GPU::Color24::Black()).linked()
};
static SysCall::BIOSVersion setup() {

View File

@ -62,6 +62,7 @@ namespace JabyEngine {
uint16_t year;
} date;
const char* kernel_maker;
const char* version_str;
const char* gui_version;
const char* copyright;
};

View File

@ -5,6 +5,14 @@
namespace JabyEngine {
namespace SysCall {
BIOSVersion get_bios_version() {
static const auto get_version_str = [](const char* kernel_maker) -> const char* {
const char* start = kernel_maker + (strlen(kernel_maker) + 1);
while(*start == 0) {
start++;
}
return start;
};
BIOSVersion version;
const auto date_bcd = *reinterpret_cast<uint32_t*>(0xBFC00100);
@ -13,10 +21,9 @@ namespace JabyEngine {
version.date.month = from_bcd(static_cast<uint8_t>((date_bcd >> 8) & 0xFF));
version.date.year = from_bcd(static_cast<uint16_t>(date_bcd >> 16));
version.kernel_maker = reinterpret_cast<const char*>(0xBFC00108);
version.version_str = get_version_str(version.kernel_maker);
version.gui_version = reinterpret_cast<const char*>(0xBFC7FF32);
version.copyright = version.gui_version + (strlen(version.gui_version) + 1);
printf(">>> \"%s\"\n", version.copyright);
return version;
}
}