9#include <system/multiboot.h>
14using namespace MaxOS::system;
15using namespace MaxOS::memory;
16using namespace MaxOS::common;
25: start_address(address)
29 ASSERT(magic == MULTIBOOT2_BOOTLOADER_MAGIC,
"Multiboot2 Bootloader Not Detected");
40 case MULTIBOOT_TAG_TYPE_END:
44 case MULTIBOOT_TAG_TYPE_FRAMEBUFFER:
48 case MULTIBOOT_TAG_TYPE_BASIC_MEMINFO:
52 case MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME:
57 case MULTIBOOT_TAG_TYPE_BOOTDEV:
63 case MULTIBOOT_TAG_TYPE_MMAP:
66 if (m_mmap ==
nullptr)
71 case MULTIBOOT_TAG_TYPE_ACPI_OLD:
76 case MULTIBOOT_TAG_TYPE_ACPI_NEW:
80 case MULTIBOOT_TAG_TYPE_MODULE:
82 module = (multiboot_tag_module*) tag;
93Multiboot::~Multiboot() =
default;
101 return m_framebuffer;
110 return m_basic_meminfo;
119 return m_bootloader_name;
160 if (
tag->type != MULTIBOOT_TAG_TYPE_MODULE &&
tag->type != MULTIBOOT_TAG_TYPE_MMAP)
164 auto*
module = (struct multiboot_tag_module*) tag;
static Logger DEBUG()
Gets active logger set to DEBUG level.
Stores the left, top, width and height of a rectangle.
static void * to_lower_region(uintptr_t virtual_address)
Converts a virtual address to a lower region address if it is in the higher region using the higher h...
bool is_reserved(multiboot_uint64_t address) const
Check if an address is reserved by a multiboot module.
unsigned long end_address
The end address of the multiboot info struct.
multiboot_tag * start_tag() const
multiboot_tag_basic_meminfo * basic_meminfo()
Get the basic memory info tag.
multiboot_tag_string * bootloader_name()
Get the bootloader name tag.
multiboot_tag_framebuffer * framebuffer()
Get the framebuffer tag.
Multiboot(unsigned long address, unsigned long magic)
Constructor for the Multiboot class. Parses the multiboot info struct and loads the tags.
multiboot_tag_old_acpi * old_acpi()
Get the old ACPI tag.
multiboot_tag_new_acpi * new_acpi()
Get the new ACPI tag.
multiboot_tag_mmap * mmap()
Get the module tag.
unsigned long start_address
The start address of the multiboot info struct.
Defines a Logger class for logging messages with different severity levels to multiple output streams...
#define ASSERT(condition, format,...)
If the specified condition is not met then the kernel will crash with the specified message.
Defines a MemoryManager class for handling memory allocation and deallocation.
constexpr uint64_t HIGHER_HALF_KERNEL_OFFSET
Where the kernel is mapped in higher half memory.
A tag containing basic (legacy) memory information.
A tag containing information about the device the OS image was loaded from.
A tag containing information about the framebuffer.
A tag containing the collection of memory map entries that outline the memory layout.
A tag containing information about a loaded module.
A tag containing information about the new ACPI RSDP.
A tag containing information about the old ACPI RSDP.
A tag containing a null-terminated string.
char string[0]
The string.
Common header for all multiboot info tags.