[][src]Struct bootloader::bootinfo::BootInfo

#[repr(C)]pub struct BootInfo {
    pub memory_map: MemoryMap,
    pub recursive_page_table_addr: u64,
    pub physical_memory_offset: u64,
    // some fields omitted
}

This structure represents the information that the bootloader passes to the kernel.

The information is passed as an argument to the entry point:

This example is not tested
pub extern "C" fn _start(boot_info: &'static BootInfo) -> ! {
   // […]
}

Note that no type checking occurs for the entry point function, so be careful to use the correct argument types. To ensure that the entry point function has the correct signature, use the entry_point macro.

Fields

memory_map: MemoryMap

A map of the physical memory regions of the underlying machine.

The bootloader queries this information from the BIOS/UEFI firmware and translates this information to Rust types. It also marks any memory regions that the bootloader uses in the memory map before passing it to the kernel. Regions marked as usable can be freely used by the kernel.

recursive_page_table_addr: u64

The virtual address of the recursively mapped level 4 page table.

physical_memory_offset: u64

The offset into the virtual address space where the physical memory is mapped.

Physical addresses can be converted to virtual addresses by adding this offset to them.

The mapping of the physical memory allows to access arbitrary physical frames. Accessing frames that are also mapped at other virtual addresses can easily break memory safety and cause undefined behavior. Only frames reported as USABLE by the memory map in the BootInfo can be safely accessed.

Implementations

impl BootInfo[src]

pub fn tls_template(&self) -> Option<TlsTemplate>[src]

Returns information about the thread local storage segment of the kernel.

Returns None if the kernel has no thread local storage segment.

(The reason this is a method instead of a normal field is that Option is not FFI-safe.)

Trait Implementations

impl Debug for BootInfo[src]

Auto Trait Implementations

impl Send for BootInfo

impl Sync for BootInfo

impl Unpin for BootInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.