Crate limine_protocol

source ·
Expand description

Crate containing Rust representations for the Limine Boot Protocol

Example

If one wanted to have 64KiB of stack space, they would make a request like such

// Note that `#[used]` may be required in case Rust decides the object is unreachable or unused
#[used]
static STACK_REQUEST: Request<StackSizeRequest> = StackSizeRequest {
   stack_size: 1024 * 64,
   ..StackSizeRequest::default()
}
.into();

One could also decide to link the request into the limine_reqs section, which would be done like such

pub struct NotSync<T>(pub T);

impl<T> core::ops::Deref for NotSync<T> {
    type Target = T;
  
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

unsafe impl<T> Sync for NotSync<T> {}

// Note that `#[used]` may be required in case Rust decides the object is unreachable or unused
#[used]
static ARR: [NotSync<*mut ()>; 1] = [NotSync(&STACK_REQUEST as *const _ as *mut ())];

Note that this is very unsafe, as is expected by such a thing as a Bootloader. Rust has no clue we’re doing this at all.

Modules

Macros

  • This creates a limine request with const defaults by black magic. It also automatically creates the id and revision fields.

Structs

Constants

Traits