On 1 October 2013 18:47, Andrew Fish <[email protected]> wrote:
> The EFI Driver Model, EFI_DRIVER_BINDING_PROTOCOL, assumes that an EFI_HANDLE 
> exists that you can connect to. So the Handle that represents the 1st device 
> path node is usually added by a DXE driver. So on most platform this is 
> usually the PCI root bridge driver. So in the entry point to your driver you 
> need to install a new Handle with the root node of your device path. Then 
> when you driver gets connected that handle exists. If you pass in a NULL 
> handle to InstallMultipleProtocolInterfaces() it will create a new handle.

As I understand it, I first need to create a Handle. I Wrote:

EFI_STATUS
EFIAPI
MyLoadFile (
    IN     EFI_LOAD_FILE_PROTOCOL           *This,
    IN     EFI_DEVICE_PATH_PROTOCOL         *FilePath,
    IN     BOOLEAN                          BootPolicy,
    IN OUT UINTN                            *BufferSize,
    IN     VOID                             *Buffer       OPTIONAL
    )
{
  AsciiPrint("TRY LOAD FILE!\n");
 //return EFI_SUCCESS;
 return EFI_DEVICE_ERROR;
}

static EFI_LOAD_FILE_PROTOCOL mLoadFileProtocolAccess = { MyLoadFile };

EFI_STATUS
EFIAPI
DxeInitializeMyDXE (
  IN EFI_HANDLE           ImageHandle,
  IN EFI_SYSTEM_TABLE     *SystemTable
  )
{
  EFI_STATUS                Status;
  EFI_HANDLE                MyDevice=NULL;

  Status = gBS->InstallMultipleProtocolInterfaces(
       &MyDevice,
       &gEfiLoadFileProtocolGuid,
       &mLoadFileProtocolAccess,
       NULL
      );

  return Status;
}

As I understand this code must create new Handle and do nothing.
After what I may to bind this Handle to device path. (It is a next stage for me)

When running in QEMU program, UEFI stops after some while. What I make wrong?

> So in the entry point to your driver you need to install a new Handle with 
> the root node of your device path

I do not understand, how can I do it?


---
Best regards,
Leonid Myravjev

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to