39 for (
const auto digit : std::string_view {__DATE__}.substr(7)) {
40 year = (year * 10_u32) +
static_cast<igros_dword_t>(digit -
'0');
51 if (0_u32 == pointer) {
73 static_cast<const void*
>(
this)
87 BIOS memory map: [ %c ]
95 Bootloader name: [ %c ]
131 No memory info provided...
152 R
"multiboot( [%u] 0x%016llx - 0x%016llx)multiboot",
154 static_cast<unsigned long long>(entry.address),
155 static_cast<unsigned long long>(entry.address) + entry.length
162 No memory map provided...
178 if ((
nullptr == config) || (
nullptr == mode)) [[unlikely]] {
181 VBE info is not directly mapped...
187 const auto*
const oem {vbeString(config->oem)};
189 const auto*
const vendor {vbeString(config->vendor)};
191 const auto*
const product {vbeString(config->productName)};
193 const auto*
const revision {
vbeString(config->productRev)};
203 Current mode: #%d (%dx%d, %dbpp, 0x%08x)
206 config->signature[0],
207 config->signature[1],
208 config->signature[2],
209 config->signature[3],
210 (static_cast<igros_dword_t>(config->version) >> 8) & 0x00FF_u32,
212 (
nullptr != oem) ? oem :
"<none>",
213 (
nullptr != vendor) ? vendor :
"<none>",
214 (
nullptr != product) ? product :
"<none>",
215 (
nullptr != revision) ? revision :
"<none>",
226 No VBE info provided...
237 const auto* fbTypeName {
""};
242 fbTypeName =
"Indexed";
256 Current mode: (%dx%d, %dbpp, %d, %s)
265 static_cast<unsigned long long>(
fbAddress),
272 No FrameBuffer info provided...
290 Author: Igor Baklykov (c) %u - %u
static constexpr auto text() noexcept -> const char *
Kernel version to string.
static auto string(const phys_t phys) noexcept -> const char *
String at physical memory (nullptr if not directly mapped up to null terminator).
static auto pointer(const phys_t phys, const phys_t size=sizeof(T)) noexcept -> T *
Pointer to physical memory (nullptr if range is not directly mapped).
std::uint32_t igros_dword_t
32-bit unsigned integer
Kernel text print functions.
void kprintf(const char *const format,...) noexcept
Kernel printf function (arguments are checked against format at compile time).
igros_quad_t phys_t
Physical address (64-bit: physical memory may lie above 4 GB).
constexpr auto BUILD_YEAR
Build year (DATE is "Mmm dd yyyy").
auto vbeString(const igros_dword_t pointer) noexcept -> const char *
VBE string at real mode segment:offset pointer (nullptr if not provided or not directly mapped).
Multiboot 1 information passed by the bootloader.
auto check(const igros_dword_t signature) noexcept -> bool
Multiboot 1 header signature check function.
auto hasInfoBootDevice() const noexcept -> bool
Multiboot contains valid boot device info.
void printVBEInfo() const noexcept
Print multiboot VBE info.
auto hasInfoConfig() const noexcept -> bool
Multiboot contains valid config table info.
igros_quad_t fbAddress
Multiboot FB address.
igros_dword_t mmapAddr
Multiboot memory map start address.
igros_dword_t vbeControlInfo
Multiboot VBE control info.
igros_dword_t memLow
Multiboot bios memory low info.
void printFBInfo() const noexcept
Print multiboot FB info.
igros_dword_t fbPitch
Multiboot FB pitch.
klib::kFlags< flags_t > flags
Multiboot present features flag.
igros_byte_t fbBpp
Multiboot FB bpp.
auto hasInfoAOUT() const noexcept -> bool
Multiboot contains valid A.OUT sections info.
igros_byte_t fbType
Multiboot FB type.
auto hasInfoAPM() const noexcept -> bool
Multiboot contains valid APM table info.
auto loaderName() const noexcept -> const char *
Get multiboot bootloader name.
auto hasInfoELF() const noexcept -> bool
Multiboot contains valid ELF sections info.
auto hasInfoFrameBuffer() const noexcept -> bool
Multiboot contains valid FrameBuffer info.
void printMemMap() const noexcept
Print multiboot memory map.
igros_dword_t mmapLength
Multiboot memory map length.
auto hasInfoCommandLine() const noexcept -> bool
Multiboot contains valid kernel command line info.
igros_word_t vbeModeCurrent
Multiboot VBE current mode.
void printHeader() const noexcept
Print kernel header.
auto hasInfoMemory() const noexcept -> bool
Multiboot contains valid memory info.
auto commandLine() const noexcept -> const char *
Get multiboot command line.
auto hasInfoMemoryMap() const noexcept -> bool
Multiboot contains valid memory map info.
igros_dword_t vbeModeInfo
Multiboot VBE mode info.
void test(const igros_dword_t magic) const noexcept
Test multiboot.
igros_dword_t fbHeight
Multiboot FB height.
auto memoryMap() const noexcept -> memoryMap_t
Get multiboot memory map (empty if not provided).
igros_dword_t fbWidth
Multiboot FB width.
void printMemInfo() const noexcept
Print multiboot memory info.
auto hasInfoVBE() const noexcept -> bool
Multiboot contains valid VBE info.
auto hasInfoBootloaderName() const noexcept -> bool
Multiboot contains valid bootloader name info.
void printFlags() const noexcept
Print multiboot flags.
auto hasInfoDrives() const noexcept -> bool
Multiboot contains valid drives info.
igros_dword_t memHigh
Multiboot bios memory high info.