public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* How to make my application automatically launch like uefi shell ?
@ 2017-06-05 11:42 Amit kumar
  2017-06-05 15:28 ` Andrew Fish
  0 siblings, 1 reply; 2+ messages in thread
From: Amit kumar @ 2017-06-05 11:42 UTC (permalink / raw)
  To: edk2-devel@lists.01.org


Hi,

I have created a uefi application and i want to directly launch from the Pen Drive, just like uefi shell.
I made a EFI/BOOT directory in USB and copied my application in this director and name it BOOTX64.efi it seems to works in some PCs,
But there are some PCs where it doesn't work even in boot menu i can see no entry.
Can somebody help me ?

Thanks And Regards
Amit

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to make my application automatically launch like uefi shell ?
  2017-06-05 11:42 How to make my application automatically launch like uefi shell ? Amit kumar
@ 2017-06-05 15:28 ` Andrew Fish
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Fish @ 2017-06-05 15:28 UTC (permalink / raw)
  To: Amit kumar; +Cc: edk2-devel@lists.01.org


> On Jun 5, 2017, at 4:42 AM, Amit kumar <akamit91@hotmail.com> wrote:
> 
> 
> Hi,
> 
> I have created a uefi application and i want to directly launch from the Pen Drive, just like uefi shell.
> I made a EFI/BOOT directory in USB and copied my application in this director and name it BOOTX64.efi it seems to works in some PCs,
> But there are some PCs where it doesn't work even in boot menu i can see no entry.
> Can somebody help me ?
> 

Amit,

Is your test case edk2 Shell at EFI\BOOT\BOOTX64.efi vs. your App on the same USB Key. If not try that. Some of the edk2 libraries don't like to run on older systems, so it would be good to make sure that is not the issue. 

You can write an UEFI App without any edk2 libraries by using this as a template:
https://github.com/tianocore/edk2/tree/master/MdeModulePkg/Application/HelloWorld

In HelloWorld.c replace the code with. 

#include <Uefi.h>

EFI_STATUS
EFIAPI
_ModuleEntryPoint (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  return SystemTable->ConOut->OutputString  (SystemTable->ConOut, L"Hello World\r\n");
}

In HelloWorld.inf comment out all the library classes listed under [LibraryClasses]

If the issue is specific to your App, and you know the App entry point C code is not getting called then you need to look at the library constructor. This code is auto generated by the build system in the Build results output as AutoGen.c. You can look at the ProcessLibraryConstructorList() and that will show you the code that is going be running before your entry point gets called. 

You could also try a release build of your App as that would remove the ASSERT macros in ProcessLibraryConstructorList() from the equation. 

Thanks,

Andrew Fish



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-05 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05 11:42 How to make my application automatically launch like uefi shell ? Amit kumar
2017-06-05 15:28 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox