From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 606051A1E56 for ; Wed, 19 Oct 2016 13:41:28 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP; 19 Oct 2016 13:41:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,367,1473145200"; d="scan'208";a="21459628" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 19 Oct 2016 13:41:27 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 19 Oct 2016 13:41:27 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.170]) by fmsmsx111.amr.corp.intel.com ([169.254.12.12]) with mapi id 14.03.0248.002; Wed, 19 Oct 2016 13:41:27 -0700 From: "Carsey, Jaben" To: Saqib Khan , Andrew Fish CC: "edk2-devel@ml01.01.org" , Laszlo Ersek , "Carsey, Jaben" Thread-Topic: [edk2] How to get BBS_BBS_DEVICE_PATH from BOOTXXXX variable Thread-Index: AQHSKWOwSYQOaiFn2Ua/7sISijMvgaCu8CMAgAAP1QCAAYy8AP//spQw Date: Wed, 19 Oct 2016 20:41:26 +0000 Message-ID: References: <4e344fbc-5d83-c963-2867-461d40832c8d@redhat.com> <3F7BA679-11EF-4067-92D7-CC58777CB6DC@apple.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2Y1ZjdhZTItNDg0NS00Y2QzLWJiMTItYzI5M2M0MjE4OTM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtHMWJCRlQ2NG1hMXJYVXZ0d2tEbEJtQzFXSVlySkVrTVlYS2xOTkczSDg9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: How to get BBS_BBS_DEVICE_PATH from BOOTXXXX variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 20:41:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Have you examined the BCFG command in the UEFI Shell? =20 It does this exact behavior and the code is at: ShellPkg\Library\UefiBcfgCo= mmandLib\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 > Cc: edk2-devel@ml01.01.org; Laszlo Ersek > Subject: Re: [edk2] How to get BBS_BBS_DEVICE_PATH from BOOTXXXX > variable >=20 > Hi, so i have parsed the structure as follow : >=20 >=20 >=20 >=20 >=20 >=20 >=20 > *BootVariable =3D mGetVariable(Name, &gEfiGlobalVariableGuid, > &BootVariableSize, NULL);LDAttr =3D BootVariable[0];FilePathListLength = =3D > (BootVariable+2);Ptr =3D (BootVariable+3); // for description * >=20 >=20 >=20 > *for FilePathList[] Ptr+=3D StrSize((CHAR16 *)Ptr); CopyMem (Ptr, > DevicePath, *FilePathListLength);* >=20 >=20 > I am able to get LDAttr ,FilePathListLength and description but >=20 > when i try to check DevicePath->Type it always return 0x01( Hardware Devi= ce > Path) for each device . >=20 >=20 > I have hard drive with legacy OS(BBS_DEVICE_PATH). So it should not alway= s > return 0x01 .What i am doing wrong in parsing ? >=20 > Thanks >=20 > On Tue, Oct 18, 2016 at 11:37 PM, Andrew Fish wrote: >=20 > > > > > On Oct 18, 2016, at 10:40 AM, Laszlo Ersek 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 t= o > > > provide useful information. > > > > > > Please refer to "3.1.3 Load Options" in the UEFI v2.6 spec, available > > > for download from . > > > > > > Locating the matching structure definition in the edk2 tree is left a= s > > > 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 > > > > >=20 >=20 > -- > Regards > Saqib Ahmed Khanzada > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel