multiboot2-header-0.1.0 has been yanked.
multiboot2-header
Rust library with type definitions and parsing functions for Multiboot2 headers.
This library is no_std and can be used in bootloaders.
What this library is good for:
- writing a small binary which writes you a valid Multiboot2 header
into a file (such as
header.bin) - understanding Multiboot2 headers better
- analyze Multiboot2 headers at runtime
What this library is not optimal for:
- compiling a Multiboot2 header statically into an object file using only Rust code
Example 1: Builder + Parse
use Multiboot2HeaderBuilder;
use ;
/// Small example that creates a Multiboot2 header and parses it afterwards.
Example 2: Multiboot2 header as static data in Rust file
You can use the builder, construct a Multiboot2 header, write it to a file and include it like this:
#[used]
#[no_mangle]
#[link_section = ".text.multiboot2_header"]
static MULTIBOOT2_HDR: &[u8; 64] = include_bytes!("mb2_hdr_dump.bin");
You may need a special linker script to place this in a LOAD segment with a file offset with less than 32768 bytes. See specification.
License & Contribution
See main README file.