From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E9F320D77DC7 for ; Thu, 6 Apr 2017 13:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491510648; x=1523046648; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=I83z8e7ClO1ZnrEgxX/mZhTcMV2b6TzseKgobWZznuk=; b=vyrmpuAODHJjK53VRaFEcAbaKEaf4jGFLoCO41hSDBys//2ieWF99yrh r3+jJk2/TQz5yGi9PdZOtkxNFvtmIQ==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2017 13:30:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,161,1488873600"; d="scan'208";a="85983195" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 06 Apr 2017 13:30:47 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Apr 2017 13:30:46 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.246]) by FMSMSX154.amr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0319.002; Thu, 6 Apr 2017 13:30:46 -0700 From: "Carsey, Jaben" To: Amit kumar , Andrew Fish CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] How to get fs index from controller handle. Thread-Index: AQHSrr3tutVovAtWfUWhYEt1ieg82aG4pFkAgABdrwD//8msUA== Date: Thu, 6 Apr 2017 20:30:46 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjA0MmFlZGMtYWE0Yi00ZGM4LTkwM2MtYzMyNGIwYmQ1OWMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InNTS2xCdHgwYjhzdUphQnd6NmNsZ2R2dzI1VDhuTEk1KzFJWW5EY1VORHM9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: How to get fs index from controller handle. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 20:30:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable That's the way to do it. the hard work is around finding the DevicePath fo= r the application you want to run to pass to LoadImage. > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Amit kumar > Sent: Thursday, April 06, 2017 9:45 AM > To: Andrew Fish > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] How to get fs index from controller handle. > Importance: High >=20 > Hi, >=20 >=20 > Can i use gbs->loadimage() and gbs->startimage() to load an efi applicati= on > and execute it. >=20 > Suppose i have a app1.efi and from app1.efi i want to execute app2.efi. >=20 > Or is there some other way to do it ? >=20 > Not considering ShellExecute(); >=20 > Amit >=20 > ________________________________ > From: afish@apple.com on behalf of Andrew Fish > > Sent: Thursday, April 6, 2017 4:39:22 PM > To: Amit kumar > Cc: edk2-devel@lists.01.org > Subject: Re: [edk2] How to get fs index from controller handle. >=20 >=20 > On Apr 6, 2017, at 3:30 AM, Amit kumar > > wrote: >=20 > Hi, >=20 > I want to get the fs index from the controller handle. > e.g In map command i see my controller is mapped to fs10. > So i there any API i can use in my code to get the fs index( which is 10 = as in > example) from the controller handle. >=20 >=20 > Amit, >=20 > It is important to remember that fs0:, and the other device names are a S= hell > concept and not an EFI concept. So they only exist in the context of the = shell. >=20 > I took a quick look and I did not see an easy way to do this with the cur= rent > Shell APIs. >=20 > In the older Shell you could use this protocol EfiShellEnvironment2 Pro= tocol > has a function that converts a EFI_DEVICE_PATH_PROTOCOL (would be on > your controller handle) to a CHAR16. Thus you can get the volume name the > Shell would display to the user. I don't the index exists as a concept. = So > EFI_SHELL_ENVIRONMENT2.GetFsName() and > EFI_SHELL_ENVIRONMENT2.GetFsDevicepath() are the closest thing I can > think of. > https://github.com/tianocore/edk2/blob/master/ShellPkg/Include/Protocol/ > EfiShellEnvironment2.h#L812 >=20 > The only problem with that is EfiShellEnvironment2 is not produced by the > Shell by default. >=20 > ## This flag is used to control the protocols produced by the shell > # If TRUE the shell will produce EFI_SHELL_ENVIRONMENT2 and > EFI_SHELL_INTERFACE >=20 > gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols|FALSE|BOOLEAN > |0x00000002 >=20 > I've use the EFI_SHELL_ENVIRONMENT2 in the past to enable a non Shell > application to print out volume names that match the map command of the > shell. Hopefully some one knows how to do this in the modern Shell? >=20 > Thanks, >=20 > Andrew Fish >=20 > Regards > Amit > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel