Skip to content

Tracking Issue for uefi-std #100499

Open
Open
@Ayush1325

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:

  1. Writing UEFI shell applications. This includes stuff like benchmarks, self-test utilities, etc. Many drivers should also be able to use std.
  2. 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.
  3. 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:

  1. pub fn get_system_table() -> NonNull<c_void>
  2. pub fn get_system_handle() -> NonNull<c_void>
  3. 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)

  1. trait OsStrExt
  2. trait OsStringExt

Implementation History

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions