| 1 |
r-efi |
| 2 |
===== |
| 3 |
|
| 4 |
UEFI Reference Specification Protocol Constants and Definitions |
| 5 |
|
| 6 |
The r-efi project provides the protocol constants and definitions of the |
| 7 |
UEFI Reference Specification as native rust code. The scope of this project is |
| 8 |
limited to those protocol definitions. The protocols are not actually |
| 9 |
implemented. As such, this project serves as base for any UEFI application that |
| 10 |
needs to interact with UEFI, or implement (parts of) the UEFI specification. |
| 11 |
|
| 12 |
### Project |
| 13 |
|
| 14 |
* **Website**: <https://github.com/r-efi/r-efi/wiki> |
| 15 |
* **Bug Tracker**: <https://github.com/r-efi/r-efi/issues> |
| 16 |
|
| 17 |
### Requirements |
| 18 |
|
| 19 |
The requirements for this project are: |
| 20 |
|
| 21 |
* `rustc >= 1.68.0` |
| 22 |
|
| 23 |
### Build |
| 24 |
|
| 25 |
To build this project, run: |
| 26 |
|
| 27 |
```sh |
| 28 |
cargo build |
| 29 |
``` |
| 30 |
|
| 31 |
Available configuration options are: |
| 32 |
|
| 33 |
* **native**: This feature-selector enables compilation of modules and |
| 34 |
examples that require native UEFI targets. Those will not |
| 35 |
compile on foreign targets and thus are guarded by this flag. |
| 36 |
|
| 37 |
##### Build via: official toolchains |
| 38 |
|
| 39 |
Starting with rust-version 1.68, rustup distributes pre-compiled toolchains for |
| 40 |
many UEFI targets. You can enumerate and install them via `rustup`. This |
| 41 |
example shows how to enumerate all available targets for your stable toolchain |
| 42 |
and then install the UEFI target for the `x86_64` architecture: |
| 43 |
|
| 44 |
```sh |
| 45 |
rustup target list --toolchain=stable |
| 46 |
rustup target add --toolchain=stable x86_64-unknown-uefi |
| 47 |
``` |
| 48 |
|
| 49 |
This project can then be compiled directly for the selected target: |
| 50 |
|
| 51 |
```sh |
| 52 |
cargo +stable build \ |
| 53 |
--examples \ |
| 54 |
--features native \ |
| 55 |
--lib \ |
| 56 |
--target x86_64-unknown-uefi |
| 57 |
``` |
| 58 |
|
| 59 |
##### Build via: cargo/rustc nightly with -Zbuild-std |
| 60 |
|
| 61 |
If no pre-compiled toolchains are available for your selected target, you can |
| 62 |
compile the project and the required parts of the standard library via the |
| 63 |
experimental `-Zbuild-std` feature of rustc. This requires a nightly compiler: |
| 64 |
|
| 65 |
```sh |
| 66 |
cargo +nightly build \ |
| 67 |
-Zbuild-std=core,compiler_builtins,alloc \ |
| 68 |
-Zbuild-std-features=compiler-builtins-mem \ |
| 69 |
--examples \ |
| 70 |
--features native \ |
| 71 |
--lib \ |
| 72 |
--target x86_64-unknown-uefi |
| 73 |
``` |
| 74 |
|
| 75 |
##### Build via: foreign target |
| 76 |
|
| 77 |
The project can be built for non-UEFI targets via the standard rust toolchains. |
| 78 |
This allows non-UEFI targets to interact with UEFI systems or otherwise host |
| 79 |
UEFI operations. Furthermore, this allows running the foreign test-suite of |
| 80 |
this project as long as the target supports the full standard library: |
| 81 |
|
| 82 |
```sh |
| 83 |
cargo +stable build --all-targets |
| 84 |
cargo +stable test --all-targets |
| 85 |
``` |
| 86 |
|
| 87 |
Note that the `native` feature must not be enabled for foreign targets as it |
| 88 |
will not compile on non-UEFI systems. |
| 89 |
|
| 90 |
### Repository: |
| 91 |
|
| 92 |
- **web**: <https://github.com/r-efi/r-efi> |
| 93 |
- **https**: `https://github.com/r-efi/r-efi.git` |
| 94 |
- **ssh**: `[email protected]:r-efi/r-efi.git` |
| 95 |
|
| 96 |
### License: |
| 97 |
|
| 98 |
- **MIT** OR **Apache-2.0** OR **LGPL-2.1-or-later** |
| 99 |
- See AUTHORS file for details. |