File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/doc/rustc/src/platform-support Expand file tree Collapse file tree 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
8282cargo build --target x86_64-unknown-uefi
8383```
8484
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+
85101## Testing
86102
87103UEFI 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
313329Note: It should be noted that it is up to the user to drop all allocated memory before ` ExitBootServices ` is called.
314330
315331[ efi-crate ] : https://github.com/gurry/efi
332+ [ linker-subsystem ] : https://learn.microsoft.com/en-us/cpp/build/reference/subsystem
316333[ r-efi ] : https://github.com/r-efi/r-efi
317334[ uefi-rs ] : https://github.com/rust-osdev/uefi-rs
318335[ uefi-run ] : https://github.com/Richard-W/uefi-run
You can’t perform that action at this time.
0 commit comments