File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 10
10
- [ Using Protocols] ( how_to/protocols.md )
11
11
- [ Drawing to the Screen] ( how_to/drawing.md )
12
12
- [ Building drivers] ( how_to/building_drivers.md )
13
+ - [ Combining Rust ` std ` with ` uefi ` ] ( how_to/rust-std.md )
13
14
- [ Concepts] ( concepts/introduction.md )
14
15
- [ Boot Stages] ( concepts/boot_stages.md )
15
16
- [ Tables] ( concepts/tables.md )
Original file line number Diff line number Diff line change
1
+ # Combining Rust ` std ` with ` uefi `
2
+
3
+ ## TL;DR
4
+
5
+ In Mid-2024, we recommend to stick to our normal guide. Use this document as
6
+ guide and outlook for the future of UEFI and Rust.
7
+
8
+ ## About
9
+
10
+ Programs created with the ` uefi ` crate are typically created with ` #![no_std] `
11
+ and ` #![no_main] ` . A ` #![no_std] ` crate can use the ` core ` and ` alloc ` parts of
12
+ Rust's standard library, but not ` std ` . A ` #![no_std] ` executable does not use
13
+ the standard main entry point, and must define its own entry point; ` uefi `
14
+ provides the ` #[entry] ` macro for this purpose.
15
+
16
+ Rust has added partial support for building UEFI executables without
17
+ ` #![no_std] ` and ` #![no_main] ` , thus, the standard way. Some functionality
18
+ requires a nightly toolchain, they are gated by the ` uefi_std ` feature (Rust
19
+ language feature, not ` uefi ` crate feature). Follow the
20
+ [ tracking issue] ( https://github.com/rust-lang/rust/issues/100499 ) for details.
21
+
22
+ ## Code Example
23
+
24
+ Please refer to [ ` <repo>/uefi-std-example ` ] ( /uefi-std-example/README.md ) to
25
+ see a specific example. The relevant ` main.rs ` looks as follows:
26
+
27
+ ``` rust
28
+ {{#include .. / .. / .. / uefi - std - example / src / main . rs}}
29
+ ```
You can’t perform that action at this time.
0 commit comments