From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 F31CF81ADB for ; Mon, 9 Jan 2017 10:22:15 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 09 Jan 2017 10:22:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,340,1477983600"; d="scan'208";a="806870003" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jan 2017 10:22:12 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 Jan 2017 10:22:12 -0800 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.29]) by fmsmsx115.amr.corp.intel.com ([169.254.4.4]) with mapi id 14.03.0248.002; Mon, 9 Jan 2017 10:22:12 -0800 From: "Jarlstrom, Laurie" To: "Carsey, Jaben" , Rafael Machado , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [edk2] Improvement at Wiki (EFI_SHELL_INTERFACE) Thread-Index: AQHSao87EbmXbEIsjk6q+SHoZzK2JKEwZ+ZQ Date: Mon, 9 Jan 2017 18:22:11 +0000 Message-ID: <10380531DF222B45964BE3E93EFE5F045D27CA39@fmsmsx104.amr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDJhM2U5YjItNzQ2NC00Y2YyLTg1NWQtMGE1N2FjMzM4NjI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ijh1NVlUcFlVUjFLWk1iXC9tdmpYcDY1cU9XNXJMMkt6N0dWOTlSZDkzcllzPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: Improvement at Wiki (EFI_SHELL_INTERFACE) 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: Mon, 09 Jan 2017 18:22:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Rafael, You may have been referring to the EFI_SHELL_INTERFACE that is the older pr= otocol from the EFI Shell Interface protocol from EDK (1) shell (no Specifi= cation). If you are using older UEFI Firmware with the EDK 1 Shell not the EDK II Sh= ell 2 then you can use this protocol. You can check which Shell your app is getting called from by checking which= of the protocols it getting used: Here is a snippet of code to determine : EFI_STATUS EFIAPI UefiMain ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol; // EfiShell= Parameters.h EFI_SHELL_INTERFACE *EfiShellInterface; // EfiShellInterf= ace.h UINTN Argc; CHAR16 **Argv; EFI_GUID mEfiShellParametersProtocolGuid =3D EFI_SHELL_PARAMETERS_PROTOCO= L_GUID; // Current UEFI Shell 2. EFI_GUID mEfiShellInterfaceGuid =3D SHELL_INTERFACE_PROTOCOL_GUID; // O= lder EDK Shell 1 =20 //Initialize local protocol pointers EfiShellParametersProtocol =3D NULL; EfiShellInterface =3D NULL; // check input parameters from command line using UEFI Shell 2.0 Status =3D gBS->OpenProtocol(ImageHandle, &mEfiShellParametersProtocolGuid, (VOID **)&EfiShellParametersProtocol, ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL );=20 if (!EFI_ERROR(Status)) { // use shell 2.0 interface Print(L"Using UEFI Shell 2.0 Parameter Protocol\n");=20 Argc =3D EfiShellParametersProtocol->Argc; Argv =3D EfiShellParametersProtocol->Argv; // Call our main with Argc / Argv parameters=20 SampleMain ( Argc, Argv); // TODO what you need to do for using UEFI= Shell 2 }else{ // else check if EFI Shell 1.0=20 Status =3D gBS->OpenProtocol(ImageHandle, &mEfiShellInterfaceGuid, (VOID **)&EfiShellInterface, ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); if (!EFI_ERROR(Status))=20 { Print(L"Using EFI Shell 1.0 Interface Protocol\n");=20 Argc =3D EfiShellInterface->Argc; Argv =3D EfiShellInterface->Argv; SampleMain ( Argc, Argv); // TODO What you need to do to use EFI Shell= 1.0=20 }else { Print(L"\nGetting Shell params did NOT work: \n"); } } =20 return EFI_SUCCESS; } thanks, Laurie =A0 laurie.jarlstrom@intel.com Intel SSG/STO/EBP (503) 712-9395 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Cars= ey, Jaben Sent: Monday, January 09, 2017 7:44 AM To: Rafael Machado; edk2-devel@lists.01.org Cc: Carsey, Jaben Subject: Re: [edk2] Improvement at Wiki (EFI_SHELL_INTERFACE) Rafael, Actually it's the opposite. EFI_SHELL_INTERFACE is the older and deprecate= d protocol. I do not know of any active development using that protocol. -Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Rafael Machado > Sent: Saturday, January 7, 2017 1:14 PM > To: edk2-devel@lists.01.org > Subject: [edk2] Improvement at Wiki (EFI_SHELL_INTERFACE) > Importance: High >=20 > Hi everyone >=20 > During a a development I faced the following wiki information at=20 > tianocore's > github: >=20 > https://github.com/tianocore/tianocore.github.io/wiki/Creating-a-Shell > - > Application#Using_EFI_SHELL_PROTOCOL >=20 > I remember a case when I was working with a system that didn't have a=20 > instance of the EFI_SHELL_PARAMETERS_PROTOCOL, and the solution was to=20 > use the EFI_SHELL_INTERFACE protocol, that seems to be a newer=20 > protocol to be used when doing something like what the wiki presents. >=20 > I believe it would be nice to update this wiki adding this information. >=20 > Thanks and Regards > Rafael R. Machado > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel