pub unsafe fn load(address: usize) -> Result<BootInformation, MbiLoadError>
Expand description

Load the multiboot boot information struct from an address.

This is the same as load_with_offset but the offset is omitted and set to zero.

Example

use multiboot2::load;

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

Safety

  • address must be valid for reading. Otherwise this function might terminate the program. This can be the case in environments with standard environment (segfault) but also in UEFI-applications, where the referenced memory is not (identity) mapped (UEFI does only identity mapping).
  • The memory at address must not be modified after calling load or the program may observe unsychronized mutation.