File tree 1 file changed +17
-0
lines changed
src/doc/rustc/src/platform-support
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,22 @@ rustup target add x86_64-unknown-uefi
82
82
cargo build --target x86_64-unknown-uefi
83
83
```
84
84
85
+ ### Building a driver
86
+
87
+ There are three types of UEFI executables: application, boot service
88
+ driver, and runtime driver. All of Rust's UEFI targets default to
89
+ producing applications. To build a driver instead, pass a
90
+ [ ` subsystem ` ] [ linker-subsystem ] linker flag with a value of
91
+ ` efi_boot_service_driver ` or ` efi_runtime_driver ` .
92
+
93
+ Example:
94
+
95
+ ``` toml
96
+ # In .cargo/config.toml:
97
+ [build ]
98
+ rustflags = [" -C" , " link-args=/subsystem:efi_runtime_driver" ]
99
+ ```
100
+
85
101
## Testing
86
102
87
103
UEFI applications can be copied into the ESP on any UEFI system and executed
@@ -313,6 +329,7 @@ The current implementation of std makes `BootServices` unavailable once `ExitBoo
313
329
Note: It should be noted that it is up to the user to drop all allocated memory before ` ExitBootServices ` is called.
314
330
315
331
[ efi-crate ] : https://github.com/gurry/efi
332
+ [ linker-subsystem ] : https://learn.microsoft.com/en-us/cpp/build/reference/subsystem
316
333
[ r-efi ] : https://github.com/r-efi/r-efi
317
334
[ uefi-rs ] : https://github.com/rust-osdev/uefi-rs
318
335
[ uefi-run ] : https://github.com/Richard-W/uefi-run
You can’t perform that action at this time.
0 commit comments