Name
 GenFds.exe
Description
GenFds will get platform, flash and module information from target.txt,platform.dsc, flashmap.fdf, package.dec and module.inf. it will generate Ffs, Fv, FD and Section data depending on command line options. The FDF file must be pointed out. And the FDF file must follow the format of FDF’s specification otherwise tool will throw a exception and stop the build.
The FDF file describes information about flash parts as well as rules for combining binaries (Firmware Image) built from a DSC file.  The output of the first phase of an EDK II build (as defined in the EDK II Build Specification) generates valid PE32/PE32+/Coff image files.  GenFds performs the second phase of the build process during which consumes the images generated during the first phase, using statements and rules defined in the FDF file to place the PE32/PE32+/Coff images files into one or more EFI sections, then the EFI sections may get combined with other optional sections (version, depex, user interface) sections, into EFI Firmware File system (FFS) Sections. FFS images are put into Firmware Volumes (FVs,) and finally, the FV sections are combined into one or more Flash Device binary image (FD.)
The outputDir must be pointed out. Tool will generate a FV directory which includes a FFS directory, Fv file, Fv INf file and Fd file. The FFS directory contents all modules directory which contents Ffs files and section files. All output of GenFds tool output will be in FV directory. The FV directory structure is following. The outputDir should be point part of Efi file path. That mean for each of module which descript in the FDF file as the ‘InfFIle’ statement format  the GenFds tool would find out it’s input files from the path of  “ $(outputDir)\ $(Arch) \ $(ActivePlatfromName) \$(ModuleName) \$(ModuleName) \DEBUG
1.	If Arch list was pointed out, GenFds tool will use this Arch instead of Arch List in Target.txt file
2.	If Workspace was not pointed out, GenFds tool will use the Workspace path which set in OS environment. 
3.	If ActivePlatform was pointed out, GenFds tool will use this active platform as the current platform instead of active platform which in Target.txt file.
GenFds tool support 2 kinds of path in command line. Absolutely path and relative workspace path. The GenFds tool also support $(WORKSPACE) marco in path. For example, if the input Fdf like that $(WORKSPACE)\NT32PKg\Nt32.fdf, the tool will expand the $(WORKSPACE) macro with real path.
Options
-a,  --arch <ARCHS>
ARCHS is a comma separated (no space) list containing one or more of: IA32, X64, IPF or EBC which should be built, overrides target.txt’s TARGET_ARCH
-p, --platform PlatformName.dsc
Build the platform specified by the DSC file name argument, over rides the ACTIVE_PLATFORM
-f, --filename Filename			
Input FDF file and its format must follow FDF specification.
-r, --rom_image FdUiName				
Build the image using the [FD] section named by FdUiName.
-i, --FvImage UiFvName
	Buld the FV image using the [FV] section named by UiFvName
-o, --output Dir
The output directory of Genfds tool. And this directory also should be the directory of the EFI file.
-w –-workspace
	The workspace path working on.
-b --buildtarget DEBUG|RELEASE
Build target is one of: DEBUG, RELEASE.
-t --tagname TOOLCHAIN_TAG
Specify the tool chain to build the platform.
-D --define MACRO=VALUE
Pass macro to this tool.
-s --specifyaddress ADDRESS
Specify driver load address.
[--version]
	Print version and copyright of this program and exit
[-v, --verbose]
Turn on verbose output with informational messages printed. This is a count value, so specifying –vv can be used to increase the verbosity level.
[-q, --quiet]
	disable all messages except FATAL ERRORS
[-d, --debug [#]]
	Enable debug messages, at level #
[-h, --help]
	Print copyright, version and usage of this program and exit
Example
1. WORKSAPCE has already set. $(WORKSPACE) = c:\work\EdkII. The Fdf file is in c:\work\EdkII\Nt32pkg\Nt32pkg.fdf. Output directory is c:\work\EdkII\Build\Nt32\Debug_MyTools.  ActivePlatform is C:\work\EdkII\Nt32Pkg\Nt32Pkg.dsc
GenFds –f c:\work\EdkII\Nt32pkg\Nt32pkg.fdf –o c:\work\EdkII\Build\Nt32\Debug_MyTools –p c:\work\EdkII\Nt32pkg\Nt32Pkg.dsc
GenFds –f $(WORKSPACE)\Nt32Pkg\Nt32Pkg.fdf –o $(WORSPACE)\Build\Nt32\Debug_MyTools –p $(WORKSAPCE)\Nt32Pkg\Nt32Pkg.dsc

GenFds –f Nt32Pkg\Nt32Pkg.fdf –o Build\Nt32\Debug_MyTools –p Nt32Pkg\Nt32Pkg.dsc
2. Generate one FD which defined in FDF file. Use ‘-r’ and Fd UIName. The Fd  UIName is the name which defined in the FDf file, for detail information refer to FDF specification
GenFds –f GenFds –f c:\work\EdkII\Nt32pkg\Nt32pkg.fdf –o c:\work\EdkII\Build\Nt32\Debug_MyTools –p c:\work\EdkII\Nt32pkg\Nt32Pkg.dsc –r Fv_Recovery
3. Generate one FV which defined in FDF file. Use ‘-i’ and FV UiName. The FV UIName is the name which defined in the FDF file, for detail information refers to FDF specification.
GenFds –f c:\work\EdkII\Nt32pkg\Nt32pkg.fdf –o c:\work\EdkII\Build\Nt32\Debug_MyTools –p c:\work\EdkII\Nt32pkg\Nt32Pkg.dsc –I FVRecovery

4. Use command line option to replace the Arch List in Target.txt. 
GenFds –f c:\work\EdkII\Nt32pkg\Nt32pkg.fdf –o c:\work\EdkII\Build\Nt32\Debug_MyTools –p c:\work\EdkII\Nt32pkg\Nt32Pkg.dsc
-a IA32, X64
Bugs
Not found yet.
Files 
target.txt, platform.dsc, flashmap.fdf, package.dec and module.inf.
See also
 GenFv, GenFfs, GenSection, GenFw.
License
Copyright (c) 1999 - 2009, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available 
under the terms and conditions of the BSD License which accompanies this 
distribution.  The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.