]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/ReadMe.txt
StdLib, AppPkg: Update ReadMe files.
[mirror_edk2.git] / StdLib / ReadMe.txt
index 731b18da5b2e06b095b75de6f54b3ec0ecd9699d..00396919691fc9c4cba2ba8705d1b1537bd0d296 100644 (file)
@@ -1,16 +1,31 @@
-                           EDK II Standard Libraries\r
+                                    EADK\r
+                  EDK II Standard Libraries and Applications\r
                                     ReadMe\r
-                                 Beta Release\r
-                               4:03 PM 8/2/2011\r
+                                Beta-1 Release\r
+                                 27 Jan. 2012\r
+                                    DRAFT\r
 \r
 \r
 OVERVIEW\r
 ========\r
-This document describes the EDK II specific aspects of installing, building, and\r
-using the Standard C Library component of the EDK II Application Development\r
-Kit, EADK.\r
+The EADK (uEfi Application Development Kit) provides a set of standards-based\r
+libraries, along with utility and demonstration applications, intended to\r
+ease development of UEFI applications based upon the EDK II Open-Source\r
+distribution.\r
 \r
-The EADK is comprised of three packages: AppPkg, StdLib, and StdLibPrivateInternalFiles.\r
+At this time, applications developed with the EADK are intended to reside\r
+on, and be loaded from, storage separate from the core firmware.  This is\r
+primarily due to size and environmental requirements.\r
+\r
+Some components of the EADK can be built as drivers.  These will be identified\r
+explicitly in their documentation.\r
+\r
+This document describes the EDK II specific aspects of installing, building,\r
+and using the Standard C Library component of the EDK II Application\r
+Development Kit, EADK.\r
+\r
+The EADK is comprised of three packages:\r
+        AppPkg, StdLib, and StdLibPrivateInternalFiles.\r
 \r
   AppPkg   This package contains applications which demonstrate use of the\r
            Standard C Library.\r
@@ -28,16 +43,17 @@ The EADK is comprised of three packages: AppPkg, StdLib, and StdLibPrivateIntern
       Main     This application is functionally identical to Hello, except that\r
                it uses the Standard C Library to provide a main() entry point.\r
 \r
-      Python   A port of the Python-2.7.1 interpreter for UEFI.  This\r
-               application is disabled by default.  Un-comment the line for\r
-               PythonCore.inf in the [Components] section of AppPkg.dsc to\r
-               enable building Python.\r
+      Python   A port of the Python-2.7.2 interpreter for UEFI.  This\r
+               application is disabled by default.\r
+               See the PythonReadMe.txt file, in the Python directory,\r
+               for information on configuring and building Python.\r
 \r
       Sockets  A collection of applications demonstrating use of the\r
                EDK II Socket Libraries.  These applications include:\r
 \r
                *   DataSink\r
                *   DataSource\r
+               *   GetAddrInfo\r
                *   GetHostByAddr\r
                *   GetHostByDns\r
                *   GetHostByName\r
@@ -45,6 +61,10 @@ The EADK is comprised of three packages: AppPkg, StdLib, and StdLibPrivateIntern
                *   GetNetByName\r
                *   GetServByName\r
                *   GetServByPort\r
+               *   OobRx\r
+               *   OobTx\r
+               *   RawIp4Rx\r
+               *   RawIp4Tx\r
                *   RecvDgram\r
                *   SetHostName\r
                *   SetSockOpt\r
@@ -52,7 +72,31 @@ The EADK is comprised of three packages: AppPkg, StdLib, and StdLibPrivateIntern
                *   WebServer\r
 \r
   StdLib   The StdLib package contains the standard header files as well as\r
-           implementations of the standard libraries.\r
+           implementations of standards based libraries.\r
+\r
+           *   BsdSocketLib\r
+                  Support routines above the sockets layer and C interface for\r
+                  the UEFI socket library.\r
+           *   Efi\r
+                  Template contents for the target system's\r
+                  \Efi\StdLib\etc directory.\r
+           *   EfiSocketLib\r
+                  UEFI socket implementation, may be linked into an\r
+                  application or run as a driver.\r
+           *   Include\r
+                  Standard include files.\r
+           *   LibC\r
+                  C Standard Library implementation as per\r
+                  ISO/IEC 9899:199409 (C95).\r
+           *   PosixLib\r
+                  Selected functions from the "Single Unix v4" specification.\r
+           *   SocketDxe\r
+                  UEFI sockets driver, includes EfiSocketLib.\r
+           *   UseSocketDxe\r
+                  Alternate linkage for applications that get built into the\r
+                  firmware.  Cause application to use a common instance of the\r
+                  sockets driver instead of including all of sockets into the\r
+                  application.\r
 \r
   StdLibPrivateInternalFiles  The contents of this package are for the\r
            exclusive use of the library implementations in StdLib.  Please do\r
