Hello:
                I think your code has no problem, it can run on my board with 
success.
                You cannot use guid command to check if a protocol a installed 
in your system, shell will add some known GUIDs into output result even they 
are not installed. You can use "dh -p DpathToText" command to see if 
DevicePathToText is installed. I think your BIOS does not include 
MdeModulePkg\Universal\DevicePathDxe module to install this protocol.

Thanks
Elvin
From: duck wilson [mailto:duck.54...@gmail.com]
Sent: Friday, October 12, 2012 2:12 PM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] Help with EFI_DEVICE_PATH_TO_TEXT_PROTOCOL

Greetings,

I am having difficulty in getting an interface instance with both 
LocateHandleBuffer
and LocateProtocol for the EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, in both cases the
result is EFI_NOT_FOUND. My build environment is UDK2010.SR1.UP1 with no changes
other than the patch for GCC 4.7 on openSUSE 12.2. The hardware platform is 
X86_64
with UEFI 2.0 firmware. I am currently testing using the platform firmware (not
emulation).

Since I am new to UEFI/EDK2 I would like to believe the problem is moi, but 
after
too many hours I am beginning to believe it is the platform firmware. Any help
would be much appreciated.

To reduce the problem to simplest form I created an application that does 
nothing
more than a LocateProtocol call and print the result (also did the same exercise
with LocateHandleBuffer). The program source and inf files are listed below. The
program was added to MdeModulePkg/Application/Locate. MdeModulePkg.dsc was 
changed
to add the new component then the program was built with:

build -m MdeModulePkg/Application/Locate/Locate.inf

Got a clean build with no problem. Copied Locate.efi to the EFI partition. 
Booted
into the EFI shell. Run the program and get the not found result.

Running the shell GUID command reveals that the EFI_DEVICE_PATH_TO_TEXT_PROTOCOL
is registered and the guid is correct. At this point I am stumped.

TIA!

Locate.c

#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/DevicePathToText.h>

EFI_STATUS
EFIAPI
UefiMain (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  EFI_STATUS                        Status;
  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  *Interface;

  Status = gBS->LocateProtocol (
                  &gEfiDevicePathToTextProtocolGuid,
                  NULL,
                  (VOID **) &Interface
                  );
  if (EFI_ERROR (Status)) {
    Print (L"LocateProtocol error: %r\n", Status);
  }
  else {
    Print (L"DevicePathToTextProtocol found.\n");
  }

  return EFI_SUCCESS;
}


Locate.inf

[Defines]
  INF_VERSION                    = 0x00010005
  BASE_NAME                      = Locate
  FILE_GUID                      = fa7cd993-abf6-4333-85e6-493ba95661d0
  MODULE_TYPE                    = UEFI_APPLICATION
  VERSION_STRING                 = 1.0
  ENTRY_POINT                    = UefiMain


[Sources]
  Locate.c

[Packages]
  MdePkg/MdePkg.dec
  MdeModulePkg/MdeModulePkg.dec

[LibraryClasses]
  UefiApplicationEntryPoint
  UefiBootServicesTableLib
  UefiLib

[Protocols]
  gEfiDevicePathToTextProtocolGuid
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to