Struct multiboot::Multiboot
[−]
[src]
pub struct Multiboot<'a> { // some fields omitted }
Multiboot struct clients mainly interact with To create this use Multiboot::new()
Methods
impl<'a> Multiboot<'a>
Multiboot structure.
unsafe fn new(mboot_ptr: PAddr, paddr_to_slice: unsafe fn(paddr: PAddr, sz: usize) -> Option<&'a [u8]>) -> Option<Multiboot<'a>>
Initializes the multiboot structure.
Arguments
mboot_ptr
- The physical address of the multiboot header. On qemu for example this is typically at 0x9500.paddr_to_slice
- Translation of the physical addresses into kernel addresses.paddr_to_slice
translates physical addr + size into a kernel accessible slice. The simplest paddr_to_slice function would for example be just the identity function. But this may vary depending on how your page table layout looks like.
Safety
The user must ensure that mboot_ptr holds the physical address of a valid Multiboot1 structure and that paddr_to_slice provides correct translations.
fn lower_memory_bound(&self) -> Option<u32>
Indicate the amount of lower memory in kilobytes.
Lower memory starts at address 0. The maximum possible value for lower memory is 640 kilobytes.
fn upper_memory_bound(&self) -> Option<u32>
Indicate the amount of upper memory in kilobytes.
Upper memory starts at address 1 megabyte. The value returned for upper memory is maximally the address of the first upper memory hole minus 1 megabyte. It is not guaranteed to be this value.
fn boot_device(&self) -> Option<BootDevice>
Indicates which bios disk device the boot loader loaded the OS image from.
If the OS image was not loaded from a bios disk, then this returns None. The operating system may use this field as a hint for determining its own root device, but is not required to.
fn command_line(&self) -> Option<&'a str>
Command line to be passed to the kernel.
fn modules(&'a self) -> Option<ModuleIter>
Discover all additional modules in multiboot.
fn memory_regions(&'a self) -> Option<MemoryMapIter>
Discover all memory regions in the multiboot memory map.