22#ifndef MULTIBOOT_HEADER
23#define MULTIBOOT_HEADER 1
26#define MULTIBOOT_SEARCH 32768
27#define MULTIBOOT_HEADER_ALIGN 8
30#define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
33#define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
36#define MULTIBOOT_MOD_ALIGN 0x00001000
39#define MULTIBOOT_INFO_ALIGN 0x00000008
43#define MULTIBOOT_TAG_ALIGN 8
44#define MULTIBOOT_TAG_TYPE_END 0
45#define MULTIBOOT_TAG_TYPE_CMDLINE 1
46#define MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME 2
47#define MULTIBOOT_TAG_TYPE_MODULE 3
48#define MULTIBOOT_TAG_TYPE_BASIC_MEMINFO 4
49#define MULTIBOOT_TAG_TYPE_BOOTDEV 5
50#define MULTIBOOT_TAG_TYPE_MMAP 6
51#define MULTIBOOT_TAG_TYPE_VBE 7
52#define MULTIBOOT_TAG_TYPE_FRAMEBUFFER 8
53#define MULTIBOOT_TAG_TYPE_ELF_SECTIONS 9
54#define MULTIBOOT_TAG_TYPE_APM 10
55#define MULTIBOOT_TAG_TYPE_EFI32 11
56#define MULTIBOOT_TAG_TYPE_EFI64 12
57#define MULTIBOOT_TAG_TYPE_SMBIOS 13
58#define MULTIBOOT_TAG_TYPE_ACPI_OLD 14
59#define MULTIBOOT_TAG_TYPE_ACPI_NEW 15
60#define MULTIBOOT_TAG_TYPE_NETWORK 16
61#define MULTIBOOT_TAG_TYPE_EFI_MMAP 17
62#define MULTIBOOT_TAG_TYPE_EFI_BS 18
63#define MULTIBOOT_TAG_TYPE_EFI32_IH 19
64#define MULTIBOOT_TAG_TYPE_EFI64_IH 20
65#define MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR 21
67#define MULTIBOOT_HEADER_TAG_END 0
68#define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1
69#define MULTIBOOT_HEADER_TAG_ADDRESS 2
70#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS 3
71#define MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS 4
72#define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5
73#define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6
74#define MULTIBOOT_HEADER_TAG_EFI_BS 7
75#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI32 8
76#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9
77#define MULTIBOOT_HEADER_TAG_RELOCATABLE 10
79#define MULTIBOOT_ARCHITECTURE_I386 0
80#define MULTIBOOT_ARCHITECTURE_MIPS32 4
81#define MULTIBOOT_HEADER_TAG_OPTIONAL 1
83#define MULTIBOOT_LOAD_PREFERENCE_NONE 0
84#define MULTIBOOT_LOAD_PREFERENCE_LOW 1
85#define MULTIBOOT_LOAD_PREFERENCE_HIGH 2
87#define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1
88#define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2
92typedef unsigned char multiboot_uint8_t;
93typedef unsigned short multiboot_uint16_t;
94typedef unsigned int multiboot_uint32_t;
95typedef unsigned long long multiboot_uint64_t;
212#define MULTIBOOT_MEMORY_AVAILABLE 1
213#define MULTIBOOT_MEMORY_RESERVED 2
214#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
215#define MULTIBOOT_MEMORY_NVS 4
216#define MULTIBOOT_MEMORY_BADRAM 5
329#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
330#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
331#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
512namespace MaxOS::system {
529 Multiboot(
unsigned long address,
unsigned long magic);
544 [[nodiscard]]
bool is_reserved(multiboot_uint64_t address)
const;
Parses and provides access to Multiboot 2 information.
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_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.
A structure representing a color in RGB format.
multiboot_uint8_t green
The amount of green.
multiboot_uint8_t red
The amount of red.
multiboot_uint8_t blue
The amount of blue.
An entry in the memory map containing information about a region of memory.
multiboot_uint32_t zero
Must be zero.
multiboot_uint64_t addr
The starting address of the memory region.
multiboot_uint64_t len
The length of the memory region.
multiboot_uint32_t type
The type of memory region.
A tag containing information about the Advanced Power Management (APM) BIOS.
multiboot_uint16_t dseg
The data segment.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint16_t dseg_len
The length of the data segment.
multiboot_uint16_t version
The APM version.
multiboot_uint16_t flags
The flags.
multiboot_uint16_t cseg_len
The length of the code segment.
multiboot_uint16_t cseg
The code segment.
multiboot_uint16_t cseg_16_len
The length of the 16-bit code segment.
multiboot_uint16_t cseg_16
The 16-bit code segment.
multiboot_uint32_t offset
The offset.
A tag containing basic (legacy) memory information.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t mem_lower
The amount of lower memory in KB.
multiboot_uint32_t mem_upper
The amount of upper memory in KB (upper memory is the memory above 1MB, below 4GB)
A tag containing information about the device the OS image was loaded from.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t biosdev
The BIOS disk device the OS image was loaded from.
multiboot_uint32_t slice
The slice number of the disk device.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t part
The partition number of the disk device.
A tag containing the 32bit EFI image handle.
multiboot_uint32_t pointer
Where the EFI image handle is located.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing information about the EFI 32-bit system table.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t pointer
Where the EFI system table is located.
multiboot_uint32_t type
*copydoc multiboot_tag::type
A tag containing the 64bit EFI image handle.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint64_t pointer
Where the EFI image handle is located.
multiboot_uint32_t type
*copydoc multiboot_tag::type
A tag containing information about the EFI 64-bit system table.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint64_t pointer
Where the EFI system table is located.
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing the EFI memory map.
multiboot_uint8_t efi_mmap[0]
The EFI memory map.
multiboot_uint32_t descr_vers
The version of the EFI memory descriptor.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t descr_size
The size of each EFI memory descriptor.
A tag containing information about the ELF sections of the OS image.
char sections[0]
The section headers.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t shndx
The section header string table index.
multiboot_uint32_t entsize
The size of each section header.
multiboot_uint32_t num
The number of section headers.
Common header for framebuffer tags.
multiboot_uint32_t framebuffer_width
The width of the framebuffer in pixels.
multiboot_uint8_t framebuffer_bpp
The number of bits per pixel.
multiboot_uint32_t framebuffer_height
The height of the framebuffer in pixels.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint16_t reserved
2 bytes reserved
multiboot_uint64_t framebuffer_addr
The physical address of the framebuffer.
multiboot_uint32_t framebuffer_pitch
The number of bytes per horizontal line.
multiboot_uint8_t framebuffer_type
The type of framebuffer.
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing information about the framebuffer.
multiboot_uint8_t framebuffer_blue_field_position
The position of the blue field.
multiboot_uint16_t framebuffer_palette_num_colors
The number of colors in the palette.
multiboot_uint8_t framebuffer_red_mask_size
The size of the red mask.
multiboot_uint8_t framebuffer_blue_mask_size
The size of the blue mask.
struct multiboot_tag_framebuffer_common common
*copydoc multiboot_tag_framebuffer_common
multiboot_uint8_t framebuffer_red_field_position
The position of the red field.
multiboot_uint8_t framebuffer_green_field_position
The position of the green field.
multiboot_uint8_t framebuffer_green_mask_size
The size of the green mask.
A tag containing the load base address of the OS image.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t load_base_addr
Where the OS image was loaded.
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing the collection of memory map entries that outline the memory layout.
multiboot_uint32_t size
*copydoc multiboot_tag::size
struct multiboot_mmap_entry entries[0]
The memory map entries.
multiboot_uint32_t entry_size
The size of each entry.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t entry_version
The version of the entry structure (must be 0)
A tag containing information about a loaded module.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t mod_end
The ending address of the module.
char cmdline[0]
The args passed to the module.
multiboot_uint32_t mod_start
The starting address of the module.
A tag containing information about the network booting.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint8_t dhcpack[0]
The DHCP ACK packet.
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing information about the new ACPI RSDP.
multiboot_uint8_t rsdp[0]
The RSDP structure.
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint32_t type
*copydoc multiboot_tag::type
A tag containing information about the old ACPI RSDP.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint8_t rsdp[0]
The RSDP structure.
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing information about the System Management BIOS (SMBIOS)
multiboot_uint8_t major
The major version of SMBIOS.
multiboot_uint8_t reserved[6]
6 bytes reserved
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t size
*copydoc multiboot_tag::size
multiboot_uint8_t minor
The minor version of SMBIOS.
multiboot_uint8_t tables[0]
The SMBIOS tables.
A tag containing a null-terminated string.
multiboot_uint32_t type
*copydoc multiboot_tag::type
multiboot_uint32_t size
*copydoc multiboot_tag::size
A tag containing information about the VESA BIOS Extensions (VBE)
multiboot_uint32_t size
*copydoc multiboot_tag::size
struct multiboot_vbe_info_block vbe_control_info
The VBE control information.
multiboot_uint16_t vbe_interface_off
The offset of the VBE interface.
struct multiboot_vbe_mode_info_block vbe_mode_info
The VBE mode information.
multiboot_uint16_t vbe_mode
The VBE mode.
multiboot_uint16_t vbe_interface_len
The length of the VBE interface.
multiboot_uint16_t vbe_interface_seg
The segment of the VBE interface.
multiboot_uint32_t type
*copydoc multiboot_tag::type
Common header for all multiboot info tags.
multiboot_uint32_t size
The size of the tag including this header.
multiboot_uint32_t type
The type of the tag.
A tag containing information about the VESA BIOS Extensions (VBE)
multiboot_uint8_t external_specification[512]
The VBE information block as defined by the VBE standard.
A tag containing information about a specific VBE video mode.
multiboot_uint8_t external_specification[256]
The VBE mode information block as defined by the VBE standard.