Skip to main content

KernelArgs

Struct KernelArgs 

Source
#[repr(C)]
pub struct KernelArgs {
Show 27 fields pub magic: u32, pub abi_version: u32, pub kernel_base: u64, pub kernel_size: u64, pub stack_base: u64, pub stack_size: u64, pub env_base: u64, pub env_size: u64, pub acpi_rsdp_base: u64, pub acpi_rsdp_size: u64, pub memory_map_base: u64, pub memory_map_size: u64, pub initfs_base: u64, pub initfs_size: u64, pub framebuffer_addr: u64, pub framebuffer_width: u32, pub framebuffer_height: u32, pub framebuffer_stride: u32, pub framebuffer_bpp: u16, pub framebuffer_red_mask_size: u8, pub framebuffer_red_mask_shift: u8, pub framebuffer_green_mask_size: u8, pub framebuffer_green_mask_shift: u8, pub framebuffer_blue_mask_size: u8, pub framebuffer_blue_mask_shift: u8, pub _padding1: u32, pub hhdm_offset: u64,
}
Expand description

Bootloader-to-kernel handoff structure.

Passed by the bootloader to the kernel at entry point. Layout is #[repr(C)] for natural alignment across all fields.

Fields§

§magic: u32§abi_version: u32§kernel_base: u64§kernel_size: u64§stack_base: u64§stack_size: u64§env_base: u64§env_size: u64§acpi_rsdp_base: u64§acpi_rsdp_size: u64§memory_map_base: u64§memory_map_size: u64§initfs_base: u64§initfs_size: u64§framebuffer_addr: u64§framebuffer_width: u32§framebuffer_height: u32§framebuffer_stride: u32§framebuffer_bpp: u16§framebuffer_red_mask_size: u8§framebuffer_red_mask_shift: u8§framebuffer_green_mask_size: u8§framebuffer_green_mask_shift: u8§framebuffer_blue_mask_size: u8§framebuffer_blue_mask_shift: u8§_padding1: u32§hhdm_offset: u64

Trait Implementations§

Source§

impl Debug for KernelArgs

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FromBytes for KernelArgs
where u32: FromBytes, u64: FromBytes, u16: FromBytes, u8: FromBytes,

§

fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the given source. Read more
§

fn read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the prefix of the given source. Read more
§

fn read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the suffix of the given source. Read more
Source§

impl FromZeros for KernelArgs
where u32: FromZeros, u64: FromZeros, u16: FromZeros, u8: FromZeros,

§

fn zero(&mut self)

Overwrites self with zeros. Read more
§

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
Source§

impl IntoBytes for KernelArgs
where u32: IntoBytes, u64: IntoBytes, u16: IntoBytes, u8: IntoBytes, (): PaddingFree<Self, { _ }>,

§

fn as_mut_bytes(&mut self) -> &mut [u8]
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
Source§

impl TryFromBytes for KernelArgs
where u32: TryFromBytes, u64: TryFromBytes, u16: TryFromBytes, u8: TryFromBytes,

§

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
§

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
§

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. 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>,

Source§

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>,

Source§

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.