@@ -63,36 +107,45 @@ The EADK is comprised of three packages: AppPkg, StdLib, and StdLibPrivateIntern
 \r
 RELEASE NOTES\r
 =============\r
+  Fixes and Additions\r
+  -------------------\r
+Beginning with this release, applications built with the StdLib package\r
+no longer have a dependency on the TimerLib.\r
+\r
+  Known Issues\r
+  -----------------\r
 This release of the EADK has some restrictions, as described below.\r
 \r
-    1. Only the Microsoft VS2005 and VS2008, Intel C Compiler 10.1 (or later),\r
+    1.  Only the Microsoft VS2005 and VS2008, Intel C Compiler 10.1 (or later),\r
         GCC 4.3 (mingw32), GCC 4.4, and GCC 4.5 C compilers are supported for\r
-        Ia32 or X64 CPU architectures.\r
-        \r
-    2. The target machine must be running firmware which provides the\r
+        Ia32 or X64 CPU architectures.  Others may work but have not been tested.\r
+\r
+    2.  The target machine must be running firmware which provides the\r
         UEFI 2.3 HII protocol.\r
-        \r
-    3. The EADK has not been through Intel's Quality Assurance process. This\r
+\r
+    3.  The EADK has not been through Intel's Quality Assurance process. This\r
         means that specified standards compliance has not been validated, nor\r
         has it undergone formal functionality testing.\r
-        \r
-    4. Applications must be launched from within the EFI Shell.\r
-    \r
-    5. All file paths must use the forward slash, '/', as the separator\r
-        character.\r
-        \r
-    6. Absolute file paths may optionally be prefixed by a volume specifier\r
+\r
+    4.  Applications must be launched from within the EFI Shell.\r
+\r
+    6.  Absolute file paths may optionally be prefixed by a volume specifier\r
         such as "FS0:".  The volume specifier is separated from the remainder\r
         of the path by a single colon ':'.  The volume specifier must be one of\r
         the Shell's mapped volume names as shown by the "map" command.\r
-        \r
-    7. Absolute file paths that don't begin with a volume specifier;\r
+\r
+    7.  Absolute file paths that don't begin with a volume specifier;\r
         e.g. paths that begin with "/", are relative to the currently selected\r
-        volume.  When the EFI Shell starts, there is NO selected volume.\r
-        \r
-    8. The tmpfile(), and related, functions require that the current volume\r
+        volume.  When the EFI Shell first starts, there is NO selected volume.\r
+\r
+    8.  The tmpfile(), and related, functions require that the current volume\r
         have a temporary directory as specified in <paths.h>.  This directory\r
-        is specified by macro _PATH_TMP.\r
+        is specified by macro _PATH_TMP as /Efi/StdLib/tmp.\r
+\r
+    9.  Input line editing is not supported.  Backspacing, deleting, or\r
+        otherwise attempting to modify interactive input will result in a\r
+        syntax error since the editing characters are interpreted the\r
+        same as any other character.\r
 \r
 The Standard C Library provided by this package is a "hosted" implementation\r
 conforming to the ISO/IEC 9899-1990 C Language Standard with Addendum 1. This\r
@@ -103,20 +156,24 @@ convenience, it is assumed that your EDK II source tree is located at
 C:\Source\Edk2.\r
 \r
 \r
-INSTALLATION\r
-============\r
+EADK INSTALLATION\r
+=================\r
 The EADK is integrated within the EDK II source tree and is included with\r
 current EDK II check-outs.  If they are missing from your tree, they may be\r
 installed by extracting, downloading or copying them to the root of your EDK II\r
 source tree.  The three package directories should be peers to the Conf,\r
 MdePkg, Nt32Pkg, etc. directories.\r
 \r
-The Python 2.7.1 distribution must be downloaded from python.org before the\r
-Python application can be built.  Extracting Python-2.7.1.tgz into the\r
-AppPkg\Applications\Python directory will produce a Python-2.7.1 directory\r
+The Python 2.7.2 distribution must be downloaded from python.org before the\r
+Python application can be built.  Extracting Python-2.7.2.tgz into the\r
+AppPkg\Applications\Python directory will produce a Python-2.7.2 directory\r
 containing the Python distribution.  Python files that had to be modified for\r
