-
-
Notifications
You must be signed in to change notification settings - Fork 170
RFC: Add a uefi-raw
crate
#716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I like the idea and fully support it without additional comments. Sounds very sensible what you've written down. Nice! PS: Would |
That was my thought initially as well, but as far as I've seen |
This can be closed, right? We have the new crate now |
Uh oh!
There was an error while loading. Please reload this page.
I'd like to propose adding a
uefi-raw
crate that will mostly contain type definitions that closely match types in the UEFI spec. All fields in these types will be public, and there will be few relatively fewimpls
. (For example, there might be someDebug
/Display
impls, but not methods that wrap all theextern "efiapi"
function pointers likeuefi
provides).The new crate will be useful for projects that want to implement UEFI services, as opposed to just using them. My motivation for this is #715; having access to all the private fields is necessary for implementing Miri stubs. But it would also be useful for someone who wanted to implement a real UEFI environment, or part of one (e.g. I think uboot provides a partial UEFI boot services implementation, that sort of thing.)
We can add a static checker to
xtask
to make guarantees about the new crate, e.g. verifying that only FFI-compat types are used, being consistent about using raw pointers instead of references, making sure all fn pointers are markedextern efiapi
, that sort of thing.We'll add
uefi-raw
as a dependency ofuefi
, and use theuefi-raw
types to implement the safe interface. So for example the definition ofBootServices
inuefi-raw
would contain all the function pointers, and the definition ofBootServices
inuefi
would look likeIn general we will not publically expose types from
uefi-raw
inuefi
, except where the type doesn't need any additional level of safety wrapping. For example, the variousnewtype_enum!
types can be safely re-exported without any additional wrapper.The reason for
uefi-raw
being in a separate crate, as opposed to just auefi::raw
module, is the documentation. We don't want all search terms to come up with two results for everything.Actually implementing the crate can be done incrementally. Once we have the basic framework in place we can transfer over internal struct implementations piece by piece.
The text was updated successfully, but these errors were encountered: