Discussion:
[edk2] Pacing UEFI Shell Application in firmware volume
Calvin (Hao) Guan
2014-10-30 19:34:52 UTC
Permalink
Hi,

FDF file allows EFI application to be placed in firmware volume but I can't seem to find what to do with these apps if placed in the FV. Because they are apps, they won't be dispatched. How do I invoke such an application from the FV?

Thanks,
Calvin
Scott Duplichan
2014-10-30 20:10:58 UTC
Permalink
Calvin (Hao) Guan [mailto:***@broadcom.com] wrote:

]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I can’t
]seem to find what to do with these apps if placed in the FV. Because they are
]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin

Hello Calvin,

This question was asked earlier this year:
http://sourceforge.net/p/edk2/mailman/message/32169701/

I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are might
not be available if the UEFI shell is not running. There might be a way to
automatically launch a shell and have it launch your app, then exit after the
app exits, but I have never done that.

Thanks,
Scott


------------------------------------------------------------------------------
Calvin (Hao) Guan
2014-10-30 21:07:49 UTC
Permalink
Thanks Scott.

I saw numerous pkg in EDK2 include Shell.efi in the FDF file which supposingly places the Shell in the boot FV. How does the shell get started in this case?

Thanks,
Calvin

-----Original Message-----
From: Scott Duplichan [mailto:***@notabs.org]
Sent: Thursday, October 30, 2014 1:11 PM
To: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume

Calvin (Hao) Guan [mailto:***@broadcom.com] wrote:

]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I can’t ]seem to find what to do with these apps if placed in the FV. Because they are ]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin

Hello Calvin,

This question was asked earlier this year:
http://sourceforge.net/p/edk2/mailman/message/32169701/

I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are might not be available if the UEFI shell is not running. There might be a way to automatically launch a shell and have it launch your app, then exit after the app exits, but I have never done that.

Thanks,
Scott


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Andrew Fish
2014-10-30 21:29:43 UTC
Permalink
Post by Calvin (Hao) Guan
Thanks Scott.
I saw numerous pkg in EDK2 include Shell.efi in the FDF file which supposingly places the Shell in the boot FV. How does the shell get started in this case?
On a PI based system you can just pass in the correct device path to gBS->LoadImage().

https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Core/Dxe/Image/Image.c CoreLoadImageCommon() Suports loading from an FV.

If you want to see what the BDS does to boot the shell grep for PcdShellFile.

The EfiInitializeFwVolDevicepathNode() function from the UefiLib will help you create the Device Path: https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/UefiLib.h

Thanks,

Andrew Fish
Post by Calvin (Hao) Guan
Thanks,
Calvin
-----Original Message-----
Sent: Thursday, October 30, 2014 1:11 PM
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I can’t ]seem to find what to do with these apps if placed in the FV. Because they are ]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are might not be available if the UEFI shell is not running. There might be a way to automatically launch a shell and have it launch your app, then exit after the app exits, but I have never done that.
Thanks,
Scott
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Brian J. Johnson
2014-10-30 21:22:21 UTC
Permalink
Post by Scott Duplichan
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I can’t
]seem to find what to do with these apps if placed in the FV. Because they are
]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are might
not be available if the UEFI shell is not running. There might be a way to
automatically launch a shell and have it launch your app, then exit after the
app exits, but I have never done that.
If you can build it as a driver rather than an app, you can arrange to
have it run during build. Or if you can put it on a file system such as
a USB drive, you can set the shell as your default boot target, and
write a startup.nsh script which launches your app when the shell starts.
--
Brian

--------------------------------------------------------------------

"There is the greatest practical benefit in making a few failures
early in life."
-- Thomas Henry Huxley

------------------------------------------------------------------------------
Calvin (Hao) Guan
2014-10-30 21:35:16 UTC
Permalink
I don't have a device that supports FS at this point. i.e. the USB i/f has not been brought up yet.

Can I 1) put the shell.efi and my shell app in FV and 2) run from there before I got any storage controller up?

I think the answer to q1 is yes because FDF supports such option. What do I do with those EFI app place in the FV?

Thanks,
Calvin

-----Original Message-----
From: Brian J. Johnson [mailto:***@sgi.com]
Sent: Thursday, October 30, 2014 2:22 PM
To: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
Post by Scott Duplichan
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I
can’t ]seem to find what to do with these apps if placed in the FV.
Because they are ]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are
might not be available if the UEFI shell is not running. There might
be a way to automatically launch a shell and have it launch your app,
then exit after the app exits, but I have never done that.
If you can build it as a driver rather than an app, you can arrange to have it run during build. Or if you can put it on a file system such as a USB drive, you can set the shell as your default boot target, and write a startup.nsh script which launches your app when the shell starts.
--