-EDK II are in the AppPkg\Applications\Python\PyMod-2.7.1 directory.  These\r
-files need to be copied into the corresponding directories within Python-2.7.1.\r
+EDK II are in the AppPkg\Applications\Python\PyMod-2.7.2 directory.  These\r
+files need to be copied into the corresponding directories within Python-2.7.2.\r
+\r
+The Python 2.7.1 port was superseded before it was completed.  The PyMod-2.7.1\r
+directory tree will be deleted in the near future.  Use the Python 2.7.2 port,\r
+as described above.\r
 \r
 There are some boiler-plate declarations and definitions that need to be\r
 included in your application's INF and DSC build files.  These are described\r
@@ -133,7 +190,7 @@ commands within the "Visual Studio Command Prompt" window:
 \r
     > cd C:\Source\Edk2\r
     > .\edksetup.bat\r
-    > build ?a X64 ?p AppPkg\AppPkg.dsc\r
+    > build -a X64 -p AppPkg\AppPkg.dsc\r
 \r
 This will produce the application executables: Enquire.efi, Hello.efi, and\r
 Main.efi in the C:\Source\Edk2\Build\AppPkg\DEBUG_VS2008\X64 directory; with\r
@@ -147,6 +204,12 @@ C Library.  This, plus referencing the StdLib package in your application's
 .inf file is all that is needed to link your application to the standard\r
 libraries.\r
 \r
+Unless explicitly stated as allowed, EADK components should not be added as\r
+components of a DSC file which builds a platform's core firmware.  There are\r
+incompatibilities in build flags and requirements that will conflict with the\r
+requirements of the core firmware.  EADK components should be built using a\r
+separate DSC file then, if absolutely necessary, included as binary components\r
+of other DSC files.\r
 \r
 USAGE\r
 =====\r
@@ -206,8 +269,8 @@ library functions follow standard C programming practices as formalized by
 ISO/IEC 9899:1990, with Addendum 1, (C 95) C language specification.\r
 \r
 \r
-CONFIGURATION\r
-=============\r
+BUILD CONFIGURATION\r
+===================\r
 DSC Files\r
 ---------\r
 \r
@@ -218,51 +281,49 @@ consolidated into a single file, StdLib/StdLib.inc, which can be included in
 your .dsc file using the !include directive.  The provided AppPkg.dsc and\r
 StdLib.dsc files do this on their last line.\r
 \r
-Each affected section of the DSC file is described below.\r
+Each section of StdLib/StdLib.inc is described below.\r
 \r
   [LibraryClasses]\r
-    #\r
-    # Common Libraries\r
-    #\r
-    BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
-    BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
-\r
-    TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf\r
-    # To run in an emulation environment, such as NT32, comment out\r
-    # the TimerLib description above and un-comment the line below.\r
-    # TimerLib| MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-\r
     #\r
     # C Standard Libraries\r
     #\r
     LibC|StdLib/LibC/LibC.inf\r
-    LibStdLib|StdLib/LibC/StdLib/StdLib.inf\r
-    LibString|StdLib/LibC/String/String.inf\r
-    LibWchar|StdLib/LibC/Wchar/Wchar.inf\r
     LibCType|StdLib/LibC/Ctype/Ctype.inf\r
-    LibTime|StdLib/LibC/Time/Time.inf\r
-    LibStdio|StdLib/LibC/Stdio/Stdio.inf\r
-    LibGdtoa|StdLib/LibC/gdtoa/gdtoa.inf\r
     LibLocale|StdLib/LibC/Locale/Locale.inf\r
-    LibUefi|StdLib/LibC/Uefi/Uefi.inf\r
     LibMath|StdLib/LibC/Math/Math.inf\r
     LibSignal|StdLib/LibC/Signal/Signal.inf\r
-    LibNetUtil|StdLib/LibC/LibGcc/LibGcc.inf\r
+    LibStdio|StdLib/LibC/Stdio/Stdio.inf\r
+    LibStdLib|StdLib/LibC/StdLib/StdLib.inf\r
+    LibString|StdLib/LibC/String/String.inf\r
+    LibTime|StdLib/LibC/Time/Time.inf\r
+    LibUefi|StdLib/LibC/Uefi/Uefi.inf\r
+    LibWchar|StdLib/LibC/Wchar/Wchar.inf\r
 \r
