Expand description

Library that helps you to parse the multiboot information structure (mbi) from Multiboot2-compliant bootloaders, like GRUB. It supports all tags from the specification including full support for the sections of ELF-64. This library is no_std and can be used in a Multiboot2-kernel.

The GNU Multiboot(2) specification aims to provide a standardised method of sharing commonly used information about the host machine at boot time and give the payload, i.e. a kernel, a well defined machine state.

Example

use multiboot2::load;
fn kmain(multiboot_info_ptr: u32) {
    let boot_info = unsafe { load(multiboot_info_ptr as usize).unwrap() };
    println!("{:?}", boot_info);
}

MSRV

The MSRV is 1.52.1 stable.

Structs

A Multiboot 2 Boot Information struct.

This tag contains the name of the bootloader that is booting the kernel.

This tag contains the command line string.

Contains pointer to boot loader image handle.

Contains pointer to boot loader image handle.

EFI Boot Memory Map Descriptor

EFI memory map as per EFI specification.

EFI system table in 32 bit mode

EFI system table in 64 bit mode

A single generic ELF Section.

ELF Section bitflags.

An iterator over some ELF sections.

This tag contains section header table from an ELF kernel.

A framebuffer color descriptor in the palette.

An RGB color type field.

The VBE Framebuffer information Tag.

If the image has relocatable header tag, this tag contains the image’s base physical address.

A memory area entry descriptor.

An iterator over all memory areas

This tag provides an initial host memory map.

An iterator over all module tags.

This tag indicates to the kernel what boot module was loaded along with the kernel image, and where it can be found.

This tag contains a copy of RSDP as defined per ACPI 1.0 specification.

This tag contains a copy of RSDP as defined per ACPI 2.0 or later specification.

The Capabilities field indicates the support of specific features in the graphics environment.

VBE controller information.

The DirectColorModeInfo field describes important characteristics of direct color modes.

A VBE colour field.

This tag contains VBE metadata, VBE controller information returned by the VBE Function 00h and VBE mode information returned by the VBE Function 01h.

A Mode attributes bitfield.

Extended information about a specific VBE display mode from the mode list returned by VBEControlInfo (VBE Function 00h).

The WindowAttributes describe the characteristics of the CPU windowing scheme such as whether the windows exist and are read/writeable, as follows:

Enums

An enum of possible reported region types.

An enum abstraction over raw ELF section types.

The type of framebuffer.

Error type that describes errors while loading/parsing a multiboot2 information structure from a given address.

An enum of possible reported region types. Inside the Multiboot2 spec this is kind of hidden inside the implementation of struct multiboot_mmap_entry.

Possible types of a Tag in the Multiboot2 Information Structure (MBI), therefore the value of the the typ property. The names and values are taken from the example C code at the bottom of the Multiboot2 specification.

The MemoryModel field specifies the general type of memory organization used in modes.

Constants

Magic number that a multiboot2-compliant boot loader will store in eax register right before handoff to the payload (the kernel). This value can be used to check, that the kernel was indeed booted via multiboot2.

Functions

Load the multiboot boot information struct from an address.

Load the multiboot boot information struct from an address at an offset.