Skip to main content

KernelHeader

Struct KernelHeader 

Source
#[repr(C)]
pub struct KernelHeader {
Show 21 fields pub kernel_magic: u32, pub header_version: u16, pub arch: u8, pub kernel_type: u8, pub kernel_flags: u32, pub min_memory_mb: u32, pub entry_point: u64, pub image_size: u64, pub compressed_size: u64, pub compression: u8, pub api_transport: u8, pub api_port: u16, pub api_version: u32, pub image_hash: [u8; 32], pub build_id: [u8; 16], pub build_timestamp: u64, pub vcpu_count: u32, pub reserved_0: u32, pub cmdline_offset: u64, pub cmdline_length: u32, pub reserved_1: u32,
}
Expand description

128-byte header for KERNEL_SEG payloads.

Follows the standard 64-byte SegmentHeader. All multi-byte fields are little-endian on the wire except api_port which is network byte order (big-endian) per ADR-030.

Fields§

§kernel_magic: u32

Magic: KERNEL_MAGIC (0x52564B4E, “RVKN”).

§header_version: u16

KernelHeader format version (currently 1).

§arch: u8

Target architecture (see KernelArch).

§kernel_type: u8

Kernel type (see KernelType).

§kernel_flags: u32

Bitfield flags (see KERNEL_FLAG_* constants).

§min_memory_mb: u32

Minimum RAM required (MiB).

§entry_point: u64

Virtual address of kernel entry point.

§image_size: u64

Uncompressed kernel image size (bytes).

§compressed_size: u64

Compressed kernel image size (bytes).

§compression: u8

Compression algorithm (same enum as SegmentHeader.compression).

§api_transport: u8

API transport (see ApiTransport).

§api_port: u16

Default API port (network byte order).

§api_version: u32

Supported RVF query API version.

§image_hash: [u8; 32]

SHAKE-256-256 of uncompressed kernel image.

§build_id: [u8; 16]

Unique build identifier (UUID v7).

§build_timestamp: u64

Build time (nanosecond UNIX timestamp).

§vcpu_count: u32

Recommended vCPU count (0 = single).

§reserved_0: u32

Reserved (must be zero).

§cmdline_offset: u64

Offset to kernel command line within payload.

§cmdline_length: u32

Length of kernel command line (bytes).

§reserved_1: u32

Reserved (must be zero).

Implementations§

Source§

impl KernelHeader

Source

pub fn to_bytes(&self) -> [u8; 128]

Serialize the header to a 128-byte little-endian array.

Source

pub fn from_bytes(data: &[u8; 128]) -> Result<Self, RvfError>

Deserialize a KernelHeader from a 128-byte slice.

Trait Implementations§

Source§

impl Clone for KernelHeader

Source§

fn clone(&self) -> KernelHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KernelHeader

Source§

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

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

impl Copy for KernelHeader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.