public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Saqib Khan <saqib.khan2011@gmail.com>, Andrew Fish <afish@apple.com>
Cc: "edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>,
	Laszlo Ersek <lersek@redhat.com>,
	"Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: How to get BBS_BBS_DEVICE_PATH from BOOTXXXX variable
Date: Wed, 19 Oct 2016 20:41:26 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C54A9F890@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <CAF=YJJ-FBZyVz-pj1KQt632EaMc1WXHng_GfS_yWbc9_FNbCJA@mail.gmail.com>

Have you examined the BCFG command in the UEFI Shell?  

It does this exact behavior and the code is at: ShellPkg\Library\UefiBcfgCommandLib\bcfg.c.

-Jaben

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Saqib Khan
> Sent: Wednesday, October 19, 2016 11:18 AM
> To: Andrew Fish <afish@apple.com>
> Cc: edk2-devel@ml01.01.org; Laszlo Ersek <lersek@redhat.com>
> Subject: Re: [edk2] How to get BBS_BBS_DEVICE_PATH from BOOTXXXX
> variable
> 
> Hi, so i have parsed the structure as follow :
> 
> 
> 
> 
> 
> 
> 
> *BootVariable = mGetVariable(Name, &gEfiGlobalVariableGuid,
> &BootVariableSize, NULL);LDAttr = BootVariable[0];FilePathListLength =
> (BootVariable+2);Ptr = (BootVariable+3); // for description *
> 
> 
> 
> *for FilePathList[] Ptr+= StrSize((CHAR16 *)Ptr);         CopyMem (Ptr,
> DevicePath, *FilePathListLength);*
> 
> 
> I am able to get LDAttr ,FilePathListLength and description but
> 
> when i try to check DevicePath->Type it always return 0x01( Hardware Device
> Path) for each device .
> 
> 
> I have hard drive with legacy OS(BBS_DEVICE_PATH). So it should not always
> return 0x01 .What i am doing wrong in parsing ?
> 
> Thanks
> 
> On Tue, Oct 18, 2016 at 11:37 PM, Andrew Fish <afish@apple.com> wrote:
> 
> >
> > > On Oct 18, 2016, at 10:40 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> > >
> > > On 10/18/16 19:18, Saqib Khan wrote:
> > >> Hi,
> > >> I can not find structure of BOOTXXXX variable, Can any one help how to
> > >> extract device path from BOOTXXXX variable.
> > >
> > > In UEFI-related questions, the UEFI specification has a fair chance to
> > > provide useful information.
> > >
> > > Please refer to "3.1.3 Load Options" in the UEFI v2.6 spec, available
> > > for download from <http://www.uefi.org/specifications>.
> > >
> > > Locating the matching structure definition in the edk2 tree is left as
> > > an exercise to the reader ;)
> > >
> >
> > Chapter 3 Boot Manager.
> >
> > The structure is EFI_LOAD_OPTION but some of the fields are variable
> > length so you have to do math to figure stuff out.
> >
> > Thanks,
> >
> > Andrew Fish
> >
> >
> > > Laszlo
> > >
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> >
> 
> 
> --
> Regards
> Saqib Ahmed Khanzada
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2016-10-19 20:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 17:18 How to get BBS_BBS_DEVICE_PATH from BOOTXXXX variable Saqib Khan
2016-10-18 17:40 ` Laszlo Ersek
2016-10-18 18:37   ` Andrew Fish
2016-10-19 18:17     ` Saqib Khan
2016-10-19 20:41       ` Carsey, Jaben [this message]
2016-10-20  7:29         ` Saqib Khan
2016-10-20 15:44           ` Carsey, Jaben

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB6E33457884FA40993F35157061515C54A9F890@FMSMSX103.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox