Firmware Encoding Index UEFI DEV Mailing List Search This Site





Subject:
Re: [edk2] Need pointers on how to handle GPT disk in EDK2
From:
"Gambhir, Yatin" <yatin.g@ti.com>
Date:
10/23/2010 6:55 AM
To:
"edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Thanks a lot!

Let me digest on this and try implementing!

Thanks again!

 

Warm Regards,

Yatin


From: Andrew Fish [mailto:afish@apple.com]
Sent: Friday, October 22, 2010 3:47 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Need pointers on how to handle GPT disk in EDK2

 

Yatin,

 

The stored information is in the device path. It is on the same handle as the Block IO protocol produced by the partition driver. 

 

The hard drive media device path is detailed in section 9.3.6.1 of the UEFI specification. The device path is a series of nodes, so the device path on the handle created by the partition driver will include the device path from the physical block IO device with the Hard Drive Media Device path entry appended to the end.

 

There is a device path lib in the MdePkg for dealing with device paths.

 

So you could use a lib call to get all the handles that support BlockIO. You could then check BlockIo->Media->LogicalPartition == TRUE (most likely produced by the partition driver). You could then use gBS->HandleProtocol () on that handle to retrieve the device path protocol. The device path protocol would contain a hard driver media device path node that contains the information you are looking for.   

 

Andrew Fish

 

 

 

 

On Oct 22, 2010, at 3:28 PM, Gambhir, Yatin wrote:



Hi,

 

I am trying to generate the list of all partitions (and their info) detected by UEFI.

I have few questions regarding detecting and working of GPT partitions on UEFI and the interface protocol associated with GPT disks.

 

When I look into Partition.c (mdemodulepkg\universal\disk\partitiondxe),

I observe that code exits to find EFI partition (identified with GUID = gEfiPartTypeSystemPartGuid) for given devicepath.

I note following code sequence if it detects EFI partition:

PartitionDriverBindingStart() => PartitionInstallGptChildHandles() => PartitionInstallChildHandle() => gBS->InstallMultipleProtocolInterfaces()

 

Now, as I try to understand InstallMultipleProtocolInterfaces() near line 695 in Partition.c,

I note that ‘gEfiPartTypeSystemPartGuid’ is installed with ‘NULL’ interface pointer.

 

Line 684:           Private->EspGuid = &gEfiPartTypeSystemPartGuid;

.

.

.

 Line 695:          Status = gBS->InstallMultipleProtocolInterfaces (

                  &Private->Handle,

                  &gEfiDevicePathProtocolGuid,

                  Private->DevicePath,

                  &gEfiBlockIoProtocolGuid,

                  &Private->BlockIo,

                  Private->EspGuid,

                  NULL,

                  NULL );

 

My question is:

How can I retrieve information of EFI partition (devicepath, GUID, partition number, StartLBA, Size, EndLBA etc.) given that it was detected and installed in partition.c ?

            If I try to use gBS->LocateProtocol() on gEfiPartTypeSystemPartGuid, it returns interface handle NULL ( may be due to ‘NULL’ pointer was registered with this GUID above?).

            The Status of LocateProtocol() is Success if GPT partition GUID was installed earlier. Otherwise it returns Not Found (this is inline with logic ofInstallMultipleProtocolInterfaces() ).

In both cases, interface handle is returned as NULL.

           

            So under which IO protocol does the partition information is stored?  Can it be retrieved?

How can I access this information and find out corresponding blk#: device?

             

 

Many thanks!

 

Warm Regards,

Yatin

 

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

 



------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel