Version 0.9 February, 2005 v
Contents
1 Introduction ...................................................................................................... 9
1.1 Overview ........................................................................................................................ 9
1.2 Related Information........................................................................................................9
1.3 Conventions Used in This Document.............................................................................9
1.3.1 Data Structure Descriptions.............................................................................9
1.3.2 Procedure Descriptions .................................................................................10
1.3.3 Pseudo-Code Conventions............................................................................11
1.3.4 Typographic Conventions..............................................................................11
2 Building the Environment Setup................................................................... 13
2.1 Microsoft* Tools Installation .........................................................................................13
2.1.1 Visual C++.....................................................................................................13
2.1.2 Microsoft* C/C++ Optimizing Compiler..........................................................13
2.2 EFI Shell Installation ....................................................................................................13
3 Building an EFI Shell Application................................................................. 15
3.1 Building an Application.................................................................................................15
3.1.1 Build Example................................................................................................15
4 Composing an EFI Shell Application............................................................ 17
4.1 String Resource .uni File..............................................................................................17
4.2 Component Description .inf File...................................................................................18
4.2.1 DEFINES Section..........................................................................................18
4.2.2 SOURCES.COMMON Section......................................................................19
4.2.3 INCLUDES.COMMON Section......................................................................19
4.2.4 LIBRARIES.COMMON Section.....................................................................19
4.2.5 NMAKE.COMMON Section...........................................................................19
4.3 Writing an EFI Shell Application...................................................................................19
4.3.1 Required .h Files ...........................................................................................19
4.3.2 Strings ...........................................................................................................20
4.3.3 Declaring the Entry Point...............................................................................20
4.3.4 Initializing the Execution Environment...........................................................20
4.3.5 Registering the String Package.....................................................................21
4.3.6 Checking for Available System Services.......................................................21
4.3.7 HelloWorld Example......................................................................................21
4.3.8 UseArg Example............................................................................................24
4.3.9 UseVar Example............................................................................................26
4.4 Writing an Application That Can Be Either Internal Command or External Command33
4.4.1 Rules to Follow..............................................................................................33
4.5 Switching Between Internal and External Commands .................................................35
4.5.1 External to Internal ........................................................................................35
4.5.2 Internal to External ........................................................................................35
5 EFI Shell Library Introduction....................................................................... 37
5.1 Data Types and Global Variables ................................................................................37