2
2
3
3
[ ![ Crates.io] ( https://img.shields.io/crates/v/uefi )] ( https://crates.io/crates/uefi )
4
4
[ ![ Docs.rs] ( https://docs.rs/uefi/badge.svg )] ( https://docs.rs/uefi )
5
- ![ Stars] ( https://img.shields.io/github/stars/rust-osdev/uefi-rs )
6
5
![ License] ( https://img.shields.io/github/license/rust-osdev/uefi-rs )
7
6
![ Build status] ( https://github.com/rust-osdev/uefi-rs/workflows/Rust/badge.svg )
7
+ ![ Stars] ( https://img.shields.io/github/stars/rust-osdev/uefi-rs )
8
8
9
9
## Description
10
10
11
- [ UEFI] is the successor to the BIOS. It provides an early boot environment for
12
- OS loaders, hypervisors and other low-level applications. While it started out
13
- as x86-specific, it has been adopted on other platforms, such as ARM.
11
+ [ UEFI] started as the successor firmware to the BIOS in x86 space and developed
12
+ to a universal firmware specification for various platforms, such as ARM. It
13
+ provides an early boot environment with a variety of [ specified] [ spec ]
14
+ ready-to-use "high-level" functionality, such as accessing disks or the network.
15
+ EFI images, the files that can be loaded by an UEFI environment, can leverage
16
+ these abstractions to extend the functionality in form of additional drivers,
17
+ OS-specific bootloaders, or different kind of low-level applications.
18
+
19
+ Our mission is to provide ** safe** and ** performant** wrappers for UEFI
20
+ interfaces, and allow developers to write idiomatic Rust code.
21
+
22
+ This repository provides various crates:
23
+
24
+ - ` uefi-raw ` : Raw Rust UEFI bindings for basic structures and functions.
25
+ - ` uefi ` : High-level wrapper around various low-level UEFI APIs. \
26
+ Offers various optional features for typical Rust convenience, such as a
27
+ Logger and an Allocator. (_ This is what you are usually looking for!_ )
28
+ - ` uefi-macros ` : Helper macros. Used by ` uefi ` .
14
29
15
- This crate makes it easy to both:
16
- - Write UEFI applications in Rust (for ` i686 ` , ` x86_64 ` , or ` aarch64 ` )
17
- - Call UEFI functions from an OS (usually built with a [ custom target] [ rustc-custom ] )
18
30
19
- The objective is to provide ** safe** and ** performant** wrappers for UEFI interfaces,
20
- and allow developers to write idiomatic Rust code.
31
+ You can use the abstractions for example to:
21
32
22
- Check out [ the UEFI application template] ( template ) for a quick start.
33
+ - create OS-specific loaders and leverage UEFI boot service
34
+ - access UEFI runtime services from an OS
35
+
36
+ All crates are compatible with all platforms that both the Rust compiler and
37
+ UEFI support, such as ` i686 ` , ` x86_64 ` , and ` aarch64 ` ). Please note that we
38
+ can't test all possible hardware/firmware/platform combinations.
23
39
24
40
[ UEFI ] : https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface
25
- [ rustc-custom ] : https://doc.rust-lang.org/rustc/targets/custom.html
26
41
27
- ![ uefi-rs running in QEMU] ( https://imgur.com/SFPSVuO.png )
42
+ ![ UEFI App running in QEMU] ( https://imgur.com/SFPSVuO.png )
43
+ Screenshot of an application running in QEMU on an UEFI firmware that leverages
44
+ our Rust library.
45
+
46
+ ## User Documentation
47
+
48
+ <!-- KEEP IN SYNC WITH uefi/README -->
49
+
50
+ For a quick start, please check out [ the UEFI application template] ( template ) .
51
+
52
+ The [ uefi-rs book] contains a tutorial, how-tos, and overviews of some important
53
+ UEFI concepts. Reference documentation for the various crates can be found on
54
+ [ docs.rs] :
55
+
56
+ - [ docs.rs/uefi] ( https://docs.rs/uefi )
57
+ - [ docs.rs/uefi-macros] ( https://docs.rs/uefi-macros )
58
+ - [ docs.rs/uefi-raw] ( https://docs.rs/uefi-raw )
59
+
60
+ For additional information, refer to the [ UEFI specification] [ spec ] .
61
+
62
+ [ spec ] : https://uefi.org/specs/UEFI/2.10
63
+ [ uefi-rs book ] : https://rust-osdev.github.io/uefi-rs/HEAD
64
+ [ docs.rs ] : https://docs.rs
65
+
66
+ ### MSRV
67
+
68
+ See the [ uefi package's README] ( uefi/README.md#MSRV ) .
28
69
29
- ## Project structure
70
+ ## Developer Guide
71
+
72
+ ### Project structure
30
73
31
74
This project contains multiple sub-crates:
32
75
33
76
- ` uefi ` : defines the standard UEFI tables / interfaces.
34
77
The objective is to stay unopinionated and safely wrap most interfaces.
35
78
36
- - ` uefi-macros ` : procedural macros that are used to derive some traits in ` uefi ` .
79
+ - ` uefi-macros ` : procedural macros that are used to derive some traits
80
+ in ` uefi ` .
37
81
38
82
- ` uefi-raw ` : raw types that closely match the definitions in the UEFI
39
83
Specification. Safe wrappers for these types are provided by the ` uefi `
40
84
crate. The raw types are suitable for implementing UEFI firmware.
41
85
42
- - ` uefi-services ` : provides a panic handler, and initializes the ` alloc ` / ` logger ` features.
86
+ - ` uefi-services ` : provides a panic handler, and initializes
87
+ the ` alloc ` / ` logger ` features.
43
88
44
89
- ` uefi-test-runner ` : a UEFI application that runs unit / integration tests.
45
90
46
91
[ log ] : https://github.com/rust-lang-nursery/log
47
92
48
- ## Documentation
49
-
50
- The [ uefi-rs book] contains a tutorial, how-tos, and overviews of some
51
- important UEFI concepts.
52
-
53
- Reference documentation can be found on docs.rs:
54
- - [ docs.rs/uefi] ( https://docs.rs/uefi )
55
- - [ docs.rs/uefi-macros] ( https://docs.rs/uefi-macros )
56
- - [ docs.rs/uefi-raw] ( https://docs.rs/uefi-raw )
57
- - [ docs.rs/uefi-services] ( https://docs.rs/uefi-services )
58
-
59
- For additional information, refer to the [ UEFI specification] [ spec ] .
60
-
61
- [ spec ] : http://www.uefi.org/specifications
62
- [ uefi-rs book ] : https://rust-osdev.github.io/uefi-rs/HEAD
63
-
64
- ## Building and testing uefi-rs
93
+ ### Building and testing uefi-rs
65
94
66
95
Use the ` cargo xtask ` command to build and test the crate.
67
96
68
97
Available commands:
98
+
69
99
- ` build ` : build all the UEFI packages
70
100
- ` --release ` : build in release mode
71
101
- ` --target {x86_64,ia32,aarch64} ` : choose target UEFI arch
@@ -77,9 +107,10 @@ Available commands:
77
107
- ` --warnings-as-errors ` : treat warnings as errors
78
108
- ` run ` : build ` uefi-test-runner ` and run it in QEMU
79
109
- ` --ci ` : disable some tests that don't work in the CI
80
- - ` --disable-kvm ` : disable hardware accelerated virtualization support in QEMU.
81
- Especially useful if you want to run the tests under
82
- [ WSL] ( https://docs.microsoft.com/en-us/windows/wsl ) on Windows.
110
+ - ` --disable-kvm ` : disable hardware accelerated virtualization support in
111
+ QEMU.
112
+ Especially useful if you want to run the tests under
113
+ [ WSL] ( https://docs.microsoft.com/en-us/windows/wsl ) on Windows.
83
114
- ` --example <NAME> ` : run an example instead of the main binary.
84
115
- ` --headless ` : run QEMU without a GUI
85
116
- ` --ovmf-code <PATH> ` : path of an OVMF code file
@@ -94,18 +125,16 @@ most of the library's functionality.
94
125
Check out the testing project's [ ` README.md ` ] ( uefi-test-runner/README.md ) for
95
126
prerequisites for running the tests.
96
127
97
- ## MSRV
98
-
99
- See the [ uefi package's README] ( uefi/README.md#MSRV ) .
100
-
101
128
## Contributing
102
129
103
- We welcome issues and pull requests! For instructions on how to set up a development
104
- environment and how to add new protocols, check out [ CONTRIBUTING.md] ( CONTRIBUTING.md ) .
130
+ We welcome issues and pull requests! For instructions on how to set up a
131
+ development environment and how to add new protocols, check out
132
+ [ CONTRIBUTING.md] ( CONTRIBUTING.md ) .
105
133
106
134
## License
107
135
108
136
The code in this repository is licensed under the Mozilla Public License 2.
109
- This license allows you to use the crate in proprietary programs, but any modifications to the files must be open-sourced.
137
+ This license allows you to use the crate in proprietary programs, but any
138
+ modifications to the files must be open-sourced.
110
139
111
140
The full text of the license is available in the [ license file] ( LICENSE ) .
0 commit comments