Print all BIOS information
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user