Feature gate: #![feature(uefi_std)]
This is a tracking issue for Std support for UEFI environment. I have been working on implementing this as a part of my Google Summer of Code 2022 project. Information about the current state of this implementation can be found at src/doc/rustc/src/platform-support/unknown-uefi.md. A PR has already been opened here
For those who are wondering how a target like UEFI can benefit from std support, here are a few examples:
- Writing UEFI shell applications. This includes stuff like benchmarks, self-test utilities, etc. Many drivers should also be able to use std.
- Finding UEFI target bugs. During this work, I have found 3 numeric tests that cause CPU exceptions for UEFI (they are fixed now. Also, I have found 2 additional bugs (which seem like bugs in llvm soft-float) which went unnoticed because there was no easy way to do any broad testing.
- Provide a stable interface for library developers. The current std contains some functions under std::os::uefi::env to provide access to the underlying SystemTable and SystemHandle, which are essential for writing anything for UEFI.
Public API
APIs I propose to add under std::os::uefi::env:
pub fn get_system_table() -> NonNull<c_void>
pub fn get_system_handle() -> NonNull<c_void>
pub fn boot_services() -> Option<NonNull<c_void>>
APIs I propose to add under std::os::uefi::ffi (Just re-export std::os::windows::ffi)
- trait
OsStrExt
- trait
OsStringExt
Implementation History
Feature gate:
#![feature(uefi_std)]This is a tracking issue for Std support for UEFI environment. I have been working on implementing this as a part of my Google Summer of Code 2022 project. Information about the current state of this implementation can be found at
src/doc/rustc/src/platform-support/unknown-uefi.md. A PR has already been opened hereFor those who are wondering how a target like UEFI can benefit from std support, here are a few examples:
Public API
APIs I propose to add under
std::os::uefi::env:pub fn get_system_table() -> NonNull<c_void>pub fn get_system_handle() -> NonNull<c_void>pub fn boot_services() -> Option<NonNull<c_void>>APIs I propose to add under
std::os::uefi::ffi(Just re-exportstd::os::windows::ffi)OsStrExtOsStringExtImplementation History