-  # Libraries for device abstractions within the Standard C Library.\r
-  # Applications should not directly access any functions defined\r
-  # in these libraries.\r
-    DevUtility|StdLib/LibC/Uefi/Devices/daUtility.inf\r
+  # Common Utilities for Networking Libraries\r
+    LibNetUtil|StdLib/LibC/NetUtil/NetUtil.inf\r
+\r
+  # Additional libraries for POSIX functionality.\r
+    LibErr|StdLib/PosixLib/Err/LibErr.inf\r
+    LibGen|StdLib/PosixLib/Gen/LibGen.inf\r
+    LibGlob|StdLib/PosixLib/Glob/LibGlob.inf\r
+    LibStringlist|StdLib/PosixLib/Stringlist/LibStringlist.inf\r
+\r
+  # Libraries for device abstractions within the Standard C Library\r
+  # Applications should not directly access any functions defined in these libraries.\r
+    LibGdtoa|StdLib/LibC/gdtoa/gdtoa.inf\r
     DevConsole|StdLib/LibC/Uefi/Devices/daConsole.inf\r
     DevShell|StdLib/LibC/Uefi/Devices/daShell.inf\r
+    DevUtility|StdLib/LibC/Uefi/Devices/daUtility.inf\r
+\r
+  [LibraryClasses.ARM.UEFI_APPLICATION]\r
+    NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf\r
 \r
                      Figure 1: Library Class Descriptions\r
                      ====================================\r
 \r
 \r
-Descriptions of the Library Classes comprising the Standard Libraries must be\r
-included in your application package's DSC file, as shown in Figure 1: Library\r
-Class Descriptions, above.\r
+Descriptions of the Library Classes comprising the Standard Libraries,\r
+as shown above in Figure 1: Library Class Descriptions, are provided.\r
 \r
 The directives in Figure 2: Package Component Descriptions will create\r
 instances of the BaseLib and BaseMemoryLib library classes that are built\r
@@ -271,6 +332,8 @@ Microsoft tool chains in order to allow the library's functions to be
 resolved during the second pass of the linker during Link-Time-Code-Generation\r
 of the application.\r
 \r
+A DXE driver version of the Socket library is also built.\r
+\r
   [Components]\r
   # BaseLib and BaseMemoryLib need to be built with the /GL- switch\r
   # when using the Microsoft tool chains.  This is required so that\r
@@ -286,44 +349,15 @@ of the application.
         MSFT:*_*_*_CC_FLAGS = /X /Zc:wchar_t /GL-\r
     }\r
 \r
+  ##########\r
+  #  Socket Layer\r
+  ##########\r
+    StdLib/SocketDxe/SocketDxe.inf\r
+\r
                     Figure 2: Package Component Descriptions\r
                     ========================================\r
 \r
 \r
-The NULL TimerLib instance must be selected if you desire to run your\r
-application under an emulation environment -- unless there is a supported\r
-TimerLib for that environment.  For example, the InOsEmuPkg provides a\r
-DxeTimerLib which can be used for the TimerLib instance.\r
-\r
-The "boilerplate" text in StdLib.inc will automatically adjust which Timer\r
-Library is instantiated based upon whether the $(EMULATE) macro has been\r
-defined, or not.\r
-\r
-  ###\r
-  # Select the correct TimerLib instance depending upon whether running under\r
-  # an emulation environment, or not.\r
-  !ifndef $(EMULATE)\r
-    # Not running in an Emulation Environment\r
-  [LibraryClasses.IA32.UEFI_APPLICATION]\r
-    TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf\r
-\r
-  [LibraryClasses.X64.UEFI_APPLICATION]\r
-    TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf\r
-\r
-  [LibraryClasses.IPF.UEFI_APPLICATION]\r
-    PalLib|MdePkg/Library/UefiPalLib/UefiPalLib.inf\r
-    TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-  !else\r
-    # Use this instance if Running in an Emulation Environment.\r
-  [LibraryClasses.Common.UEFI_APPLICATION]\r
-    TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
-  !endif\r
-\r
-                      Figure 3: Timer Library Selection\r
-                      =================================\r
-\r
-\r
 Each compiler assumes, by default, that it will be used with standard libraries\r
 and headers provided by the compiler vendor.  Many of these assumptions are\r
 incorrect for the UEFI environment.  By including a BuildOptions section, as\r
