From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-in7.apple.com (mail-out7.apple.com [17.151.62.29]) (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 8313E21A0480E for ; Thu, 6 Apr 2017 13:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1491511729; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AkBNjajcKX8HdjbJkeliJpBvYbJj7L5GllKdVuRl7gw=; b=mNu+Rmnp+aNnMEquU9k0bg4AZ7jzDsX1UntfPM/BkV45ceUeaHY9z1g6z8eCjj9z ckCjmSzLWUfY3m7EmfKfqTHezXrFAc2T9RxxJIcf8HWT+/2mJrbdxifBotBzel5o jLn7eswA1CKb5p7vc4T6kmll5yGRJAa0O7/+ImwX1VVFnjHm9QyAfX8D9hCSN3zf l3Fl4hOLsAh/eQjFpNvmKPd0JTTfSDNTIdVURZhdTJsW12+5kxpDPZiO+cYqY9s6 kNkGa16KJlInQ2WByLRvkYbg5PznBwr1QaBb51Re/RFoac6C/Xps6jqwE7vYO/gF I5wBjauBOR3wEcZ3CcvCDg==; Received: from relay2.apple.com (relay2.apple.com [17.128.113.67]) by mail-in7.apple.com (Apple Secure Mail Relay) with SMTP id 30.57.18333.1B9A6E85; Thu, 6 Apr 2017 13:48:49 -0700 (PDT) X-AuditID: 11973e16-bbf9d9a00000479d-76-58e6a9b1980a Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by relay2.apple.com (Apple SCV relay) with SMTP id 75.9E.06512.0B9A6E85; Thu, 6 Apr 2017 13:48:48 -0700 (PDT) MIME-version: 1.0 Received: from da0601a-dhcp91.apple.com (da0601a-dhcp91.apple.com [17.226.15.91]) by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.1.2.20170210 64bit (built Feb 10 2017)) with ESMTPSA id <0OO000G4P9TB1HB0@nwk-mmpp-sz11.apple.com>; Thu, 06 Apr 2017 13:48:48 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <58C65DD8-D073-4112-8ADE-FFA2F4DD8B45@apple.com> Date: Thu, 06 Apr 2017 13:48:48 -0700 In-reply-to: Cc: Amit kumar , "edk2-devel@lists.01.org" To: "Carsey, Jaben" References: X-Mailer: Apple Mail (2.3273) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsUi2FDorLtx5bMIg3dLeCz2vd7JZLHn0FFm i41Nf1gdmD0e95xh81i85yWTR/fsfywBzFFcNimpOZllqUX6dglcGQtOb2MrmNDIWHGl7TRL A+OuvC5GTg4JAROJNROXsXYxcnEICexllFj/9SITTKL11QQmiMQhRon3zXcYQRK8AoISPybf YwGxmQXCJFb2trNDFK1ikph0qJ8NJCEsIC7x7swmZhCbTUBZYsX8D+wQzTYSEzevY4aosZdY sf8J2FAWAVWJc48/g9VwAg29cPwXM8SCGIkTr/+C1YgI6EisvvWZGWLZOiaJnWdWskGcKitx a/YlsISEwHU2id1HFzJNYBSaheTaWUiuhbC1JL4/agWKcwDZ8hIHz8tChDUlnt37BFWiLfHk 3QXWBYxsqxiFchMzc3Qz88z1EgsKclL1kvNzNzGComS6ndgOxoerrA4xCnAwKvHwejx+EiHE mlhWXJl7iFGag0VJnFc5+2mEkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6pBkb96SrPxbxNJ639 caSaIy1qQ3aO4v7eVWfdT9ycmFwjOe2BEFOb69ZnuvISx89abcg6/+VTsW7tO1mRVp4vNxSd +RYZe2ydt2ZzRXHtS4/ySTeYNbiqJqxhNvosVqNlmHP+2L9DS071Rc/Li+1NjVb3kfSY8IDl 9vnnd5xUH8n+Nq28y7vwvawSS3FGoqEWc1FxIgBe0qbJcwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsUi2FA8W3fDymcRBr8XyVjse72TyWLPoaPM Fhub/rA6MHs87jnD5rF4z0smj+7Z/1gCmKO4bFJSczLLUov07RK4Mhac3sZWMKGRseJK22mW BsZdeV2MnBwSAiYSra8mMHUxcnEICRxilHjffIcRJMErICjxY/I9FhCbWSBMYmVvOztE0Som iUmH+tlAEsIC4hLvzmxiBrHZBJQlVsz/wA7RbCMxcfM6Zogae4kV+5+ADWURUJU49/gzWA0n 0NALx38xQyyIkTjx+i9YjYiAjsTqW5+ZIZatY5LYeWYlG8SpshK3Zl9insDIPwvJgbOQHAhh a0l8f9QKFOcAsuUlDp6XhQhrSjy79wmqRFviybsLrAsY2VYxChSl5iRWGuklFhTkpOol5+du YgQHdaHzDsZjy6wOMQpwMCrx8C54+iRCiDWxrLgyFxhKHMxKIrznpz6LEOJNSaysSi3Kjy8q zUktPsQ4kRHoy4nMUqLJ+cCYyyuJNzQxMTAxNjYzNjY3MaelsJI474Z7jyOEBNITS1KzU1ML UotgjmLi4JRqYKwKPJH++ONzFjln658mTWs3Tr2ceUg0SpfrmF650aoZjF4axRLe0atfbiq5 9fOfTPedjnOzZ9273/L40SfD6DV24RedmVOubD3Ca6V/bqXymfIbXLofF76e8CL28qobN49d O3Bi55z5yTcWbOwMPXdLrIjt3227+Di2d6+0riusd31QsF3x6jNdJZbijERDLeai4kQAVFhb pd0CAAA= X-Content-Filtered-By: Mailman/MimeDel 2.1.22 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:48:49 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Apr 6, 2017, at 1:30 PM, Carsey, Jaben wrote: > > That's the way to do it. the hard work is around finding the DevicePath for the application you want to run to pass to LoadImage. > Jaben, It was easy in the old days..... DevPath = gSE2->NameToPath (ShellPathName); gSE2->GetFsName (DevPath, FALSE, & ShellPathName); Maybe we should default EFI_SHELL_ENVIRONMENT2 to on :)? Half joking. I used those 2 APIs in the past to glue in shell volume names to a really simplistic C lib. Also if you have the File System Handle and path you can use the DevicePathLib. /** Allocates a device path for a file and appends it to an existing device path. If Device is a valid device handle that contains a device path protocol, then a device path for the file specified by FileName is allocated and appended to the device path associated with the handle Device. The allocated device path is returned. If Device is NULL or Device is a handle that does not support the device path protocol, then a device path containing a single device path node for the file specified by FileName is allocated and returned. The memory for the new device path is allocated from EFI boot services memory. It is the responsibility of the caller to free the memory allocated. If FileName is NULL, then ASSERT(). If FileName is not aligned on a 16-bit boundary, then ASSERT(). @param Device A pointer to a device handle. This parameter is optional and may be NULL. @param FileName A pointer to a Null-terminated Unicode string. @return The allocated device path. **/ EFI_DEVICE_PATH_PROTOCOL * EFIAPI FileDevicePath ( IN EFI_HANDLE Device, OPTIONAL IN CONST CHAR16 *FileName ); Thanks, Andrew Fish >> -----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 >> >> Hi, >> >> >> Can i use gbs->loadimage() and gbs->startimage() to load an efi application >> and execute it. >> >> Suppose i have a app1.efi and from app1.efi i want to execute app2.efi. >> >> Or is there some other way to do it ? >> >> Not considering ShellExecute(); >> >> Amit >> >> ________________________________ >> 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. >> >> >> On Apr 6, 2017, at 3:30 AM, Amit kumar >> >> wrote: >> >> Hi, >> >> 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. >> >> >> Amit, >> >> It is important to remember that fs0:, and the other device names are a Shell >> concept and not an EFI concept. So they only exist in the context of the shell. >> >> I took a quick look and I did not see an easy way to do this with the current >> Shell APIs. >> >> In the older Shell you could use this protocol EfiShellEnvironment2 Protocol >> 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 >> >> The only problem with that is EfiShellEnvironment2 is not produced by the >> Shell by default. >> >> ## 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 >> >> gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols|FALSE|BOOLEAN >> |0x00000002 >> >> 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? >> >> Thanks, >> >> Andrew Fish >> >> Regards >> Amit >> _______________________________________________ >> 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