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 returned by the responses
Macros
- This creates a limine request with const defaults by black magic. It also automatically creates the
idandrevisionfields.
Structs
- Request the time on boot
- Response to [
BootTimeRequest] - Get information regarding the bootloader
- Response to [
InfoRequest] - Request the address of the EFI System Table
- Response to [
EfiSystemTableRequest] - Request the bootloader use the specified entry point instead of the default one
- Response to [
EntryPointRequest] - Request a framebuffer
- Response to [
FramebufferRequest] - Request Higher Half Direct Mapping be enabled
- Response to [
HHDMRequest] - Request the physical and virtual address of the Kernel
- Response to [
KernelAddressRequest] - Request the file the Kernel was loaded from
- Response to [
KernelFileRequest] - Request Level 5 paging be enabled
- Response to [
Level5PagingRequest] - Request for receiving the Memory Map from the bootloader
- Response to [
MemoryMapRequest] - Request the loaded modules
- Response to [
ModuleRequest] - Request the address of the RSDP
- Response to [
RSDPRequest] - 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.
- Request the SMBIOS entry point
- Response to [
SMBIOSRequest] - Request the bootloader bootstrap the secondary processors
- Response to [
SMPRequest] - Specify how much stack you desire the bootloader to give you
- Response to [
StackSizeRequest] - Request a terminal
- Response to [
TerminalRequest]
Constants
- Common Magic for Limine requests
Traits
- A trait for const defaults