@@ -333,17 +367,15 @@ tailored for compatibility with UEFI and the EDK II Standard Libraries.
   [BuildOptions]\r
     INTEL:*_*_IA32_CC_FLAGS  = /Qfreestanding\r
      MSFT:*_*_IA32_CC_FLAGS  = /X /Zc:wchar_t\r
-      GCC:*_*_IA32_CC_FLAGS  = /ffreestanding ?nostdinc ?nostdlib\r
+      GCC:*_*_IA32_CC_FLAGS  = -nostdinc -nostdlib\r
 \r
   # The Build Options, below, are only used when building the C library\r
-  # to be run under an emulation environment.  The clock() system call\r
-  # is modified to return -1 indicating that it is unsupported.\r
-  # Just un-comment the lines below and select the correct\r
-  # TimerLib instance, above.\r
+  # to be run under an emulation environment.  They disable optimization\r
+  # which facillitates debugging under the Emulation environment.\r
 \r
-    # INTEL:*_*_IA32_CC_FLAGS  = /D NT32dvm\r
-    #  MSFT:*_*_IA32_CC_FLAGS  = /D NT32dvm\r
-    #   GCC:*_*_IA32_CC_FLAGS  = -DNT32dvm\r
+    # INTEL:*_*_IA32_CC_FLAGS  = /Od\r
+    #  MSFT:*_*_IA32_CC_FLAGS  = /Od\r
+    #   GCC:*_*_IA32_CC_FLAGS  = -O0\r
 \r
                         Figure 4: Package Build Options\r
                         ===============================\r
@@ -373,7 +405,7 @@ below.
     LibString\r
     LibStdio\r
     DevShell\r
-  \r
+\r
                       Figure 6: Module Library Classes\r
                       ================================\r
 \r
@@ -386,7 +418,7 @@ handled by the UEFI Shell.  Without this class, only Console I/O is permitted.
   INTEL:*_*_*_CC_FLAGS          = /Qdiag-disable:181,186\r
    MSFT:*_*_*_CC_FLAGS          = /Oi- /wd4018 /wd4131\r
     GCC:*_*_IPF_SYMRENAME_FLAGS = --redefine-syms=Rename.txt\r
-    \r
+\r
                         Figure 7: Module Build Options\r
                         ==============================\r
 \r
@@ -398,6 +430,23 @@ code from external sources, though, it may be necessary to disable some
 warnings or enable/disable some compiler features.\r
 \r
 \r
+TARGET-SYSTEM INSTALLATION\r
+==========================\r
+Applications that use file system features or the Socket library depend upon\r
+the existence of a specific directory tree structure on the same volume that\r
+the application was loaded from.  This tree structure is described below:\r
+\r
+    /EFI                      Root of the UEFI system area.\r
+     |- /Tools                Directory containing applications.\r
+     |- /Boot                 UEFI specified Boot directory.\r
+     |- /StdLib               Root of the Standard Libraries sub-tree.\r
+         |- /etc              Configuration files used by libraries.\r
+         |- /tmp              Temporary files created by tmpfile(), etc.\r
+\r
+\r
+The /Efi/StdLib/etc directory is populated from the StdLib/Efi/etc source\r
+directory.\r
+\r
 IMPLEMENTATION-Specific Features\r
 ================================\r
 It is very strongly recommended that applications not use the long or\r
@@ -426,13 +475,12 @@ needed, use type PHYSICAL_ADDRESS.
 \r
 Though not specifically required by the ISO/IEC 9899 standard, this\r
 implementation of the Standard C Library provides the following system calls\r
-which are declared in sys/EfiSysCall.h.\r
+which are declared in sys/EfiSysCall.h and/or unistd.h.\r
 \r
-          close   dup      dup2     fcntl\r
-          fstat   getcwd   ioctl    isatty\r
-          lseek   lstat    mkdir    open\r
-          poll    read     rename   rmdir\r
-          stat    unlink   write\r
+          close   creat    chmod    dup      dup2\r
+          fcntl   fstat    getcwd   ioctl    isatty\r
+          lseek   lstat    mkdir    open     poll\r
+          read    rename   rmdir    stat     unlink   write\r
 \r
 The open function will accept file names of "stdin:", "stdout:", and "stderr:"\r
 which cause the respective streams specified in the UEFI System Table to be\r
@@ -440,4 +488,4 @@ opened.  Normally, these are associated with the console device.  When the
 application is first started, these streams are automatically opened on File\r
 Descriptors 0, 1, and 2 respectively.\r
 \r
-\r
+                            # # #\r