Re: THe driver image handle


Laszlo Ersek
 

On 09/04/20 13:04, Tomas Pilar (tpilar) wrote:
Hi Libo,

The convention says that when a driver manages a device, it should find the
relevant IO protocol installed on the device handle (for example a PCI
device will have EFI_PCI_IO_PROTOCOL) and open it using
the EFI_OPEN_PROTOCOL_BY_DRIVER attribute. The driver will keep the
protocol open for the entire duration while it manages the device. You can
use boot services (UefiBootServicesTableLib.h), in particular the
gBS->OpenProtocolInformation() function, to inspect who has a specific
protocol on a specific handle open and with what attributes.

Now, if you are a user and you boot into UEFI shell, all you have to do is
inspect the (shell) handle using the 'dh -d -v <handle>' command.
See also the EfiTestManagedDevice() and EfiTestChildHandle() utility
functions in UefiLib.

Thanks
Laszlo

Join discuss@edk2.groups.io to automatically receive all group messages.