[−][src]Struct multiboot::information::Multiboot
Multiboot struct clients mainly interact with
To create this use Multiboot::from_ptr
or Multiboot::from_ref
.
Implementations
impl<'a, 'b> Multiboot<'a, 'b>
[src]
Multiboot structure.
pub unsafe fn from_ptr(
mboot_ptr: PAddr,
memory_management: &'b mut dyn MemoryManagement
) -> Option<Multiboot<'a, 'b>>
[src]
mboot_ptr: PAddr,
memory_management: &'b mut dyn MemoryManagement
) -> Option<Multiboot<'a, 'b>>
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 theMemoryManagement
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.
pub fn from_ref(
info: &'a mut MultibootInfo,
memory_management: &'b mut dyn MemoryManagement
) -> Self
[src]
info: &'a mut MultibootInfo,
memory_management: &'b mut dyn MemoryManagement
) -> Self
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 aMultibootInfo
struct.memory_management
- Translation of the physical addresses into kernel addresses, allocation and deallocation of memory. See theMemoryManagement
description for more details.
Safety
The user must ensure that the memory management can allocate memory.
pub fn has_memory_bounds(&self) -> bool
[src]
If true, then the mem_upper
and mem_lower
fields are valid.
pub fn has_boot_device(&self) -> bool
[src]
If true, then the boot_device
field is valid.
pub fn has_cmdline(&self) -> bool
[src]
If true, then the cmdline
field is valid.
pub fn has_modules(&self) -> bool
[src]
If true, then the mods_addr
and mods_count
fields are valid.
pub fn has_aout_symbols(&self) -> bool
[src]
If true, then the syms
field is valid and contains AOut symbols.
pub fn has_elf_symbols(&self) -> bool
[src]
If true, then the syms
field is valid and containts ELF symbols.
pub fn has_memory_map(&self) -> bool
[src]
If true, then the mmap_addr
and mmap_length
fields are valid.
pub fn has_drives(&self) -> bool
[src]
If true, then the drives_addr
and drives_length
fields are valid.
pub fn has_config_table(&self) -> bool
[src]
If true, then the config_table
field is valid.
pub fn has_boot_loader_name(&self) -> bool
[src]
If true, then the boot_loader_name
field is valid.
pub fn has_apm_table(&self) -> bool
[src]
If true, then the apm_table
field is valid.
pub fn has_vbe(&self) -> bool
[src]
If true, then the vbe_*
fields are valid.
pub fn has_framebuffer_table(&self) -> bool
[src]
If true, then the framebuffer table is valid.
pub fn lower_memory_bound(&self) -> Option<u32>
[src]
Indicate the amount of lower memory in kilobytes.
Lower memory starts at address 0. The maximum possible value for lower memory is 640 kilobytes.
pub fn upper_memory_bound(&self) -> Option<u32>
[src]
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.
pub fn set_memory_bounds(&mut self, bounds: Option<(u32, u32)>)
[src]
Sets the memory bounds (lower, upper).
This is one call because Multiboot requires both or none to be set.
pub fn boot_device(&self) -> Option<BootDevice>
[src]
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.
pub fn command_line(&self) -> Option<&'a str>
[src]
Command line passed to the kernel.
pub fn set_command_line(&mut self, cmdline: Option<&str>)
[src]
Command line to be passed to the kernel.
The given string will be copied to newly allocated memory.
pub fn boot_loader_name(&self) -> Option<&'a str>
[src]
Get the name of the bootloader.
pub fn set_boot_loader_name(&mut self, name: Option<&str>)
[src]
Set the name of the bootloader.
The given string will be copied to newly allocated memory.
pub fn modules(&'a self) -> Option<ModuleIter<'a, 'b>>
[src]
Discover all additional modules in multiboot.
pub fn set_modules(&mut self, modules: Option<&[Module<'_>]>)
[src]
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.
pub fn symbols(&self) -> Option<SymbolType>
[src]
Get the symbols.
pub fn set_symbols(&mut self, symbols: Option<SymbolType>)
[src]
Set the symbols.
Note that the address in either AOutSymbols
or ElfSymbols
must stay valid.
pub fn memory_regions(&'a self) -> Option<MemoryMapIter<'a, 'b>>
[src]
Discover all memory regions in the multiboot memory map.
pub fn set_memory_regions(&mut self, regions: Option<(PAddr, usize)>)
[src]
Publish the memory regions to the kernel.
The parameter is a pair of address and number of MemoryEntry
s.
Note that the underlying memory has to stay intact.
pub fn find_highest_address(&self) -> PAddr
[src]
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.
pub fn framebuffer_table(&self) -> Option<&FramebufferTable>
[src]
Return the framebuffer table, if it exists.
pub fn set_framebuffer_table(&mut self, table: Option<FramebufferTable>)
[src]
Set the framebuffer table, if it exists.
Auto Trait Implementations
impl<'a, 'b> !Send for Multiboot<'a, 'b>
impl<'a, 'b> !Sync for Multiboot<'a, 'b>
impl<'a, 'b> Unpin for Multiboot<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,