Struct bootloader::boot_info::BootInfo

source ·
#[non_exhaustive]
#[repr(C)]
pub struct BootInfo { pub version_major: u16, pub version_minor: u16, pub version_patch: u16, pub pre_release: bool, pub memory_regions: MemoryRegions, pub framebuffer: Optional<FrameBuffer>, pub physical_memory_offset: Optional<u64>, pub recursive_index: Optional<u16>, pub rsdp_addr: Optional<u64>, pub tls_template: Optional<TlsTemplate>, }
Expand description

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

The information is passed as an argument to the entry point. The entry point function must have the following signature:

extern "C" fn(boot_info: &'static mut 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 (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§version_major: u16

Bootloader version (major).

§version_minor: u16

Bootloader version (minor).

§version_patch: u16

Bootloader version (patch).

§pre_release: bool

Whether the bootloader version is a pre-release.

We can’t store the full prerelease string of the version number since it could be arbitrarily long.

§memory_regions: MemoryRegions

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.

§framebuffer: Optional<FrameBuffer>

Information about the framebuffer for screen output if available.

§physical_memory_offset: Optional<u64>

The virtual address at which the mapping of the physical memory starts.

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.

Only available if the map-physical-memory config option is enabled.

§recursive_index: Optional<u16>

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

Only available if the map-page-table-recursively config option is enabled.

§rsdp_addr: Optional<u64>

The address of the RSDP data structure, which can be use to find the ACPI tables.

This field is None if no RSDP was found (for BIOS) or reported (for UEFI).

§tls_template: Optional<TlsTemplate>

The thread local storage (TLS) template of the kernel executable, if present.

Trait Implementations§

source§

impl Debug for BootInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.