Brian

--------------------------------------------------------------------

"There is the greatest practical benefit in making a few failures
early in life."
-- Thomas Henry Huxley

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Carsey, Jaben
2014-10-30 22:34:35 UTC
Permalink
As Andrew stated. The BDS in EDKII will spawn the shell based on the PCD of it's GUID.

Add this to the DSC file for your system if you're using the UEFI Shell.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }

Note that this is discussed in the Readme.txt in the ShellPkg.
Post by Calvin (Hao) Guan
-----Original Message-----
Sent: Thursday, October 30, 2014 2:35 PM
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
I don't have a device that supports FS at this point. i.e. the USB i/f has not
been brought up yet.
Can I 1) put the shell.efi and my shell app in FV and 2) run from there before I
got any storage controller up?
I think the answer to q1 is yes because FDF supports such option. What do I
do with those EFI app place in the FV?
Thanks,
Calvin
-----Original Message-----
Sent: Thursday, October 30, 2014 2:22 PM
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
Post by Scott Duplichan
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I
can’t ]seem to find what to do with these apps if placed in the FV.
Because they are ]apps, they won’t be dispatched. How do I invoke such an
application from the FV?
Post by Scott Duplichan
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during
boot.
Post by Scott Duplichan
One reason might be that UEFI apps can use stdout/stdin, and those are
might not be available if the UEFI shell is not running. There might
be a way to automatically launch a shell and have it launch your app,
then exit after the app exits, but I have never done that.
If you can build it as a driver rather than an app, you can arrange to have it
run during build. Or if you can put it on a file system such as a USB drive, you
can set the shell as your default boot target, and write a startup.nsh script
which launches your app when the shell starts.
--
Brian
--------------------------------------------------------------------
"There is the greatest practical benefit in making a few failures
early in life."
-- Thomas Henry Huxley
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Olivier Martin
2014-10-31 11:34:14 UTC
Permalink
I submitted a patch on March 25th (MdeModulePkg: Implement EFI_FILE_PROTOCOL over Firmware Volumes) to make the Firmware Volume appear as a File System.
Feng told me he will review the patch and come back to me with feedbacks...

You can list and start EFI binaries from the Shell or the Boot Manager.
That's what we use at ARM to enable Android FastBoot (we implemented it as a EFI application).
Post by Calvin (Hao) Guan
-----Original Message-----
Sent: 30 October 2014 20:11
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I can’t
]seem to find what to do with these apps if placed in the FV. Because they are
]apps, they won’t be dispatched. How do I invoke such an application from the FV?
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are might
not be available if the UEFI shell is not running. There might be a way to
automatically launch a shell and have it launch your app, then exit after the
app exits, but I have never done that.
Thanks,
Scott
-----------------------------------------------------------------------
-------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Calvin (Hao) Guan
2014-11-08 05:03:44 UTC
Permalink
Olivier,

That's cool. Any idea when the patch will make it to the trunk? I'm tempting to roll my own.

Thanks,
Calvin

-----Original Message-----
From: Olivier Martin [mailto:***@arm.com]
Sent: Friday, October 31, 2014 4:34 AM
To: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume

I submitted a patch on March 25th (MdeModulePkg: Implement EFI_FILE_PROTOCOL over Firmware Volumes) to make the Firmware Volume appear as a File System.
Feng told me he will review the patch and come back to me with feedbacks...

You can list and start EFI binaries from the Shell or the Boot Manager.
That's what we use at ARM to enable Android FastBoot (we implemented it as a EFI application).
Post by Calvin (Hao) Guan
-----Original Message-----
Sent: 30 October 2014 20:11
Subject: Re: [edk2] Pacing UEFI Shell Application in firmware volume
]Hi,
]
]FDF file allows EFI application to be placed in firmware volume but I
can’t ]seem to find what to do with these apps if placed in the FV.
Because they are ]apps, they won’t be dispatched. How do I invoke such
an application from the FV?
]
]Thanks,
]Calvin
Hello Calvin,
http://sourceforge.net/p/edk2/mailman/message/32169701/
I don't believe there is a mechanism to directly launch a UEFI app during boot.
One reason might be that UEFI apps can use stdout/stdin, and those are
might not be available if the UEFI shell is not running. There might
be a way to automatically launch a shell and have it launch your app,
then exit after the app exits, but I have never done that.
Thanks,
Scott
----------------------------------------------------------------------
-
-------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Loading...