Crate limine_protocol

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§

structures
Structures returned by the responses

Macros§

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

Structs§

BootTimeRequest
Request the time on boot
BootTimeResponse
Response to [BootTimeRequest]
BootloaderInfoRequest
Get information regarding the bootloader
BootloaderInfoResponse
Response to [InfoRequest]
EfiSystemTableRequest
Request the address of the EFI System Table
EfiSystemTableResponse
Response to [EfiSystemTableRequest]
EntryPointRequest
Request the bootloader use the specified entry point instead of the default one
EntryPointResponse
Response to [EntryPointRequest]
FramebufferRequest
Request a framebuffer
FramebufferResponse
Response to [FramebufferRequest]
HHDMRequest
Request Higher Half Direct Mapping be enabled
HHDMResponse
Response to [HHDMRequest]
KernelAddressRequest
Request the physical and virtual address of the Kernel
KernelAddressResponse
Response to [KernelAddressRequest]
KernelFileRequest
Request the file the Kernel was loaded from
KernelFileResponse
Response to [KernelFileRequest]
Level5PagingRequest
Request Level 5 paging be enabled
Level5PagingResponse
Response to [Level5PagingRequest]
MemoryMapRequest
Request for receiving the Memory Map from the bootloader
MemoryMapResponse
Response to [MemoryMapRequest]
ModuleRequest
Request the loaded modules
ModuleResponse
Response to [ModuleRequest]
RSDPRequest
Request the address of the RSDP
RSDPResponse
Response to [RSDPRequest]
Request
A Request type, which wraps the internal request in an unsafe cell, due to the possibility it may be mutated by things outside rust. However, it automatically derefences to the internal type for ergonomics.
SMBIOSRequest
Request the SMBIOS entry point
SMBIOSResponse
Response to [SMBIOSRequest]
SMPRequest
Request the bootloader bootstrap the secondary processors
SMPResponse
Response to [SMPRequest]
StackSizeRequest
Specify how much stack you desire the bootloader to give you
StackSizeResponse
Response to [StackSizeRequest]
TerminalRequest
Request a terminal
TerminalResponse
Response to [TerminalRequest]

Constants§

COMMON_MAGIC
Common Magic for Limine requests

Traits§

ConstDefault
A trait for const defaults