-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Combining Rust `std` with `uefi` | ||
|
||
In the `uefi` crate, we provide tooling to create a `#[no_std]` + `#[no_main]` | ||
binary, i.e., an UEFI image, in a convenient way. However, there is also the | ||
option to create a "standard" binary with Rust. The result is the same, but the | ||
build process and the overall programming is much more similar to regular | ||
Rust binaries written for Operating Systems, such as Linux, Windows, or macOS. | ||
|
||
## About `std` for `uefi` | ||
|
||
The Rust implementation of the standard library (_`std` implementation_) is | ||
ongoing and will evolve over the coming months and years. Over time, you will | ||
need less and less specific features of `uefi` and can utilize standard and | ||
well-known OS-independent APIs for that, as in the typical Linux application, | ||
for example. | ||
|
||
The `uefi` crate is suited to extend the functionality of these "standard | ||
binaries". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ pkgs.mkShell { | |
rustToolchain | ||
|
||
# Other | ||
mdbook | ||
yamlfmt | ||
which # used by "cargo xtask fmt" | ||
]; | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
[package] | ||
name = "uefi-std-example" | ||
description = """ | ||
""" | ||
version = "0.1.0" | ||
authors = ["The Rust OSDev team"] | ||
publish = false | ||
edition = "2021" | ||
|
||
[dependencies] | ||
uefi = { path = "../uefi", features = [], default-features = false } | ||
|
||
log.workspace = true | ||
# Attention: Don't activate the panic_handler feature, as it will clash with | ||
# the one coming from `std`. | ||
uefi = { path = "../uefi", features = ["alloc"], default-features = false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
# Minimal Rust App using `std` and `uefi` | ||
|
||
Minimal example of a "standard Rust application" that showcases how `uefi` can | ||
be utilized and enhance the developers experience, when `std` is available. | ||
|
||
For simplicity, this example is minimal and the documentation is focused on | ||
`x86_64-unknown-uefi`. However, it works similar for other supported UEFI | ||
platforms. | ||
|
||
## Build | ||
|
||
Build using `cargo +nightly build` to build an `x86_64-unknown-uefi` app. | ||
Build the app using | ||
`$ cargo +nightly build --target x86_64-unknown-uefi`. To build it from the root | ||
directory (the Cargo workspace), append `-p uefi-std-example`. | ||
|
||
## Run | ||
|
||
The resulting `.efi` file can be found in `target/x86_64-unknown-uefi/<debug|release>/uefi-std-example.efi`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters