Function multiboot2::load [−][src]
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
This function might terminate the program, if the address is invalid. 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).