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
- std: uefi: Add basic Env variables #127462
- uefi: Implement getcwd and chdir #129794
- uefi: process: Add args support #129838
- Initial fs module for uefi #135324
- uefi: fs: Implement exists #135368
- uefi: helpers: Introduce OwnedDevicePath #135393
- uefi: Implement path #135475
- uefi: process: Add support for command environment variables #136418
- sys: net: Add UEFI stubs #136615
- uefi: helpers: Add DevicePathNode abstractions #137424
- uefi: Add Service Binding Protocol abstraction #137477
- uefi: fs: Implement FileType, FilePermissions and FileAttr #138269
- uefi: Add OwnedEvent abstraction #138236
- Implement some basics in UEFI fs #138662
- std: uefi: fs: Implement mkdir #138667
- uefi: fs: Add file times plumbing #138918
- std: sys: net: uefi: Implement TCP4 connect #139254
- std: sys: process: uefi: Use NULL stdin by default #139517
- std: sys: pal: uefi: Overhaul Time #139806