File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 9
9
- [How-to](how_to/introduction.md)
10
10
- [Using Protocols](how_to/protocols.md)
11
11
- [Drawing to the Screen](how_to/drawing.md)
12
+ - [Building drivers](how_to/building_drivers.md)
12
13
- [Concepts](concepts/introduction.md)
13
14
- [Boot Stages](concepts/boot_stages.md)
14
15
- [Tables](concepts/tables.md)
Original file line number Diff line number Diff line change
1
+ # Building drivers
2
+
3
+ There are [three types][spec-images] of UEFI images:
4
+ * Application
5
+ * Boot service driver
6
+ * Runtime driver
7
+
8
+ [By default][target-flag], Rust's UEFI targets produce applications. This can be
9
+ changed by passing a [`subsystem`] linker flag in `rustflags` and setting the
10
+ value to `efi_boot_service_driver` or `efi_runtime_driver`.
11
+
12
+ Example:
13
+
14
+ ```toml
15
+ # In .cargo/config.toml:
16
+ [build]
17
+ rustflags = ["-C", "link-args=/subsystem:efi_runtime_driver"]
18
+ ```
19
+
20
+ [spec-images]: https://uefi.org/specs/UEFI/2.10/02_Overview.html#uefi-images
21
+ [target-flag]: https://github.com/rust-lang/rust/blob/f4d794ea0b845413344621d89f6c945062748485/compiler/rustc_target/src/spec/base/uefi_msvc.rs#L33
22
+ [`subsystem`]: https://learn.microsoft.com/en-us/cpp/build/reference/subsystem?view=msvc-170
You can’t perform that action at this time.
0 commit comments