On Feb 13, 2014, at 4:34 AM, ASM <[email protected]> wrote:

> Hi folks!
> 
> I am writing bootloader.
> 
> The bootloader need to found all GPT partition with vendor GUID.
> 
> I can to get all Handles of DiskIO protocol.
> I can to get a Path protocol and select only MEDIA_DEVICE_PATH,
> MEDIA_HARDDRIVE_DP.
>> From PathDev I can to get all UniquePartitionGUID.
> But how can get PartitionTypeGUID?
> 
> I can see one way:
> * find a partition.
> * find a parent handle of the partition
> * read PrimaryHeader
> * find in the EFI_PARTITION_ENTRYs a UniquePartitionGUID that equal
> the partition UniquePartitionGUID.
> * save PartitionTypeGUID if it was found
> 
> How can I do it more simple?
> 

The partition driver has example code of how to do what you need. 
You will notice that the partition driver does not produce BlockIo protocols 
for OS Specific partitions. So I can’t think of any shortcut for you. 

 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c,





    if ((Entry->Attributes & BIT1) != 0) {
      //
      // If Bit 1 is set, this indicate that this is an OS specific GUID 
partition. 
      //
      PEntryStatus[Index1].OsSpecific = TRUE;
    }
...
  for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {
    Entry = (EFI_PARTITION_ENTRY *) ((UINT8 *) PartEntry + Index * 
PrimaryHeader->SizeOfPartitionEntry);
    if (CompareGuid (&Entry->PartitionTypeGUID, &gEfiPartTypeUnusedGuid) ||
        PEntryStatus[Index].OutOfRange ||
        PEntryStatus[Index].Overlap ||
        PEntryStatus[Index].OsSpecific
        ) {
      //
      // Don't use null EFI Partition Entries, Invalid Partition Entries or OS 
specific
      // partition Entries
      //
      continue;
    }
Thanks,

Andrew Fish

> ---
> Best regards,
> Leonid Myravjev
> 
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to