-
-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
I have been trying to get non-exclusive access to a protocol as an app, but I don't understand the API yet
Use
boot::open_protocol
withOpenProtocolAttributes::GetProtocol
. Here's an example:uefi-rs/uefi-test-runner/src/proto/media.rs
Lines 257 to 264 in d30f3c3
let block_io = boot::open_protocol::<BlockIO>( OpenProtocolParams { handle, agent: boot::image_handle(), controller: None, }, OpenProtocolAttributes::GetProtocol, ) The documentation (and spec) are a little confusing since they say it's for drivers, but it works just as well with applications. (You can see in
edk2
thatBY_HANDLE_PROTOCOL
andGET_PROTOCOL
are handled the same way, and you can see example usages in popular UEFI applications such asshim
andgrub
.) We should certainly update our docs to make this less confusing.
Originally posted by @nicholasbishop in #1725
Metadata
Metadata
Assignees
Labels
No labels