pub struct Multiboot<'a, 'b> { /* private fields */ }
Expand description

Multiboot struct clients mainly interact with

To create this use Multiboot::from_ptr or Multiboot::from_ref.

Implementations

Multiboot structure.

Initializes the multiboot structure from a passed address.

This is the way to go, if you’re writing a kernel.

Arguments
  • mboot_ptr - The physical address of the multiboot header. On qemu for example this is typically at 0x9500.
  • memory_management - Translation of the physical addresses into kernel addresses, allocation and deallocation of memory. See the MemoryManagement description for more details.
Safety

The user must ensure that mboot_ptr holds the physical address of a valid Multiboot1 structure and that memory management provides correct translations.

Initializes this struct from an already existing MultibootInfo reference.

In combination with MultibootInfo::default this is useful for writing a bootloader.

Arguments
  • info - The (mutable) reference to a MultibootInfo struct.
  • memory_management - Translation of the physical addresses into kernel addresses, allocation and deallocation of memory. See the MemoryManagement description for more details.
Safety

The user must ensure that the memory management can allocate memory.

If true, then the mem_upper and mem_lower fields are valid.

If true, then the mem_upper and mem_lower fields are valid.

If true, then the boot_device field is valid.

If true, then the boot_device field is valid.

If true, then the cmdline field is valid.

If true, then the cmdline field is valid.

If true, then the mods_addr and mods_count fields are valid.

If true, then the mods_addr and mods_count fields are valid.

If true, then the syms field is valid and contains AOut symbols.

If true, then the syms field is valid and contains AOut symbols.

If true, then the syms field is valid and containts ELF symbols.

If true, then the syms field is valid and containts ELF symbols.

If true, then the mmap_addr and mmap_length fields are valid.

If true, then the mmap_addr and mmap_length fields are valid.

If true, then the drives_addr and drives_length fields are valid.

If true, then the drives_addr and drives_length fields are valid.

If true, then the config_table field is valid.

If true, then the config_table field is valid.

If true, then the boot_loader_name field is valid.

If true, then the boot_loader_name field is valid.

If true, then the apm_table field is valid.

If true, then the apm_table field is valid.

If true, then the vbe_* fields are valid.

If true, then the vbe_* fields are valid.

If true, then the framebuffer table is valid.

If true, then the framebuffer table is valid.

Indicate the amount of lower memory in kilobytes.

Lower memory starts at address 0. The maximum possible value for lower memory is 640 kilobytes.

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.

Sets the memory bounds (lower, upper).

This is one call because Multiboot requires both or none to be set.

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.

Command line passed to the kernel.

Command line to be passed to the kernel.

The given string will be copied to newly allocated memory.

Get the name of the bootloader.

Set the name of the bootloader.

The given string will be copied to newly allocated memory.

Discover all additional modules in multiboot.

Publish modules to the kernel.

This copies the given metadata into newly allocated memory.

Note that the addresses in each Module must be and stay valid.

Get the symbols.

Set the symbols.

Note that the address in either AOutSymbols or ElfSymbols must stay valid.

Discover all memory regions in the multiboot memory map.

Publish the memory regions to the kernel.

The parameter is a pair of address and number of MemoryEntrys.

Note that the underlying memory has to stay intact.

Return end address of multiboot image.

This function can be used to figure out a (hopefully) safe offset in the first region of memory to start using as free memory.

Return the framebuffer table, if it exists.

Set the framebuffer table, if it exists.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.