Expand description
Rust Bindings for the limine boot protocol.
§Examples
An example kernel using this crate can be found here. For smaller usage examples, see usage.
§Crate features
uuid
: ImplementsInto<uuid::Uuid>
andFrom<uuid::Uuid>
forfile::Uuid
.ipaddr
: Enables functions infile::File
to returnIpv4Addr
. This is feature gated because it will only appear in stable on Rust 1.77.0, on March 21st.
§Revisions
Many types in the limine boot protocol have associated revisions. These
signify various added fields and changes to the protocol. For requests, if a
bootloader doesn’t support a revision, it will simply process it as if it is
the highest revision it does support. The bootloader will only return the
latest supported revision in responses. The response revision is
automatically checked by the types in this crate, and types that may not be
returned are wrapped in an Option
.
In this crate, you may specify the revisions of your requests via
with_revision
, but you likely just want to use new
. This will use the
latest revision supported by this crate.
§Usage
The first thing you need to do is place a BaseRevision
tag somewhere in
your code. This tag is used to identify what revision of the protocol your
executable requires. Without this tag, the bootloader will assume revision 0,
which is likely not what you want.
The BaseRevision
tag can be placed anywhere in your code, like so:
use limine::BaseRevision;
// Require version 2 or higher
pub static BASE_REVISION: BaseRevision = BaseRevision::new();
Next, you can place any requests you would like. For example, to request a larger stack (recommended on debug Rust builds), you can do the following:
use limine::request::StackSizeRequest;
// Some reasonable size
pub const STACK_SIZE: u64 = 0x100000;
// Request a larger stack
pub static STACK_SIZE_REQUEST: StackSizeRequest = StackSizeRequest::new().with_size(STACK_SIZE);
Modules§
- file
- File structure and related functions.
- firmware_
type - Auxiliary types for the firmware type request .
- framebuffer
- Auxiliary types for the framebuffer request
- memory_
map - Auxiliary types for the memory map request
- modules
- Auxiliary types for the module request
- mp
- Auxiliary types for the MP request.
- paging
- Auxiliary types for the paging mode request.
- request
- Request structures
- response
- Responses to requests.
- smp
Deprecated - Auxiliary types for the SMP request.
Macros§
- cstr
Deprecated - Create a NUL-terminated C string from a string literal
Structs§
- Base
Revision - A tag setting the base revision supported by the executable. Set this in your executable in order to require a higher revision. Without this tag, the bootloader will assume revision 0.