Open
Description
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
- Add Minimal Std implementation for UEFI #105861
- Stdio support for UEFI #116207
- Implement sys::args for UEFI #116341
- Improve UEFI stdio #117174
- Use ImageDataType for allocation type #117177
- Implement SystemTime for UEFI #120351
- Expand sys/os for UEFI #120419
- Mark UEFI std support as WIP #120640
- Implement Instant for UEFI #120889
- Implement sys/thread for UEFI #120938
- Add Process support for UEFI #123196