You could also look at the DRIVER???? (DRIVER0001, DRIVER0002, etc...) And 
BOOT???? (BOOT0001, BOOT0002, etc...) UEFI Variables to learn which device 
paths are being used for OS or driver loading (then determine which drives 
these are on).  That would not work in all cases where an OS loader is placed 
in a default load location, but should cover most post-OS install instances I 
think.

-Jaben

From: Galla Rao [mailto:[email protected]]
Sent: Tuesday, October 01, 2013 8:52 AM
To: [email protected]
Subject: Re: [edk2] Is there a way to determine, the disk is GPT and it is 
bootable

Hi Sathya

There is a bit defined in each partition entry, in the fields attributes
which may be helpful to determine if this partition is bootable

Bit 0 Required Partition

If this bit is set, the partition is required for the platform to function. The 
owner/
creator of the partition indicates that deletion or modification of the contents
can result in loss of platform features or failure for the platform to boot or
operate. The system cannot function normally if this partition is removed, and 
it
should be considered part of the hardware of the system. Actions such as
running diagnostics, system recovery, or even OS install or boot could
potentially stop working if this partition is removed. Unless OS software or
firmware recognizes this partition, it should never be removed or modified as
the UEFI firmware or platform hardware may become non-functional.

Thanks
Ranga


On Tue, Oct 1, 2013 at 9:08 PM, Galla Rao 
<[email protected]<mailto:[email protected]>> wrote:
Hi Sathya

I think you can try to locate Primary GPT in LBA1 through block IO->Readblock 
and check for signature in the GPT header

Uefi Spec Section
5.3.2 GPT Header
Signature 0 8 Identifies EFI-compatible partition table
header. This value must contain the ASCII
string "EFI PART", encoded as the 64-bit
constant 0x5452415020494645.

Thanks
Ranga

On Mon, Sep 30, 2013 at 10:58 PM, Prakash, Sathya 
<[email protected]<mailto:[email protected]>> wrote:
I am writing a shell tool to send some I/O to hard drives.  I want to remove 
the OS installed drives from my list of drives to work on.  I used to check 
legacy boot drives by reading the MBR and looking for boot partitions.  I am 
not able to find a way to identify the GPT based UEFI OS installed disks.  Any 
help is appreciated.

Thanks
Sathya

------------------------------------------------------------------------------
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=60133471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
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