From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0ED711A1E2A for ; Thu, 20 Oct 2016 00:29:35 -0700 (PDT) Received: by mail-it0-x22b.google.com with SMTP id e187so35253602itc.1 for ; Thu, 20 Oct 2016 00:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PGkq++8LCWbG2utIqT8APenUUAjjwju20pQ1EucUsio=; b=mz9Osp5hORls+J/jTwNI2hQziAx2yerpgtPSRGDgwLQ5/S7qZR0TA9z8MzIuTjMxlw 4cHpIMx5H+at4v63Keo27BAuVva3v7AKXyft1eQJW/MY/MynVP6E9fGkyUJD15xLVJbj EJEgT1sv7V4c/cJIpPA31wDBdBu5MouMzWkhcHQMhFA2Aby83tY57kvlBb68eM/tN1l+ RouT4HislmoR/ZaM3bvhUYdpgn6hEURI47s6SKNyIC2A1cYNf27c6JwIGGREmSlTGzcD HypDcnekiMTYmtPZAy7CU8UmmXgRCe3iPNQm9oqZjHKXdb+lMmcx3GbGpflfSpSXvbDA yAYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PGkq++8LCWbG2utIqT8APenUUAjjwju20pQ1EucUsio=; b=McalvkIN28mqD+wPkPgehFKiIoa8e/gsRzFBn+7M5efmgsPYC4Zw1QZ7JY8iMyXHnE VR1X+2pSvcZWTHq/RW5B/kXGAXoZ470PFFX76cpy0kNzJ5j8f0pnsQY7cKCBDCSHugMs LqohotFtORBS6S/V2+HaY5fgaika5Ym70rbquV+CIeO+yU1FJcmT341BMosWv+aanSU+ 0EzrMfXTPgSjGgonVdgiZh1E1qvxIW2FctlyKX/oNvvPBqcyfIV7I/CXJ8AXTGW7C/Ic 2cG0zTItDZ7AzNGZiRicW6rt2awC1lfUx53dBStfI17KYU92DCIHXYCiJtwbWO+ZUotY nIcg== X-Gm-Message-State: AA6/9Rn7la1TzalJwVddSO+vA6h1VoLGe4462qNypx7ZSPPxMYFgYtC6A0Y9/P/D93N2GWXpFhNwdVUvSYlj0g== X-Received: by 10.36.48.74 with SMTP id q71mr6457209itq.116.1476948574259; Thu, 20 Oct 2016 00:29:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.68.18 with HTTP; Thu, 20 Oct 2016 00:29:33 -0700 (PDT) In-Reply-To: References: <4e344fbc-5d83-c963-2867-461d40832c8d@redhat.com> <3F7BA679-11EF-4067-92D7-CC58777CB6DC@apple.com> From: Saqib Khan Date: Thu, 20 Oct 2016 12:29:33 +0500 Message-ID: To: "Carsey, Jaben" Cc: Andrew Fish , "edk2-devel@ml01.01.org" , Laszlo Ersek X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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: Thu, 20 Oct 2016 07:29:35 -0000 Content-Type: text/plain; charset=UTF-8 *BootVariable = mGetVariable(Name, &gEfiGlobalVariableGuid, &BootVariableSize, NULL);Ptr = (BootVariable+3); Print(L" %s",(CHAR16 *)(Ptr)); DevicePath =AllocateZeroPool (*FilePathListLength) ; Ptr+= StrSize((CHAR16 *)Ptr); CopyMem (DevicePath, Ptr, *FilePathListLength);* As Carsey suggested i used the same Math in order to get DevicePath but in my case it is not working As documentation this data structure is not aligned so i am assuming that just after description there should be FilePathList ,so if i CopyMem * (**FilePathListLength) bytes to DevicePath i should get the right value but i am getting garbage. On Thu, Oct 20, 2016 at 1:41 AM, Carsey, Jaben wrote: > 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 > > Cc: edk2-devel@ml01.01.org; Laszlo Ersek > > 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 wrote: > > > > > > > > > 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 > to > > > > 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 > 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 > -- Regards Saqib Ahmed Khanzada