Okay, thanks. Clarification, StdLib has a ShellAppMain() which appears is called by the ShellPkg ShellCEntryLib (unless you provide your own ShellCEntryLib which you'd have to call the StdLib's ShellAppMain()).
On Tue, Aug 27, 2013 at 12:15 PM, Mcdaniel, Daryl <[email protected]> wrote: > David, > > The StdLib entry point, specified in the INF file, is ShellCEntryLib. The > StdLib library, LibC, provides the ShellCEntryLib function which sets up the > environment required by C and then calls main(). The only function you are > required to provide is main. > > In order to get the image handle and pointers to the SystemTable and > BootServices Table, all you need to do is: > #include <Library/ UefiBootServicesTableLib.h> > in your C file. > > You will then be able to access the image handle as gImageHandle, System > Table as gST, and the Boot Services Table as gBS. > > > Daryl McDaniel > > "I have always wished for my computer to be as easy to use as my telephone; > my wish has come true because I can no longer figure out how to use my > telephone." > -- Bjarne Stoustrup > > > -----Original Message----- > From: David F. [mailto:[email protected]] > Sent: Monday, August 26, 2013 10:06 PM > To: [email protected] > Subject: [edk2] stdlib main() imagehandle and systemtable > > Hi, > > So playing around with stdlib, if my test app provides a > ShellCEntryLib function that gets called but things like printf in > stdlib don't work. It looks like stdlib needs to get ShellAppMain > called, so I just setup a main() function and that worked (printf > works), but now how do I get the image handle and system table?? Is > it assigned to some global var (didn't see it doing that) or is there > some function I can call that doesn't require an image handle to give > me the image handle of the running app? > ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
