Home

EDK II Flash Definition (FDF) File Format Specification

image

Contents

1. PI_STD PI_NONE lt MTS gt lt GuidedSection gt GUIDED lt NamedGuid gt lt GuidedOptions gt lt EOL gt lt MacroDefinition gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt EncapSec gt lt LeafSections gt lt TS gt n lt EOL gt lt GuidedOptions gt lt GuidAttrPR gt lt GuidAttrASV gt lt GuidHeaderSize gt lt GuidAttrPR gt PROCESSING REQUIRED lt Eq gt lt TrueFalse gt lt MTS gt lt GuidAttrASV gt AUTH STATUS VALID lt Eq gt lt TrueFalse gt lt MTS gt Version 1 24 December 2014 81 EDK II FDF File Format 82 lt GuidHeaderSize gt lt FvUiName gt lt FvStatements gt lt FvNameOrFilename gt lt FvFilename gt lt FdStatements gt lt FdNameOrFilename gt lt FdFilename gt lt AnyFile gt lt FvAttributes gt lt FileSystemGuid gt lt DepexExpSection gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt EDK II FDF File Spec EXTRA HEADER SIZE lt Eq gt lt Number gt lt MTS gt lt Word gt common FV lt Eq gt lt FvNameOrFilename gt lt EOL gt lt FvUiName gt lt FvFilename gt lt PATH gt lt Word gt fv FD lt Eq gt lt FdNameOrFilename gt lt EOL gt lt FdUiName gt lt FdFilename gt lt PATH gt lt Word gt fq FILE lt MTS gt DATA lt Eq gt lt NormalFile gt lt EOL gt MEMOR
2. lt TS gt FILE lt MTS gt lt FvType2 gt lt Eq gt lt NamedGuid gt lt Options gt lt EOL gt lt TS gt FILE lt MTS gt RAW lt Eq gt lt NamedGuidOrPcd gt lt Options gt lt EOL gt lt TS gt FILE lt MTS gt FV IMAGE lt Eg gt lt NamedGuidOrPcd gt lt Options gt lt EOL gt NAMED GUID lt RegistryFormatGUID gt lt Sym gt lt MTS gt e n lt Word gt n lt NamedGuid gt lt MTS gt PCD lt PcdName gt lt GuidValue gt lt MTS gt lt GuidCName gt lt GuidStructure gt lt CName gt lt RegistryFormatGUID gt lt CFormatGUID gt SEC PEI_CORE PEIM PET DXE COMBO FREEFORM DRIVER DXE_CORE APPLICATION SMM CORE SMM RELOCS_STRIPPED lt MTS gt RELOCS RETAINED lt MTS gt lt UseLocal gt lt FileOpts gt lt FileSpec gt lt KeyString gt lt KeyString gt lt Target gt lt TagName gt lt ToolArch gt lt Word gt TARGET lt Word gt TOOL CHAIN TAG lt Arch gt ARCH December 2014 Version 1 24 EDK II FDF File Spec lt FileOpts gt lt FfsAlignment gt lt FileSpec gt lt SimpleFile gt lt LeafSecType gt lt SbtGuid gt lt VarFile gt lt FName gt lt FilenameVariable gt lt ComplexFile gt lt EncapSection gt lt CompressSection gt lt CompType gt
3. lt VerSection gt lt UiSec gt lt FvImgSection gt lt DataSection gt lt DepexExpSection gt lt TS gt SECTION lt MTS gt lt VerArgs gt VERSION lt VerUniArg gt lt TS gt SECTION lt MST gt lt FfsAlignment gt UI lt VerUniArg gt lt TS gt SECTION lt MTS gt lt FfsAlignment gt FV_IMAGE lt FvimgArgs gt lt FfsAlignment gt lt Build gt BUILD NUM lt Eq gt lt BuildVal gt lt MTS gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt BUILD NUMBER lt Eq gt lt StringData gt lt NormalFile gt lt EOL gt lt UnicodeString gt lt Quotedstring gt lt Eq gt lt FvUiName gt lt MTS gt lt EOL gt lt MacroDefinition gt lt ExtendedFvEntry gt lt FvAlignment gt lt FvAttributes gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt December 2014 69 EDK II FDF File Format 70 lt DataSection gt lt KnownSection gt lt SecData gt lt LeafSecType gt lt SubTypeGuid gt lt STG Data gt lt ChkReloc gt lt SectionOrFile gt lt EncapSec gt lt EncapSection gt lt CompressSection gt lt CompType gt lt GuidedSection gt lt GuidedOptions gt lt GuidAttrPr gt lt GuidAttrASV gt EDK II FDF File Spec lt KnownSection gt lt SubTypeGuid gt lt TS gt SECTION lt MTS gt lt Ff
4. 03 1 019 ET 96 3 10 PCI OptionRomSection eee 99 3 11 UserkxtensionslSections mmm en teent 101 Appendix A Nt32Pkg Flash Descriptionrile 0 10 0 eren 103 Appendix B Gommon Erf r M8ss39g88 un iie eon Adiy a yel Allan ye en 115 B 14EDJSyntaXERrOrS imara a aaa al maya aa sa ilarkle siya a 115 B 2 FV Syntax Errors serren een ae a aan EE e ia 115 B 3 CAPSUEEI SYAtaXErr rstan an RD azan Rn 115 B4f RulelSyntaxErrors AA gt gt gt gt m m m m nnna nne nanenane nanen naene nennen 115 Appendix C FR OTS an EMER MEN MR 117 C 1 FD Reportss an a IR RER hard 117 CEZ EMIEReports an REIHE ES RnB ll e 117 C3 CAPSULE Rep lls nn kai 117 viii December 2014 Version 1 24 EDK II FDF File Spec Tables Table 1 EDK Build Infrastructure Support Matrix 2 Table 2 Well known Macro Statements nnee eeen enen venten eneen nennen 18 Table 3 UsingSystemEnvironmentVariable eenen nenne nenn nnn nennen 19 Table 4 Reserved Rule Section Macro Sirings 11 00 aaa 20 Table 5 Operator Precedence and Supported Operands eneen en ennen ennn ennen 23 Version 1 24 December 2014 ix EDK II FDF File Spec December 2014 Version 1 24 EDK II FDF File Spec Figures Figure 1 EDK II Build Data Flow Figure 2 EDK Il Create Image Flow Vers
5. lt AsciiChars gt 0x21 Ox7E lt CChars gt 0x21 0x23 0x5B 0x5D 0x7E lt EscapeSequence gt lt Db1Quote gt ee Ox22 lt EscapeSequence gt zis LAN n teny qipay b non 44 December 2014 Version 1 24 EDK II FDF File Spec lt TabSpace gt lt TS gt lt MTS gt lt Tab gt lt Space gt lt CR gt lt LF gt lt CRLF gt lt WhiteSpace gt lt WS gt lt Eq gt lt FieldSeparator gt lt FS gt lt Wildcard gt lt CommaSpace gt lt Cs gt lt AsciiString gt lt EmptyString gt lt CFlags gt lt PrintChars gt lt QuotedString gt lt CString gt lt NormalizedString gt lt GlobalComment gt lt Comment gt Version 1 24 EDK II FDF File Format lt DblQuote gt lt Tab gt lt Space gt lt TabSpace gt lt TabSpace gt 0x09 0x20 0x0D Ox0A lt CR gt lt LF gt lt TS gt lt CR gt lt LF gt lt CRLF gt lt WhiteSpace gt lt TS gt lt TS gt jn lt TS gt lt FieldSeparator gt lt TS gt nyn lt Space gt lt Space gt lt TS gt lt AsciiChars gt lt DblQuote gt lt DblQuote gt lt AsciiString gt lt TS gt lt CChars gt lt DblQuote gt lt PrintChars gt lt DblQuote gt L lt QuotedString gt lt DblQuote gt lt Word gt lt Space gt lt DblQuote gt lt WS gt lt AsciiString gt lt EOL gt lt AsciiString gt lt EOL gt Decem
6. 0x0CE000 0x002000 FTW Working Area gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageFtwWorkingBase gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageFtwWorkingSize Data 0x8D 0x2B OxFI OXFF 0x96 0x76 Ox8B Ox4C OxA9 0x85 0x27 0x47 0x07 Ox5B Ox4F 0x50 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format 0x85 OxAE 0x2D OxBF OxFE OxFF OxFF OxFF OxE4 Ox1F 0x00 0x00 OxFF OxFF OxFF OxFF 0x0D0000 0x010000 FTW Spare Block gEfiMyPlat formTokenSpaceGuid PcdFlashNvStorageFtwSpareBase gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageFtwSpareSize 0x0E0000 0x020000 gEfiMyPlatformTokenSpaceGuid PcdFlashFvRecoveryBase gEfiMyPlatformTokenSpaceGuid PcdFlashFvRecoverySize FV FV FvRecovery fv 3 6 FV Sections One or more of theses sections is required for platform images and not required for simple Option ROM generation Summary This describes the Fv section tag which is required in all platform FDF files This file is created by the platform integrator and is an input to the one or more parsing utilities Note that FvAttributes listed below may be set via PCD settings Setting the attribute via PCD takes precedence over the FvAttributes settings in this FDF file If the FvAttribute is not set by either a PCD or an FvAttribute line in the FDF file then the default value is FALSE the corresponding bit in the EFI_FV_ATTRIBUTE of the EFI FIRMWARE VOLUME PROTOCOL GetVolume
7. 99 99 2 6 1 Options Statement One and only one options statement IA32 RST BIN is permitted within any one vTF section This value is a path and name of IA32 BIOs reset vector binary 16 byte file If needed this binary can be put into the VTF file 2 6 2 Component Statements Within the section a components sub section starts with the comp NAME statement and terminates with either the start of another sub section major section or the end of the file Certain values for component statements are enumerated values or values that are within a given specification defined range Each of the component sections is used to complete a data structure using the following sequence Version 1 24 December 2014 37 FDF Design Discussion EDK II FDF File Spec Name Region Type Version Checksum Flag Path of Binary File Path of the Symbol File Preferred Size 2 7 Rule Sections The optional Rule sections in the FDF file are used for combining binary images not for compiling code Rules are use with the Fv section s module INF type to define how an FFS file is created for a given INF file The EDK II Build Specification defines the default rules that are implicitly used for creating FFS files The implicit rules follow the PI Specification and UEFI Specification The Rule section of the FDF file is used to define custom rules which may be applied to a given INF file listed in an Fv section This section is
8. Append The APPEND element is used to specify a workspace relative path and file name for a raw binary file The order that files will be appended is the order in which they are listed in the section Any driver that needs to access these files must have a prior knowledge of the content for example a new payload image as these files are not processed by the EDK II tools They have no section types or any other kind of identifier that has been defined by UEFI PI specifications Related Definitions Target Must match a target identifier in the EDK II tools_def txt file the first field where fields are separated by the underscore character Wildcard characters are not permitted TagName Must match a tag name field in the EDK II tools_def txt file second field Wildcard characters are not permitted Example Capsule Fob CAPSULE GUID 42857F0A 13F2 4B21 8A23 53D3F714B840 CAPSULE HEADER SIZE 32 FILE FV IMAGE EF41A0E1 40B1 481f 958E 6FB4D9B12E76 SECTION GUIDED 3EA022A4 1439 4ff 2 B4E4 A6F65A13A9AB SECTION FV_IMAGE Dxe APRIORI DXE INF a a a inf INE afe e ing INF a b b inf INE a d d inf 3 8 Rule Sections These are optional sections that describes the Rule content found in FDF files Summary This section is similar to the Fv section with the a few exceptions The INF Version 1 24 December 2014 85 EDK Il FDF File Format EDK II FDF File Spec 86 statements are not permitted with
9. Intel processors based on 32 bit Intel architecture IA 32 are little endian machines This distinction means that the low order byte of a multi byte data item in memory is at the lowest address while the high order byte is at the highest address Processors of the Intel Itanium processor family may be configured for both little endian and big endian operation All implementations designed to conform to this specification will use little endian operation In some memory layout descriptions certain fields are marked reserved Software must initialize such fields to zero and ignore them when read On an update operation software must preserve any reserved field The data structures described in this document generally have the following format 6 December 2014 Version 1 24 EDK II FDF File Spec Summary Introduction A brief description of the data structure Prototype An EBNF type declaration for the data structure Parameters Explanation of some terms used in the prototype Example Sample data structure using the prototype 1 5 2 Pseudo Code Conventions Pseudo code is presented to describe algorithms in a more concise form None of the algorithms in this document are intended to be compiled directly The code is presented at a level corresponding to the surrounding text In describing variables a ist is an unordered collection of homogeneous objects A queue is an ordered list of homogeneous
10. DEFINE MMP U MT MdeModulePkg Universal MemoryTest INF VERSION 1 1 MMP_U_MT NullMemoryTestDxe NullMemoryTestDxe inf Valid options for the INF file line are RuleOverride RuleName This permits the platform integrator with a method to override the default rules built into tools specified in the EDK II Build Specification which follows the UEFI and PI specifications for EFI FileType construction If the module is a binary module the default rules are implied by the processor module type and BINARY rule name Using the explicit named rule here may compromise the platform s PI specification compliance The RuleName is either the reserved word BINARY that only applies to INF files that contain only binary content or the RuleUiName of a Rule section in this FDF file USE ARCH The USE ARCH option is used to differentiate if a single INF file is built different ways for example a single INF file is called out multiple times in the DSC file when building the same module for more than one processor architecture VERSION String The VERSION option is used to create an EFI SECTION VERSION section with the FFS file DI String The UI option is used to create an EFI SECTION USER INTERFACE section for an INF that may not have specified one When RuleOverride is not specified for binary module INF GenFds tool will find the FFS rule with BINARY rule name If RuleOverride is specified GenFds tool will still find FFS rule with th
11. MACRO in the ifdef and ifndef statements This functionality may disappear in future releases therefore it is recommended that platform integrators update their DSC files if they also alter other content When using string comparisons of Macro elements to string literals the format of the conditional directive must be lif MACRO Literal String Note For backward compatibility tools may allow testing literal strings that are not encapsulated by double quotation marks This functionality may disappear in future releases therefore it is recommended that platform integrators update their DSC files if they also alter other content When testing Macro against another Macro lif MACROALPHA MACROBETA When testing a Macro against a value lif MACRONUM or if MACROBOOL TRUE When used in either the if or elseif statements or in an expression used in a value field a macro that has not been defined has a value of 0 Macro Definition statements that appear within a section of the file other than the Defines section are scoped to the section they are defined in If the Macro statement is within the Defines section then the Macro is common to the entire file with local definitions taking precedence if the same MACRO name is redefined in subsequent sections then that MACRO value is local to only that section Macros are evaluated where they are used in conditional directives or other statements not
12. The UserExtensions section modifier usage is shown below UserExtensions UserID Identifier 40 December 2014 EDK II FDF File Spec Version 1 24 EDK II FDF File Spec 3 EDK II FDF File Format This section of the document describes the content of the EDK II FDF sections using an Extended Backus Naur Form Binary Only modules not listed in the platform DSC file can be specified in the FDF file There may also be modules listed in the DSC file that are not required in the FDF file When a module listed in the DSC and is excluded from FDF file then a UEFI compliant binary will be generated but the binary will not be put into any firmware volume 3 1 General Rules The general rules for all EDK II INI style documents follow Note Path and Filename elements within the FDF are case sensitive in order to support building on UNIX style operating systems Additionally names that are C variables or used as a macro are case sensitive Other elements such as section tags or hex digits in the FDF file are not case sensitive The use of and in paths and filenames is strictly prohibited e Multiple FDF files may exist in a directory e Text in section tags is case in sensitive e A section terminates with either another section definition or the end of the file e Token statements terminate with the start of a new token statement such as the start of a new section or the end of the file e To append comment informati
13. This value refers to the VERSION STRING element in the INF file s Defines section not the INF VERSION element which is assigned based on the INF specification revision SUBTYPE GUID This is short hand notation refering to content that will be placed in a Section of type EFI SECTION FREEFORM SUBTYPE GUID A single EFI SECTION FREEFORM SUBTYPE GUID section is permitted in an FFS File of type EFI FV FILETYPE FREEFORM RuleUiName A unique single word identifier The word BINARY is reserved it is recommended that it be used for the rules that process INF modules that only contain binary content COMPRESS Compression sections that use PI STD compression do not have PROCESSING REQUIRED TRUE flag it is only required for GUIDED sections User Interface UI entries There are three possible methods for specifying a User Interface string 1 Specify the string value in the FDF file 2 specify a plain ASCII text file that has an extension of ui or 3 specify a UCS 2LE encoded file with an extension of uni that contains a single Unicode string Related Definitions Target Must match a target identifier in the EDK II tools_def txt file the first field where fields are separated by the underscore character Wildcard characters are not permitted TagName Must match a tag name field in the EDK II tools def txt file second field Wildcard characters are not permitted Version 1 24 December 2014 93 EDK Il
14. lt EOL gt lt TS gt COMP LOC lt Eq gt lt Location gt lt EOL gt lt TS gt COMP TYPE lt Eq gt lt CompType gt lt EOL gt lt TS gt COMP VER lt Eq gt lt Version gt lt EOL gt lt TS gt COMP CS lt Eq gt 1 0 lt EOL gt lt TS gt COMP BIN lt Eq gt lt BinFile gt lt EOL gt lt TS gt COMP SYM lt Eq gt lt SymFile gt lt EOL gt lt TS gt COMP SIZE lt Eq gt lt Size gt lt EOL gt lt Location gt lt FvUiName gt NONE None none lt FS gt lt Region gt lt Region gt siz YEN Ne esn eme unu PH PL lt CompType gt siz FIT PAL B PAL A OEM lt Byte gt lt Byte gt Ox lt HexDigit gt lt HexDigit gt lt Version gt z lt Major gt lt Minor gt lt BcdHex gt lt Major gt 0 9 0 9 lt Minor gt 0 9 0 9 lt BcdHex gt 0x lt Major gt 0 9 0 9 lt BinFile gt lt PATH gt lt Filename gt lt SymFile gt lt PATH gt lt Filename gt lt Size gt lt Integer gt lt HexNumber gt Restrictions FName All file specified paths are relative to the WORKSPACE directory In some cases the 96 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format tools will search well known paths for some files for example for FD filenames the output will typically be located in the OUTPUT_DIRECTORY TARGET _ TAGNAME FV d
15. lt HexDigit gt lt HexDigit gt lt RawH2 gt lt RawH4 gt lt OptRawH4 gt lt RawH4 gt lt OptRawH4 gt lt OptRawH4 gt lt RawH4 gt lt Hex8 gt lt CommaSpace gt lt Hex4 gt lt CommaSpace gt Version 1 24 EDK II FDF File Spec EDK II FDF File Format lt Hex4 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt lt CommaSpace gt lt Hex2 gt nn lt CArray gt lt NList gt lt CArray gt lt NList gt lt HexByte gt lt CommaSpace gt lt HexByte gt lt RawData gt lt TS gt lt HexByte gt lt Cs gt lt HexByte gt lt EOL gt lt TS gt lt Integer gt 0 9 1 9 0 9 lt Number gt lt Integer gt lt HexNumber gt lt HexNz gt x1 xFFFFFFFFFFFFFFFF lt NumNz gt 1 18446744073709551615 lt GZ gt lt NumNz gt lt HexNz gt lt TRUE gt ire TRUE true True 0x1 xd 1 lt FALSE gt FALSE false False 0x0 ox00 mor lt BoolType gt lt TRUE gt lt FALSE gt lt MACRO gt A Z A Z0 9 lt MACROVAL gt lt MACRO gt lt PcdName gt lt TokenSpaceGuidCName gt lt PcdCName gt lt PcdCName gt lt CName gt lt TokenSpaceGuidCName gt lt CName gt lt PCDVAL
16. lt PcdName gt lt TS gt FV lt Eq gt lt FvNameOrFilename gt lt EOL gt lt TS gt FILE lt Eq gt lt BinaryFile gt lt EOL gt December 2014 61 EDK Il FDF File Format EDK II FDF File Spec 62 lt DataType gt lt TS gt DATA lt Eq gt lt EOL gt lt DataContent gt lt TS gt lt EOL gt lt DataContent gt lt TS gt lt RawData gt lt CFormatGUID gt lt UINT8z gt lt EOL gt lt BinaryFile gt lt Location gt lt File gt lt Location gt lt BuildId gt lt PATH gt lt BuildId gt lt VarLoc gt FV lt arch gt lt VarLoc gt OUTPUT_DIRECTORY TARGET TOOL_CHAIN TAG lt FvNameOrFilename gt lt FvUiName gt lt FvFilename gt lt FvUiName gt lt Word gt common lt FvFilename gt lt PATH gt lt Word gt fv Fv Fv Restrictions For the FvFilename the PATH is relative to the EDK II environment variable WORKSPACE If the path is not specified the PATH defaults to the following location where OUTPUT DIRECTORY is specified in the EDK II Platform DSC file s Defines section If a path is not present or the fv file extensions do not appear in the value the build system will use a filename based on the UiFvFilename specified in the FDF file OUTPUT DIRECTORY TARGET _ TOOL CHAIN TAG FV For the Binary File the PATH must be relative to the EDK II environment variable
17. lt Rule gt lt SetVer gt lt SetUi gt USE lt Eq gt lt TargetArch gt lt MTS gt lt arch gt RuleOverride lt Eq gt lt RuleUiName gt BINARY lt MTS gt VERSION lt Eq gt lt CString gt lt MTS gt UI lt Eq gt lt CString gt lt MTS gt MODULE TYPE SEC MODULE TYPE PEI CORE December 2014 67 EDK II FDF File Format 68 lt RelocFlags gt lt FileStatements gt lt typel gt lt type2 gt lt type3 gt lt type4 gt lt type5 gt lt FvTypel gt lt FvType2 gt lt NamedGuidOrPcd gt lt NamedGuid gt lt Optionsl gt lt Options2 gt lt FileOpts gt lt FfsAlignment gt EDK II FDF File Spec MODULE TYPE PEIM lt PATH gt lt Word gt inf lt FS gt lt RelocFlags gt lt EOL gt else lt PATH gt lt Word gt inf lt EOL gt RELOCS STRIPPED RELOCS RETAINED lt typel gt lt type2 gt lt type3 gt lt type4 gt lt type5 gt lt EOL gt lt TS gt FILE lt MTS gt lt FvTypel gt lt Eq gt lt NamedGuid gt lt Optionsl gt lt TS gt FILE lt MTS gt lt FvType2 gt lt Eq gt lt NamedGuid gt lt Options2 gt lt TS gt FILE lt MTS gt RAW lt Eq gt lt NamedGuidOrPcd gt lt Options2 gt lt TS gt FILE lt MTS gt NON FFS FILE lt Eq gt lt NamedGuid gt lt Options2 gt lt TS gt FILE lt MTS gt FV IMAGE lt Eq gt lt NamedGuidOrPcd gt lt Options2 gt
18. Note The total path and file name length is limited by the operating system and third party tools It is recommended that for EDK Il builds that the WORKSPACE directory be either a directory under a subst drive in Windows s build as an example or be located in either the opt directory or in the user s home username directory for Linux and OS X 2 1 Processing Overview The EDK II FDF file describes information about flash parts as well as rules for combining binaries Firmware Image built from a DSC file Additionally if a DSC file specifies a FLASH DEFINITION file then the EDK II tools will locate the FDF file looking in the same directory as the DSC file or a directory under the current WORKSPACE then the parsing utilities will scan the FDF file to gather PCD information that can be used by AutoGen utilities for building components or modules 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 The second phase of the build process consumes the images generated during the first phase using statements and rules defined in the FDF Version 1 24 December 2014 9 FDF Design Discussion EDK II FDF File Spec file to process the PE32 PE32 Coff images files into one or more EFI sections 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 pu
19. WORKSPACE If not specified the PATH defaults to the directory location of the EDK II Platform DSC file If not found the tools must test the directory location of this FDF file if different from the directory containing the Platform s DSC file If a GUID is used either the C format or Registry Format in the data content tools will be required to process the GUID into a byte array Raw Data arrays in FDF files are always listed as byte arrays using little endian format Numbers listed in the DataContent section must be zero filled in order to determine the size of the element For example a UINT16 value of 1 must be specified as 0x0001 Parameters FdUiName This name is used by the GenFds tool to generate FD image files If not present only one FD section is allowed and the GenFds tool will use the name of the active platform as the name of the FD image UiCapsuleName The UiCapsuleName must be specified in a Capsule section header defined in this the file FvUiName The FvUiName must be specified in a FV section header defined in this the file December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format PcdValue The PCD Value may be a specific numeric value an array of numeric bytes a GUID a quoted string an L quoted string representing a unicode string an arithmetic expression a logic expression or a macro from a previously defined macro statement Expression Refer to the EDK II Express
20. lt GuidedSection gt lt GAttr gt lt GuidAttrPR gt lt GuidAttrASV gt Version 1 24 EDK II FDF File Format Fixed lt MTS gt lt FfsAlignment gt Checksum lt MTS gt Align lt Eq gt lt FfsAlignmentValues gt lt MTS gt lt SimpleFile gt lt ComplexFile gt lt SbtGuid gt lt LeafSecType gt lt FileOpts gt lt VarFile gt lt EOL gt COMPAT16 PE32 pIc TE FV_IMAGE RAW DXE DEPEX UI PEI_DEPEX SMM DEPEX VERSION SUBTYPE GUID lt MTS gt lt GuidValue gt lt MTS gt lt FName gt lt EOL gt lt FilenameVariable gt lt FName gt lt Ext gt lt PATH gt lt Word gt lt Word gt INF OUTPUT MODULE NAME mm lt Word gt lt EOL gt lt EncapSection gt lt LeafSections gt lt TS gt lt EOL gt lt TS gt lt CompressSection gt lt GuidedSection gt COMPRESS lt MTS gt lt CompType gt lt EOL gt lt EncapSec gt lt LeafSections gt lt EOL gt lt TS gt lt EOL gt PI_STD PI_NONE lt MTS gt GUIDED lt MTS gt NAMED GUID lt MTS gt lt GAttr gt lt EOL gt lt EncapSec gt lt LeafSections gt lt TS gt lt EOL gt lt GuidAttrPR gt lt GuidAttrASV gt lt GuidHeaderSize gt PROCESSING REQUIRED lt Eq gt lt BoolType gt lt MTS gt AUTH STATUS VALID lt Eq gt lt BoolType gt lt MTS gt December 2014 89 EDK II FDF F
21. 0x27 0x47 0x07 OX5B Ox4F 0x50 0x8D Ox2B OxXF1 OxFF 0x96 0x76 Ox8B Ox4C OxA9 0x85 0x27 0x47 0x07 0x5B Ox4F 0x50 FvLength 0x20000 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 Signature FVH Attributes ox5f 0x46 0x56 0x48 Oxff Oxfe 0x04 0x00 HeaderLength CheckSum ExtHeaderOffset Reserved Revision 0x48 0x00 0x36 0x09 Ox00 0x00 0x00 0x02 Blockmap 0 2 Blocks 0x10000 Bytes Block 0x02 0x00 Ox00 Ox00 Ox00 0x00 Ox01 0x00 Blockmap 1 End 0x00 0x00 Ox00 Ox00 0x00 0x00 0x00 0x00 This is the VARIABLE STORE HEADER Signature gEfiVariableGuid Oxddcf3616 0x3275 0x4164 0x98 Oxb6 Oxfe 0x85 0x70 Ox7f Oxfe 0x7d 0x16 0X36 Oxct Oxdd 0x75 0x32 0x64 0x41 0x98 Oxb Oxfe 0x85 0x70 Ox7 Oxfe 0x7d Size 0xc000 gEfiMdeModulePkgTokenSpaceGuid PcdFlashNvStorageVariableSize Version 1 24 December 2014 105 Nt32Pkg Flash Description File EDK II FDF File Spec 0x48 size of EFI FIRMWARE VOLUME HEADER OXxBFB8 This can speed up the Variable Dispatch a bit OxB8 OxBF 0x00 0x00 FORMATTED Ox5A HEALTHY OxFE Reserved UINT16 Reserved1 UINT32 Ox5A OXFE 0x00 0x00 0x00 0x00 0x00 0x00 0x0028c000 0x00002000 NV_EVENT_LOG gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashNvStorageEventLogBase gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashNvStorageEventLogSize 0x0028e000 0x00002000 gEfiNt32PkgTokenSpaceGuid PcdWinNt
22. 1 24 EDK II FDF File Spec Rule Common UEFI APPLICATION FILE APPLICATION NAMED GUID COMPRESS PI STD GUIDED PE32 PE32 INF OUTPUT MODULE NAME efi UI STRING MODULE NAME Optional VERSION STRING S INF_VERSION Optional BUILD NUM BUILD NUMBER Version 1 24 December 2014 Nt32Pkg Flash Description File 113 Nt32Pkg Flash Description File EDK II FDF File Spec 114 December 2014 Version 1 24 EDK II FDF File Spec Appendix B Common Error Messages Standard build tools must throw error messages halting the build Warning messages may be emitted from build tools unless a quiet flag has been set on the command line B 1 FD Syntax Errors Missing required Token statements report line number and file name Size of the FV s is larger than the Region Size Ox X specified The named FV s is not listed in the FDF file Size of the DATA is larger than the region size specified Size of the FILE s is larger than the region size specified The region at Offset Ox X cannot fit into Block array with BlockSize X Region s is not in the FD address scope B 2 FV Syntax Errors Missing required Token statements report line number and file name Incorrect alignment in the FV B 3 CAPSULE Syntax Errors No capsule specific errors as all capsule errors are captured under other parser errors B 4 Rule Syntax Errors Unable to find rule for INF s Module built under di
23. 1 24 EDK II FDF File Spec Introduction Component An executable image Components defined in this specification support one of the defined module types DEC EDK II meta data package declaration file This file declares all public elements of a package containing similar content DEPEX Module dependency expressions that describe runtime process restrictions Dist This refers to a distribution package that conforms to the UEFI Platform Initialization Distribution Package Specification DSC EDK II meta data platform description file This file describes what gets built and makes statements that affect how it is built DXE Framework Driver Execution Environment phase DXE SAL A special class of DXE module that produces SAL Runtime Services DXE SAL modules differ from DXE Runtime modules in that the DXE Runtime modules support Virtual mode OS calls at OS runtime and DXE SAL modules support intermixing Virtual or Physical mode OS calls DXE SMM A special class of DXE module that is loaded into the System Management Mode memory DXE Runtime Special class of DXE module that provides Runtime Services EBNF Extended Backus Naur Form meta syntax notation with the following additional constructs square brackets surround optional items suffix for a sequence of zero or more of an item suffix for one or more of an item suffix for zero or one of an item curly braces enclosing a list of al
24. FAMILY is considered a list of families that different TOOL CHAIN TAG values belong to The TOOL CHAIN TAG is defined in the Conf target txt or on the command line The FAMILY is associated with the TOOL CHAIN TAG in the Conf tools def txt file or the TOOLS DEF CONF file specified in the Conf target txt file file While different family names can be defined ARMGCC GCC INTEL MSFT RVCT RVCTCYGWIN and XCODE have been predefined in the tools def txt file S ARCH ARCH is considered the list of architectures that are to be built that were specified on the command line or come from the Conf target txt file TOOL CHAIN TAG TOOL CHAIN TAG is considered the list of tool chain tag names specified on the command line TARGET TARGET is considered the list of target such as DEBUG RELEASE and NOOPT names specified on the command line or come from the Conf target txt file Version 1 24 December 2014 23 FDF Design Discussion EDK II FDF File Spec For logical expressions any non zero value must be considered TRUE Invalid expressions must cause a build break with an appropriate error message 2 3 FD Sections The FD sections are made up of the definition statements and a description of what goes into the Flash Device Image Each FD section defines one flash device image A flash device image may be one of the following Removable media bootable image like a boot floppy image a System Flash image that would be b
25. FOO lifndef BAR FOO defined BAR not defined lelse FOO defined BAR is defined lendif lelseif BARFOO FOO is not defined BARFOO is defined as TRUE lelseif S BARFOO FOOBAR FOO is not defined BARFOO is defined as FOOBAR lelse FOO is not defined while BARFOO is either NOT defined or does not equal FOOBAR lendif 2 2 9 Expressions Expressions can be used in conditional directive comparison statements and in value fields for Macros and PCDs in the DSC and FDF files Expressions follow C relation eguality logical and bitwise precedence and associativity Not all C operators are supported only operators in the following list can be used Note Due to the flexibility of the build system a new operator IN has been added that can be used to test whether an element is in a list The format for this is lt Value gt IN lt MACRO LIST gt where MACRO LIST can only be one of ARCH FAMILY TOOL CHAIN TAG and TARGET Use of parenthesis is encouraged to remove ambiguity When comparing a string to a number or boolean value a warning message will be emitted In this case the tools will always evaluate the expression using the and EQ operators to FALSE using the and NE operators to TRUE other operator comparisons are not supported and will cause the build system to terminate with an error message Comparing a number to a boolean value no warning message will be emitt
26. application that follows the UEFI specification The only difference between a UEFI application and a UEFI driver is that an application is unloaded from memory when it exits regardless of return status while a driver that returns a successful return status is not unloaded when its entry point exits UEFI Driver A driver that follows the UEFI specification UEFI Specification Version 2 4 Current UEFI version UEFI Platform Initialization Distribution Package Specification 1 0 The current version of this specification includes Errata B UEFI Platform Initialization Specification 1 3 Current version of the UEFI PI specification Unified EFI Forum A non profit collaborative trade organization formed to promote and manage the UEFI standard For more information see www uefi org VFR Visual Forms Representation VPD Vital Product Data that is read only binary configuration data typically located within a region of a flash part This data would typically be updated as part of the firmware build post firmware build via patching tools through automation on a manufacturing line as the FLASH parts are programmed or through special tools 1 4 Target Audience This document is intended for persons performing UEFI or PI compliant platform development and support for different platforms 1 5 Conventions Used in this Document This document uses typographic and illustrative conventions described below 1 5 1 Data Structure Descriptions
27. at the time of the UDK2010 SR1 release Updated to support VEFI version 2 3 1 and updated spec release dates in Introduction Clarify UEFI s PI Distribution Package Specification Standardize Common data definitions for all specifications Added NOTE in 3 2 saying the sections must appear in the order listed above Spelling and punctuation fixes Do not require the FDF_SPECIFICATION to be updated if that is the only thing that changes Removed duplicate content and added the scoping rules for Macros clarified MACRO Summary Added statement to allow specifying an FD in a Capsule as well as to allow any file in a Capsule Removed references to system environment variables in the Macros section Clarify that C data arrays must be byte arrays for PCD value fields allowing C format GUID structures as well Updated conditional rules in 2 2 8 for how to use macro and PCDs updated PCD usage in conditional statements Add clarification to require a comparison operator for string tokens no atomic string in expressions for conditional directives Updated expression descriptions Allow a PCD s value to be used in other sections not just the section it was defined in Added table of valid environment variables that can be used in this file put in table of System Environment variables and the EDK II Global macro values Updated how macros can be used in 2 2 6 updated where macros are evaluated Provide rules for how macros ca
28. attributes specified in a Platform Configuration Database PCD mixed modules with both binary and source modules Multiple modules can be combined into a package and multiple packages can be combined into a single package PCD Platform Configuration Database PEI Pre EFI Initialization Phase PEIM An API named by a GUID PPI A PEIM to PEIM Interface that is named by a GUID Protocol An API named by a GUID Runtime Services Interfaces that provide access to underlying platform specific hardware that might be useful during OS runtime such as time and date services These services become active during the boot process but also persist after the OS loader terminates boot services SAL System Abstraction Layer A firmware interface specification used on Intel Itanium Processor based systems SEC Security Phase is the code in the Framework that contains the processor reset vector and launches PEI This phase is separate from PEI because some security schemes require ownership of the reset vector SKU Stock Keeping Unit SMM System Management Mode A generic term for the execution mode entered when a CPU detects an SMI The firmware in response to the interrupt type will gain control in physical mode For this document SMM describes the operational regime for IA32 and x64 processors that share the OS transparent characteristics Version 1 24 December 2014 5 Introduction EDK II FDF File Spec UEFI Application An
29. brackets of a section specifier Duplicate sections two sections with identical section tags will be merged by tools with the second section appended to the first If architectural modifiers are used in the UserExtensions section tag the section is merged by tools with content from common sections if specified with the architectural section appended to the first into an architectural section For example given the following UserExtensions NoSuchCorp POST PROCESS common exec postprocessl UserExtensions NoSuchCorp POST PROCESS IA32 exec postprocess2 a IA32 UserExtensions NoSuchCorp POST PROCESS X64 exec postprocess2 a X64 After the first pass of the tools for IA32 the UserExtensions section will logically be UserExtensions NoSuchCorp POST PROCESS IA32 exec postprocess1 exec postprocess2 a IA32 while for x64 the UserExtensions section will logically be UserExtensions NoSuchCorp POST PROCESS xX64 exec postprocess1 exec postprocess2 a X64 The Rules and VTF sections allow the use of architectural modifiers however the content must specific to an individual architecture or common to all architectures Therefore the architectural sections take priority over common section content The cannot be combined with a common architecture The FD FV Capsule and OptionRom sections cannot specify architectural modifiers Version 1 24 December 2014 13 FDF Design Discussion EDK II FDF File S
30. example above There are three FFS files in the Fv Root and one Encapsulated FV image with the build tools creating an APRIORI file that will dispatch the DXE CORE first then the CPU module second In the FV image named Dxe there will be at least five FFS files the APRIORI file listing the GUID names of a inf c inf and b inf which will be dispatched in this order Once complete the d inf module will be dispatched 2 4 5 INF Statements The INF statements point to EDK component and EDK II module INF files Parsing tools will scan the INF file to determine the type of component or module The component or module type is used to reference the standard rules defined elsewhere in the FDF file The format for INF statements is INF Options PathAndInfFileName The PathAndInfFileName is the WORKSPACE relative path and filename Using an INF statement will cause the build tools to implicitly build an FFS file with the EFI FV FILETYPE based on the INF module s MODULE TYPE and content For example specifying the following lines in an FV section will generate an FFS file with an EFI FV FILETYPE DRIVER with three sections the EFI SECTION PE32 an EFI SECTION VERSION and an EFI SECTION DXE DEPEX While there is no version file defined in the INF it has been specified by the VERSION option and there is a Version 1 24 December 2014 31 FDF Design Discussion EDK II FDF File Spec dependency file specified in the INF file s source file list
31. gt lt FdImage gt lt FdUiName gt lt NormalFile gt lt SectionData gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt LeafSections gt lt VerSection gt lt UiSection gt lt FvImgSection gt lt VerArgs gt lt Build gt lt BuildVal gt lt UniArg gt lt StringData gt Version 1 24 EDK II FDF File Format lt FvImage gt lt FdImage gt lt NormalFile gt FV lt Eq gt lt FvUiName gt lt EOL gt FD lt Eq gt lt FdUiName gt lt EOL gt lt Word gt common lt PATH gt lt Word gt lt Word gt lt EOL gt lt MacroDefinition gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt EncapSec gt lt LeafSections gt APRIORI PEI lt EOL gt lt DefineStatements gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt lt MTS gt APRIORI DXE lt EOL gt lt DefineStatements gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt lt MTS gt lt VerSection gt lt UiSec gt lt FvImgSection gt lt DataSection gt lt DepexExpSec gt SECTION lt MTS gt lt VerArgs gt VERSION lt MTS gt lt UniArg gt SECTION lt MTS gt lt FfsAlignment gt UI lt MTS gt lt UniArg gt SECTION lt MTS gt lt FfsAlignment gt FV_IMAGE lt MTS gt lt FvImgArgs gt lt FfsAlignment gt lt Build gt BUILD NUM lt Eq gt lt BuildVal gt lt MTS gt a A
32. is processed first then C D is processed and finally the two results are added A B C D Space and tab characters are permitted around field separators 2 2 4 Naming Conventions The EDK II build infrastructure is supported under Microsoft Windows Linux and MAC OS X operating systems As a result of multiple environment support all directory and file names are case sensitive e The use of special characters in directory names and file names is restricted to the dash underscore and period characters respectively _ and e Period characters may not be followed by another period character File and Directory names must not start with or e Directory names and file names must not contain space or tab characters e Directory Names must only contain alphanumeric characters underscore or dash characters and it is recommended that they start with an alpha character e Additionally all EDK II directories that are architecturally dependent must use a name with only the first character capitalized Ia32 Ipf X64 and Ebc are valid architectural directory names IA32 IPF and EBC are not acceptable directory December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion names and may cause build breaks From a build tools perspective an IA32 directory name is not equivalent to Ia32 or ia32 An architecture used in a directory name must be listed in a section that uses the architec
33. optionRom sections allow for extending the FDF for processing of stand alone legacy PCI Option ROM images or stand alone UEFI PCI Option ROM images A required modifier DriverName will specify where in the build s FV directory the OptionROM file will be placed If the user is only creating PCI Option ROM images then the Fv and FD sections are not required If an FD and FV sections exist then the tools will create the FD image as well as the Option ROM image If they are not in the FDF file then they will only generate the Option ROM image Each OptionRom section terminates with either the start of another section or the end of the file The OptionRom section header usage is shown below OptionRom ROMName If more than architecture for example IA32 and EBC for the driver is to be bundled in an option rom file then more than one INF entry specified by the USE option can be used to include the other architecture Having different sections for the same option rom driver for different architectures is not permitted This is an optional section for platform images 2 9 UserExtensions Sections The EDK II UserExtensions sections allow for extending the FDF with custom processing of a flash image Both the UserID and the Identifier modifier fields are required Each UserExtensions section terminates with either the start of another section or the end of the file Version 1 24 December 2014 39 FDF Design Discussion
34. overriding previous definitions for the remainder of the file Macros may be used in other macros or in conditional directive statements Macros can be defined or used in the Defines FD FV Capsule and OptionROM sections Macros defined in common sections may be used in the architecturally modified sections of the same section type Macros defined in architectural sections cannot be used in other architectural sections nor can they be used in the common section Section modifiers in addition to the architectural modifier follow the same rules as architectural modifiers Macros must be defined before they can be used Macro evaluation is done at the time the macro is used in an expression conditional directive or value field not when a macro is defined Macros in quoted strings will not be expanded by parsing tools all other macro values will be expanded without evaluation as other elements of the build system will perform any needed tests Example FV common FILE FV IMAGE EF41A0E1 40B1 481f 958E 6FB4D9B12E76 FvAlignment 512K WRITE POLICY RELIABLE TRUE SECTION GUIDED 3EA022A4 1439 4ff2 B4E4 A6F65A13A9AB SECTION FV_IMAGE Dxe APRIORI DXE INF WORKSPACE a a inf INF EDK SOURCE a c c inf INF WORKSPACE a b b inf INF a d d inf The Rule section of the FDF file allows for using macros that are also defined for the EDK II build_rule txt file The following table provides the list of t
35. sections must be listed in the above order within the FDF file Changing the order may cause the build to break 3 2 1 Common Definitions Summary The following are common definitions used by multiple section types Version 1 24 December 2014 43 EDK II FDF File Format EDK II FDF File Spec Prototype lt Word gt a zA 20 9 a zA Z0 9 Alphanumeric characters with optional period dash and or underscore characters A period character may not be followed by another period character No white space characters are permitted lt SimpleWord gt siz a ZA Z0 9 a zA 20 9 A word that cannot contain a period character lt ToolWord gt A Z a zA Z0 9 Alphanumeric characters white space characters are not permitted lt FileSep gt oa w m lt Extension gt a zA Z0 9 One or more alphanumeric characters lt File gt lt Word gt lt Extension gt lt PATH gt lt MACROVAL gt lt FileSep gt lt RelativePath gt lt RelativePath gt lt DirName gt lt FileSep gt lt DirName gt lt DirName gt lt Word gt lt MACROVAL gt lt FullFilename gt lt PATH gt lt FileSep gt lt File gt lt Filename gt lt PATH gt lt FileSep gt lt File gt lt Chars gt a zA 20 9 lt Digit gt z 0 9 lt NonDigit gt siz a ZA Z_ lt Identifier gt lt NonDigit gt lt Chars gt lt CName gt lt Identifier gt A valid C variable name
36. vennen vennen ennen ennn ennen ennn 37 2 6 2 Component Statements eneen eenen vensenen vene venenens ennen venen ennn 37 Version 1 24 December 2014 vii EDK II FDF File Spec 2 7 Rule Sections Ren RD Seen 38 2 8 OptionRom Sections nannte blm nl kik Rn 39 2 9 UserExtensions Sections u0 snssnsennnennnennnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnne 39 3 EDK II FDF File Formal ana a Da 41 3 1 General Rules ea en ne nes nennen dee 41 3 1 1 Line Extension Backslash ans aans ones enn enen e 41 3 1 2 Whitespace characters enen ennn teeta enen ennsnnnnnnennnsnensnnnnennennnn 42 3 1 3 Paths for filenames unseren ven eenn vens ennn enn E E E e a a nnen 42 32 DF We i PbO ibs enter Ki delaware Pe eneen 42 3 2 1 Common Definitions ennen eneen enen ven ven e enn ennen ennn ennn 43 3 2 2 MACRO Statements medi enn ennen ennen vensennnennns 52 3 2 3 Conditional Directive Blocks nanne enn enn enen enen ennnnnnnensnensnnnnnnnnnnnennnn 53 3 2 4 linclude Statements aanne one one ennn ennn teeta tea ennen ennennnannnnnnnennnennnn 58 3 3 Header Section ners nnn vern anerkennen 58 34 Defines Section saral laa kana iii 60 3 9 FD SEG ONS 44 4 ieh eben Hr lamd alk ale aker 62 3 6 FV SE NONS sis aaa ra aa daa lala EE Bel Gy eh 67 3 CapsulelSections eee 77 3 8 Rule SeclioNss aaa II a 88 ESHA US
37. 1 24 EDK II FDF File Spec lt Depex gt lt PeiDepexExp gt lt PeiDepex gt lt BoolStmt gt lt Boolean gt lt GuidCName gt lt BoolExpress gt lt OP gt lt DepInstruct gt lt DxeDepexExp gt lt DxeExp gt lt DxeDepex gt lt SorStmt gt lt GuidStmt gt lt SmmDepexExp gt Version 1 24 EDK II FDF File Format MODULE_TYPE DXE_CORE MODULE TYPE SMM CORE MODULE TYPE SEC No DEPEX section is permitted if MODULE TYPE PEIM lt PeiDepexExp gt elif MODULE TYPE DXE SMM DRIVER lt SmmDepexExp gt lt DxeDepexExp gt else lt DxeDepexExp gt SECTION lt MTS gt PEI DEPEX EXP lt Eg gt lt EOL gt lt PeiDepex gt lt EOL gt lt FfsAlignment gt lt BoolStmt gt lt EOL gt lt MTS gt lt DepInstruct gt lt EOL gt lt MTS gt end lt EOL gt lt Boolean gt lt BoolExpress gt lt GuidCName gt lt EOL gt TRUE FALSE lt GuidCName gt lt CName gt A Guid C Name lt GuidCName gt lt OP gt NOT lt GuidCName gt lt MTS gt AND OR lt MTS gt push lt Filename gt SECTION lt MTS gt lt FfsAlignment gt lt DxeExp gt DXE DEPEX EXP lt Eq gt lt MTS gt N lt EOL gt lt DxeDepex gt n lt EOL gt lt SorStmt gt lt EOL gt lt MTS gt lt GuidStmt gt lt EOL gt lt MTS gt lt BoolStmt gt lt EOL gt lt MTS gt lt D
38. 1 and IA32RESET defined IA32 RST BIN IA32_RST BIN EDK II FDF File Format amp amp NOT lendif COMP_NAME PAL A COMP _ LOC MyVtfVF F COMP TYPE 0xF COMP VER 7 01 COMP CS 1 lif PROCESSOR NAME M1 COMP BIN M1PalCode PAL A M1 BIN COMP SYM M1PalCode PAL A M1 SYM lelseif PROCESSOR NAME M2 COMP BIN M2PalCode PAL A M2 BIN COMP SYM M2PalCode PAL A M2 SYM lelse COMP BIN GenPal PAL A GEN bin COMP SYM GenPal PAL A GEN sym lendif COMP SIZE lelseif MyPlatformTspGuid IPF VERSION 2 VTF IPF MyBsf lifdef IA32RESET IA32 RST BIN IA32 RST BIN Version 1 24 lendif COMP_NAME COMP LOC COMP_TYPE COMP_VER COMP_CS COMP_BIN COMP_SYM COMP_SIZE COMP_NAME COMP_LOC COMP_TYPE COMP_VER COMP_CS COMP_BIN COMP_SYM PAL A MyVtfFv F OxF 7 01 1 GenPal PAL_A GEN bin GenPal PAL A GEN sym PAL B MyVt Fv S 0x01 1 GenPal PAL B GEN bin GenPal PAL B GEN sym December 2014 55 EDK Il FDF File Format EDK II FDF File Spec COMP SIZE lelse VTF X64 MyVt IA32 RST BIN IA32_RST BIN lendif lifndef MY MACRO DEFINE MY MACRO lendif 3 2 4 linclude Statements Use of this statement is optional Summary Defines the include statement in FDF files This statement is used to include at the statement s line a file which is processed at that point as though the text of the included file was actually in the FDF file Statements in the include file s
39. ALUE specified must match the PCD s datum type and must be the content data For a PCD that has a datum type of vorp the data can be a Unicode string as in L text a valid C data array it must be either a C format GUID or a hex byte array as in 0x20 0x01 0x50 0x00 0x32 OxFF 0x00 OxAA OxFF OxFO 0x00 0x00 0x00 or a hex value as in 0x0000000F with a value that is consistent with the PCD s datum type Version 1 24 December 2014 25 FDF Design Discussion EDK II FDF File Spec The value may also be a macro or it may be computed using arithmetic operations arithmetic expressions and or logical expressions The value portion of the SET statement when using any of these computations are in fix expressions that are evaluated left to right with items within parenthesis evaluated before the outer expressions are evaluated Use of parenthesis is encouraged to remove ambiguity 2 3 4 FD Region Layout 26 Following the FD defines section are lists of Regions which correspond to the locations of different images within the flash device Currently most flash devices have a variable number of blocks all of identical size When burning an image into one of these devices only whole blocks can be burned into the device at any one time This puts a constraint that all layout regions of the FD image must start on a block boundary To accommodate future flash parts that have variable block sizes the layout is described by the offset
40. Attributes is set per the FvAttributesSet Or FvAttributesClear items specified in FvAttributesSet are default TRUE while items in FvAttributesClear are default FALSE If FV files are created they will be created in the OUTPUT DIRECTORY TARGET TAGNAME FV directory using the values from the individual instance of the build tools Build tools get these values after parsing DSC INF target txt tools_def txt files and command line options Conditional statements may be used anywhere within this section Version 1 24 December 2014 65 EDK II FDF File Format EDK II FDF File Spec Prototype lt FV gt FV lt FvUiName gt lt FvStmts gt lt FvStmts gt lt ExtendedFvEntry gt lt FvStatements gt lt Globalstmts gt lt FvUiName gt sz a ZA Z a zA Z0 9 lt ExtendedFvEntry gt sss lt TS gt FV EXT ENTRY TYPE lt MTS gt TYPE lt Eq gt lt Hex4 gt lt EOL gt lt TS gt FILE lt Eq gt lt BinaryFile gt lt EOL gt lt TS gt DATA lt Eq gt lt DataContent gt n lt EOL gt lt DataContent gt lt TS gt lt RawData gt lt CFormatGUID gt lt UINT8z gt lt UINT16z gt lt UINT32z gt lt UINT64z gt lt EOL gt lt BinaryFile gt lt PATH gt lt File gt lt EOL gt lt FvStatements gt lt BlockStatements gt lt FvAlignment gt lt FvAttributes gt lt FileSystemGuid gt lt FvNameGuid gt lt PeiAprioriSe
41. CTION PROCESSING REQUIRED is cleared and normal leaf sections must be used 2 4 6 2 EFI Leaf Sections Leaf sections are identified using the EFI_SECTION Type as specified in the UEFI specification Arguments to the EFI_ SECTION Type include information that will be used to build a leaf section Nesting of leaf sections within leaf sections is not permitted as a leaf section is defined as UEFI s smallest entity The LEAF section is specified using the following format SECTION LEAF SECTION build Align X Unicode String Filename The following keywords are used for valid LEAF SECTION types e PE32 e PIC e TE e DXE DEPEX e SMM DEPEX e PEI DEPEX e VERSION Contains either a 16 bit build number or a Unicode string e UlI Unicode String e COMPAT16 e FV IMAGE e SUBTYPE GUID A GUID value with content defined by the GUID to be used with the section type of EFI SECTION FREEFORM SUBTYPE GUID The argument build is only valid for VERSION leaf section The number may be specified in the platform description DSC file s Defines section BUILD NUMBER element EDK INF files may specify a BUILD NUMBER in the defines section However this value is only used if the EDK II DSC file does not contain a BUILD NUMBER statement The Filename is only optional for VERSION and UI A Unicode string is only valid for VERSION or ur if the Filename is not present and is of the form L string The remaining leaf section types requir
42. E HH HH HERR HEHE HH HHHHHEHH HH HH HH HHHHHIHIHIHEEH Example of a DXE_DRIVER FFS file with a Checksum encapsulation section PRAHARA HARRAH HARRAH HHH AHHH HH HH HEHE HH HH HEHE HH HHHHHHEHH HH HH HH HHHHFHIHIFEEH December 2014 Version 1 24 EDK II FDF File Spec Nt32Pkg Flash Description File Rule Common DXE_ DRIVER FILE DRIVER NAMED GUID DXE_DEPEX DXE DEPEX Optional INF OUTPUT MODULE NAME depex COMPRESS PI STD GUIDED PE32 PE32 INF OUTPUT MODULE NAME efi UI STRING MODULE_NAME Optional VERSION STRING INF VERSION Optional BUILD NUM BUILD NUMBER FHARR HARRAH HARRAH HHHHEH HEHE HH HH HEHE HH HH HEHE HH HH HH HH HARE REE EEE Rule Common PEI_CORE FILE PEI CORE NAMED GUID PE32 PE32 Align 4K INF_OUTPUT MODULE NAME efi UI STRING S MODULE NAME Optional VERSION STRING S INF_VERSION Optional BUILD NUM BUILD NUMBER Rule Common PEIM FILE PEIM NAMED GUID PEI DEPEX PEI DEPEX Optional INF OUTPUT MODULE NAME depex PE32 PE32 Align 4K INF OUTPUT MODULE NAME efi YI STRING S MODULE NAME Optional VERSION STRING S INF VERSION Optional BUILD_NUM BUILD NUMBER Rule Common DXE CORE FILE DXE CORE NAMED GUID COMPRESS PI STD PE32 PE32 INF OUTPUT MODULE NAME efi UI STRING MODULE NAME Optional VERSION STRING INF VERSION Optional BUILD NU
43. EDK II Flash Description FDF File Specification December 2014 Revision 1 24 EDK II FDF File Spec Acknowledgements THIS SPECIFICATION IS PROVIDED AS IS WITH NO WARRANTIES WHATSOEVER INCLUDING ANY WARRANTY OF MERCHANTABILITY NONINFRINGEMENT FITNESS FOR ANY PARTICULAR PURPOSE OR ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL SPECIFICATION OR SAMPLE Intel products are not intended for use in medical life saving or life sustaining applications Intel may make changes to specifications and product descriptions at any time without notice Designers must not rely on the absence or characteristics of any features or instructions marked reserved or undefined Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them A license is hereby granted to copy and reproduce this specification for internal use only No other license express or implied by estoppel or otherwise to any other intellectual property rights is granted herein Intel disclaims all liability including liability for infringement of any proprietary rights relating to use of information in this specification No license express or implied by estoppel or otherwise to any intellectual property rights is granted herein This specification is an intermediate draft for comment only and is subject to change without notice Readers should not design products base
44. F0 9 4 BUILD NUMBER lt Eq gt lt StringData gt lt NormalFile gt lt EOL gt lt UnicodeString gt lt QuotedString gt December 2014 79 EDK II FDF File Format 80 lt NamedMacro gt lt FvImgArgs gt lt ExtendedFvEntry gt lt DataContent gt lt TypeValue gt lt Afile gt lt BinaryFile gt lt bin gt lt dat gt lt DataSection gt lt KnownSection gt lt SecData gt lt LeafSecType gt EDK II FDF File Spec lt NamedMacro gt if VerSection INF VERSION else if UiSection INF_VERSION MODULE NAME lt Eq gt lt FvUiName gt lt EOL gt lt MacroDefinition gt lt ExtendedFvEntry gt lt FvAlignment gt lt FvAttributes gt lt FileSystemGuid gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt lt TS gt FV_EXT ENTRY TYPE lt MTS gt lt TypeValue gt lt EOL gt lt TS gt FILE lt Eg gt lt BinaryFile gt DATA lt Eg gt lt DataContent gt lt EOL gt lt TS gt lt EOL gt lt RawData gt lt CFormatGUID gt lt UINT8z gt lt UINT16z gt lt UINT32z gt lt UINT64z gt TYPE lt Eq gt lt Hex4 gt lt MTS gt APPEND lt Eq gt lt BinaryFile gt lt EOL gt lt PATH gt lt Word gt lt bin gt lt dat gt lt EOL gt bin BIN Bin dat DAT Dat da
45. FDF File Format EDK II FDF File Spec Example Rule IA32 SEC FILE SEC NAMED GUID Fixed Align 32 efi Rule Common PEIM FILE PEIM NAMED GUID TE TE te PEI DEPEX PEI DEPEX Optional Depex VERSION STRING INF VERSION Optional BUILD NUM BUILD NUM UI UNI UI Optional uni Rule Common PEIM PE32 FILE PEIM NAMED GUID PEI DEPEX PEI DEPEX Optional dxs COMPRESS PE32 PE32 efi VERSION UNI_VER Optional BUILD_NUM BUILD_NUM ver UI UI Optional ui 3 9 VTF Section This describes the optional vTF section tag found in FDF files Summary If VTF files will be created they will be created in the OUTPUT DIRECTORY TARGET TAGNAME FV directory using the values from the individual instance of the build tools Build tools get these values after parsing DSC INF target txt tools_def txt files and command line options The following sequence describes each component Name Region r Type Version CheckSum Flag Path of Binary File Path of SYM File Preferred Size Where Name Name of the component Region Location in the firmware Valid locations are 94 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format PH Protected Block region merged towards the higher address PL Protected Block region merged towards the lower address H Flashable region merged towards the higher address L Flashable region merged t
46. File Spec EDK II FDF File Format Prototype lt Defines gt Defines lt EOL gt lt TS gt FDF_SPECIFICATION lt Eq gt lt SpecVer gt lt EOL gt lt TS gt FDF_VERSION lt Eq gt lt DecimalVersion gt lt EOL gt lt DefStmts gt lt DefStmts gt lt MacroDefinition gt lt SetStmts gt lt IncludeStatement gt lt UiNameType gt lt AsciiString gt lt SpecVer gt lt HexVersion gt 0 9 0 9 lt SetStmts gt lt TS gt SET lt MTS gt lt PcdName gt lt Eq gt lt VALUE gt lt EOL gt lt VALUE gt lt Number gt lt Boolean gt lt GUID gt lt CArray gt lt CString gt lt UnicodeString gt lt Expression gt Parameters Expression Refer to the EDK II Expression Syntax Specification for more information FDF VERSION The version number for this flash definition the value is not used by build tools but the version element is provided for user tracking capabilities that may be used by other user interface tools FDF SPECIFICATION For this specification the version value is 0x00010018 Tools that process this version ofthe FDF file can successfully process earlier versions of the FDF files this is a backward compatible update If an FDF file with an earlier version of the FDF_SPECIFICATION is modified it is recommended that the version value be updated to 0x00010018 There is no requirement to change existing entries if no other content changes This value
47. FlashNvStorageFtwWorkingBase gEfiMdeModulePkgTokenSpaceGuid PcdFlashNvStorageFtwWorkingSize NV FTW WORKING DATA EFI FAULT TOLERANT WORKING BLOCK HEADER gt Signature gEfiSystemNvDataFvGuid OxFFF12B8D 0x7696 Ox4C8B OxA9 0x85 0x27 0x47 0x07 Ox5B Ox4F 0x50 0x8D Ox2B OxFI OXFF 0x96 0x76 Ox8B Ox4C OxA9 0x85 0x27 0x47 0x07 Ox5B Ox4F 0x50 Crc UINT32 WorkingBlockValid 1 WorkingBlockInvalid 1 Reserved 0x77 0x13 Ox9B OxD7 OxFE OxFF OxFF OxFF WriteQueueSize UINT64 OxEO Ox1F 0x00 0x00 0x00 Ox00 0x00 Ox00 0x00290000 0x00010000 NV_FTW_SPARE gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid PcdFlashNvStorageFtwSpareSize HEHE EEE HH HH HEHE HH HH HH HEHE HH HH HH HH HH HH HH HEHE HH HH HH HHH HHH HH HEHE HH HH FV Section FV section is used to define what components or modules are placed within a flash device file This section also defines order the components and modules are positioned within the image The FV section consists of define statements set statements and module statements dE HE He HE HH HE HE HE AHAHAHAH BEREA EEE BEREA EREA EEH EEE HERE EREA EERE BEREA EERE FV FvRecovery 106 December 2014 Version 1 24 EDK II FDF File Spec Nt32Pkg Flash Description File FvBaseAddress 0x0 FV Base Address for the Backup copy of FV 16 FV alignment FvAlignment FV attributes setting ERASE P
48. I FDF File Spec Target TARGET TagName TOOL CHAIN TAG lt TS gt lt typel gt lt type2 gt lt type3 gt lt type4 gt FILE lt FvTypel gt lt Eq gt lt NamedGuid gt lt Options1 gt FILE lt FvType2 gt lt Eq gt lt NamedGuid gt lt Options2 gt FILE RAW lt Eq gt lt NamedGuidOrPcd gt lt Options2 gt FILE NON FFS FILE lt Eq gt lt NamedGuid gt lt Options2 gt FILE FV IMAGE lt Eq gt lt NamedGuidOrPcd gt lt Options2 gt SEC PEI CORE PEIM FREEFORM PEI DXE COMBO DRIVER DXE_CORE APPLICATION SMM CORE SMM lt RegistryFormatGUID gt NAMED GUID lt NamedGuid gt PCD lt PcdName gt lt Use gt lt FileOpts gt afa lt EOL gt lt TS gt lt Filename gt lt SectionData gt lt EOL gt lt TS gt lt EOL gt lt RelocFlags gt lt Use gt lt FileOpts gt lt EOL gt lt TS gt lt Filename gt lt SectionData gt lt EOL gt lt TS gt lt EOL gt FIXED lt MTS gt lt FfsAlignment gt CHECKSUM lt MTS gt Align lt Eq gt lt FfsAlignmentValues gt lt TS gt FvBaseAddress lt Eq gt lt UINT64 gt lt EOL gt lt TS gt FvForceRebase lt Eq gt lt TrueFalse gt lt EOL gt FvAlignment lt Eq gt lt FvAlignmentValues gt lt EOL gt December 2014 Version 1 24 EDK II FDF File Spec lt Filename gt lt FvImage
49. IoDxe inf INF MdeModulePkg Universal Disk PartitionDxe PartitionDxe inf INF MdeModulePkg Universal SetupBrowserDxe SetupBrowserDxe inf INF MdeModulePkg Universal PrintDxe PrintDxe inf DEFINE DUC Disk UnicodeCollation INF RuleOverride TIANOCOMPRESSED MdeModUni DUC EnglishDxe EnglishDxe inf INF MdeModulePkg Bus Pci PciBusDxe PciBusDxe inf INF MdeModulePkg Bus Scsi ScsiBusDxe ScsiBusDxe inf INF MdeModulePkg Bus Scsi ScsiDiskDxe ScsiDiskDxe inf INF IntelFrameworkModulePkg Bus Pci IdeBusDxe IdeBusDxe inf INF Nt32Pkg WinNtBusDriverDxe WinNtBusDriverDxe inf INF Nt32Pkg WinNtBlockIoDxe WinNtBlockIoDxe inf INF Nt32Pkg WinNtSerialloDxe WinNtSerialloDxe inf INF Nt32Pkg WinNtGopDxe WinNtGopDxe inf INF Nt32Pkg WinNtSimpleFileSystemDxe WinNtSimpleFileSystemDxe inf INF MdeModUni PlatformDriOverrideDxe PlatformDriOverrideDxe inf INF MdeModulePkg Universal DriverSampleDxe DriverSampleDxe inf INF MdeModulePkg Universal Network DpcDxe DpcDxe inf INF MdeModulePkg Universal Network ArpDxe ArpDxe inf INF MdeModulePkg Universal Network Dhep4Dxe Dhep4Dxe inf Version 1 24 December 2014 109 Nt32Pkg Flash Description File EDK II FDF File Spec 110 INF MdeModulePkg Universal Network Ip4ConfigDxe Ip4ConfigDxe inf INF MdeModulePkg Universal Network Ip4Dxe Ip4Dxe inf INF MdeModulePkg Universal Network MnpDxe MnpDxe inf INF MdeModulePkg Universal Network VlanConfigDxe VlanConfigDxe inf INF MdeModulePkg U
50. M BUILD NUMBER Rule Common UEFI DRIVER FILE DRIVER NAMED GUID DXE DEPEX DXE DEPEX Optional INF OUTPUT MODULE NAME depex COMPRESS PI STD Version 1 24 December 2014 111 Nt32Pkg Flash Description File EDK II FDF File Spec GUIDED PE32 PE32 INF_OUTPUT MODULE_NAME efi UI STRING MODULE NAME Optional VERSION STRING S INF_VERSION Optional BUILD NUM BUILD NUMBER IRule Common UEFI DRIVER TIANOCOMPRESSED FILE DRIVER NAMED GUID DXE DEPEX DXE DEPEX Optional INF_OUTPUT MODULE NAME depex GUIDED A31280AD 481E 41B6 95E8 127F4C984779 PROCESSING REQUIRED TRUE PE32 PE32 INF_OUTPUT MODULE_NAME efi UI STRING MODULE NAME Optional VERSION STRING S INF VERSION Optional BUILD NUM BUILD NUMBER Rule Common DXE DRIVER FILE DRIVER NAMED GUID DXE_DEPEX DXE DEPEX Optional INF OUTPUT MODULE NAME depex COMPRESS PI STD GUIDED PE32 PE32 INF_OUTPUT MODULE_NAME efi UI STRING MODULE NAME Optional VERSION STRING S INF VERSION Optional BUILD NUM BUILD NUMBER Rule Common DXE RUNTIME DRIVER FILE DRIVER NAMED GUID DXE_DEPEX DXE DEPEX Optional INF OUTPUT MODULE NAME depex COMPRESS PI STD GUIDED PE32 PE32 INF_OUTPUT MODULE_NAME efi UI STRING MODULE NAME Optional VERSION STRING S INF_VERSION Optional BUILD NUM BUILD NUMBER 112 December 2014 Version
51. Name lt Not gt lt GuidCName gt lt OP gt lt Not gt lt GuidCName gt NOT lt MTS gt lt MTS gt AND OR lt MTS gt push lt MTS gt lt Filename gt December 2014 71 EDK Il FDF File Format EDK II FDF File Spec 72 lt DxeDepexExp gt lt TS gt SECTION lt MTS gt lt FfsAlignment gt DXE DEPEX EXP lt Eq gt lt EOL gt lt DxeDepex gt lt EOL gt lt DxeDepex gt lt TS gt lt SorStmt gt lt EOL gt lt MTS gt lt TS gt lt GuidStmt gt lt EOL gt lt MTS gt lt TS gt lt BoolStmt gt lt EOL gt lt MTS gt lt TS gt lt DepInstruct gt lt EOL gt lt MTS gt lt TS gt END lt EOL gt lt MTS gt lt SorStmt gt SOR lt BoolStmt gt lt GuidStmt gt before after lt MTS gt lt Filename gt lt SmmDepexExp gt lt TS gt SECTION lt MTS gt lt FfsAlignment gt SMM DEPEX EXP lt Eg gt lt EOL gt lt DxeDepex gt lt EOL gt Restrictions Filename For BINARY ONLY content UEFI_ DRIVER and UEFI_APPLICATION efi files the file names specified in the elements FILE and SECTION of this section must be relative to the directory identified by the WORKSPACE system environment variable TargetArch Only specific architectures are permitted use of common is prohibited FvBaseAddress The FvBaseAddress if present must be listed before the FvAlignment element If present the FvForceRebase m
52. OLARITY 1 MEMORY MAPPED TRUE STICKY WRITE TRUE LOCK CAP TRUE LOCK STATUS TRUE WRITE DISABLED CAP TRUE WRITE ENABLED CAP TRUE WRITE STATUS TRUE WRITE LOCK CAP TRUE WRITE LOCK STATUS TRUE READ DISABLED CAP TRUE READ ENABLED CAP TRUE READ STATUS TRUE READ LOCK CAP TRUE READ LOCK STATUS TRUE FvNameGuid 6D99E806 3D38 42c2 A095 5F4300BFD7DC HH HHHHHHHRHHHEHHHHHHHH HERE HHHHHHEH HE HH HH HEHE HH HH HEHE HH HH HEHE IRI HH HH HHHHIHIHIFHEH The INF statements point to EDK component and EDK II module INF files which will be placed into this FV image Parsing tools will scan the INF file to determine the type of component or module The component or module type is used to reference the standard rules defined elsewhere in the FDF file The format for INF statements is INF PathAndInfFileName HEERE EERE EERE ER EREA PEI Phase modules PEI Apriori file example more PEIM module added later DEFINE MdeModUni MdeModulePkg Universal DEFINE WNOEMHOOK Nt32Pkg WinNtOemHookStatusCodeHandlerPei DEFINE RSCR_P ReportStatusCodeRouter Pei APRIORI PEI Version 1 24 December 2014 107 Nt32Pkg Flash Description File EDK II FDF File Spec 108 INF INF INF INF APRIO INF INF INF INF INF INF INF INF INF INF INF INF INF INF INF HH HH INF INF INF INF INF INF INF INF INF INF INF INF INF INF INF INF INF INF S MdeModUni S MdeMo
53. SEC PEI CORE PEIM FREEFORM PEI DXE COMBO DRIVER DXE_CORE APPLICATION SMM CORE smm lt NamedGuid gt PCD lt PcdName gt lt RegistryFormatGUID gt NAMED GUID lt GuidCName gt lt Use gt lt FileOpts gt lt RelocFlags gt lt MTS gt lt EOL gt lt Filename gt lt SectionData gt lt TS gt lt TS gt lt EOL gt lt Use gt lt FileOpts gt lt MTS gt lt EOL gt lt Filename gt lt SectionData gt lt TS gt lt EOL gt FIXED lt MTS gt CHECKSUM lt MTS gt lt F fsAlignment gt Align lt Eq gt lt FfsAlignmentValues gt lt MTS gt December 2014 Version 1 24 EDK II FDF File Spec lt Filename gt lt FvImage gt lt FdImage gt lt FdUiName gt lt NormalFile gt lt SectionData gt lt LeafSections gt lt VerSection gt lt UiSec gt lt FvImgSection gt lt VerArgs gt lt Build gt lt BuildVal gt lt VerUniArg gt lt StringData gt lt FvImgArgs gt Version 1 24 EDK II FDF File Format lt FvImage gt lt FdImage gt lt NormalFile gt lt TS gt FV lt Eq gt lt FvUiName gt lt EOL gt lt TS gt FD lt Eq gt lt FdUiName gt lt EOL gt lt Word gt common lt PATH gt lt Word gt lt Word gt lt EOL gt lt MacroDefinition gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt EncapSec gt lt LeafSections gt
54. SULE Not specifying the RegionType implies that the region starting at the Offset of length Size must not be touched This type of region is typically used for event logs that are persistent between system resets and modified via some other mechanism and Each FD region has a UiName modifier then the output image files uses the UiName modifier for the file name December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Note Although sub regions existed in EDK FDF files EDK II FDF does not use the concept of sub regions 2 3 4 1 FV RegionType The FV RegionType is a pointer to either one of the unique FV names that are defined in the Fv section Both of these are files that contains a binary FV as defined by the PI 1 0 specification The format for the Fv RegionType is the following FV UiFvName The following is an example of FV region type 0x000000 0x0C0000 gEfiMyTokenSpaceGuid PcdFlashFvMainBaseAddress gEfiMyTokenSpaceGuid PcdFlashFvMainSize FV FvMain 2 3 4 2 DATA RegionType The DATA RegionType is a region that contains is a hex byte value or an array of hex byte values This data that will be loaded into the flash device starting at the first location pointed to by the Offset value The format of the DATA RegionType is DATA lt Hex Byte Data Structure gt The following is an example of a DATA region type 0x0CA000 0x002000 gEfiMyTokenSpaceGuid PcdFlashNvStorageBase gEfiMyTokenSpac
55. Structure gt EDK II FDF File Spec Capsule lt UiCapsuleName gt lt EOL gt lt UefiTokens gt lt CapsuleStmts gt lt Word gt lt TS gt SET lt MTS gt lt PcdName gt lt Eq gt lt VALUE gt lt EOL gt lt Number gt lt Boolean gt lt GUID gt lt CArray gt lt CString gt lt UnicodeString gt lt Expression gt lt TS gt CAPSULE GUID lt Eq gt lt GuidValue gt lt EOL gt lt TS gt CAPSULE HEADER SIZE lt Eq gt lt Bytes gt lt EOL gt lt TS gt CAPSULE FLAGS lt Eq gt lt Flags gt lt EOL gt lt MacroDefinition gt lt SetStatements gt lt CapsuleData gt lt GuidCName gt lt GuidStructure gt lt CName gt lt RegistryFormatGUID gt lt CFormatGUID gt December 2014 Version 1 24 EDK II FDF File Spec lt Flags gt lt FlagName gt lt CapsuleData gt lt InfStatements gt lt InfOptions gt lt Use gt lt TargetArch gt lt Rule gt lt SetVer gt lt SetUi gt lt InfFile gt lt RelocFlags gt lt KeyString gt Version 1 24 EDK II FDF File Format lt FlagName gt PersistAcrossReset PersistAcrossReset PersistAcrossReset InitiateReset PopulateSystemTable PersistAcrossReset PopulateSystemTable InitiateReset PersistAcrossReset InitiateReset PopulateSystemTable PopulateSystemTable PopulateSystemTable PopulateSystemTable Init
56. TS gt lt GuidValue gt lt MTS gt lt File gt lt EOL gt lt VarFile gt lt Ext gt lt MTS gt lt VarFile gt lt Ext gt PCD lt PcdName gt lt FS gt a zA Z a zA z0 9 0 COMPAT16 lt FfsAlignment gt PE32 lt MTS gt lt FfsAlignment gt lt ChkReloc gt if MODULE TYPE SEC MODULE TYPE PEI CORE MODULE TYPE PEIM lt RelocFlags gt December 2014 Version 1 24 EDK II FDF File Spec lt PicFileType gt lt TeFileType gt lt RawFileType gt lt BinTypes gt lt AcpiFileTypes gt lt DdFileType gt lt DpxAlign gt lt UiFileType gt lt UiFile gt lt UiString gt lt StringVal gt lt NamedMacros gt lt UiOpts gt lt VerFileType gt lt VerFile gt lt VerOpts gt lt VerString gt lt VerStringVal gt lt BuildAlign gt lt BuildArg gt lt PdFileType gt lt FvSec gt Version 1 24 EDK II FDF File Format PIC lt MTS gt lt FfsAlignment gt TE lt MTS gt lt FfsAlignment gt lt ChkReloc gt lt BinTypes gt lt AcpiFileTypes gt lt MTS gt lt FfsAlignment gt BIN RAW ACPI ASL lt MTS gt Optional lt MTS gt DXE_DEPEX SMM DEPEX lt DpxAlign gt Optional lt MTS gt lt FfsAlignment gt lt UiFile gt lt UiString gt UI lt MTS gt lt UiOpts gt STRING lt Eq gt lt StringVal gt lt FfsAlignment gt lt UnicodeString gt lt QuotedStr
57. This file must NOT be used as is as data structures and definitions do not exist 104 file This is NT32 FDF file with UEFI HII features enabled Copyright c 2007 2010 Intel Corporation All rights reserved lt BR gt 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 i H H H THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND EITHER EXPRESS OR IMPLIED PAR HARRAH HARRAH HARRAH HHHHREH HEHE HH HEHHH HH HH HEHE HEHE HHHHHHEHH HH HH HH HEHE HH HHHHIHIHIFEEH FD Section The FD Section is made up of the definition statements and a description of what goes into the Flash Device Image Each FD section defines one flash device image A flash device image may be one of the following Removable media bootable image like a boot floppy image an Option ROM image that would be flashed into an add in card a System Flash image that would be burned into a system s flash or an Update Capsule image that will be used to update and existing system flash HH HE HE HE HE HE HE HE HE HE HH HEHE HH HH EREA EERE HHH HHH HH HH HH HH HEHE HH HH FD Nt32 The base address of the FLASH Device BaseAddress 0x0 gEfiNt32PkgTok
58. Variables System environment variable may not be re defined in this file System environment variables cannot be overridden by the build system tools Parameters Expression C style expression using C relational equality and logical numeric and bitwise operators and or arithmetic and bitwise operators that evaluate to a value for PCDs the value must match the Datum Type of the PCD Precedence and associativity follow C standards Along with absolute values macro names and PCDs may be used within an expression For both macro names and PCDs the element must be previously defined before it can be used VALUE The lt EQ gt lt VALUE gt is optional and if not included uses a default of TRUE Note Some MACRO and PCD values may be defined in the Platform DSC file Examples DEFINE SECCORE MyPlatform SecCore DEFINE GEN SKU MyPlatform GenPei DEFINE SKU1 MyPlatform Skul Pei DEFINE FLASH SIZE 0x00280000 DEFINE MY MACRO EDK_GLOBAL The macro names defined using the EDK GLOBAL statement in the DSC file may be used in paths value fields and conditional statements in this file The EDK_GLOBAL statement itself cannot be specified in this file Version 1 24 December 2014 51 EDK Il FDF File Format EDK II FDF File Spec 3 2 3 Conditional Directive Blocks 52 Use of conditional directive blocks is optional Summary Conditional statements may appear anywhere within the file Conditional directive blocks can be neste
59. Y MAPPED lt Eq gt lt TrueFalse gt lt EOL gt LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt LOCK STATUS lt Eq gt lt TrueFalse gt lt EOL gt WRITE LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE LOCK STATUS lt Eq gt lt TrueFalse gt lt EOL gt WRITE ENABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE DISABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE STATUS lt Eq gt lt TrueFalse gt lt EOL gt STICKY WRITE lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt WRITE POLICY RELIABLE lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt READ LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt READ LOCK STATUS lt Eq gt lt TrueFalse gt lt EOL gt READ ENABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt READ DISABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt READ STATUS lt Eq gt lt TrueFalse gt lt EOL gt FileSystemGuid lt Eq gt lt NamedGuid gt if COMPONENT TYPE LIBRARY LIBRARY CLASS is declared in defines section of the INF MODULE TYPE USER DEFINED lt Depex gt else if MODULE TYPE PEIM MODULE TYPE DXE DRIVER MODULE TYPE DXE RUNTIME DRIVER MODULE TYPE DXE SAL DRIVER MODULE TYPE DXE SMM DRIVER lt Depex gt elif MODULE TYPE MODULE_TYPE MODULE_TYPE UEFI APPLICATION UEFI DRIVER PEI CORE December 2014 Version
60. al and the first statement represents block O the first block and subsequent BlockSize statements represent blocks 1 N NumBlocks Zero or one The number of continuous blocks of size BlockSize If NumBlocks is not present the number of blocks defaults to 1 An optional PcdName may follow the Token statement and is separated from the statement using a pipe character The PcdName is assigned VALUE Only one PcdName can be assigned a Token s Value 24 December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion 2 3 2 FD DEFINE statements DEFINE statements are used to define Macro definitions that are scoped to the individual FD sections DEFINE statements are processed in order so a later DEFINE statement for a given MACRO over writes the previous definition The DEFINE statements are typically used for creating short cut names for directory path names but may be used for identifying other items or values that will be used in later statements DEFINE MACRO PATH The following are examples of the DEFINE statement DEFINE FV DIR OUT DIR TARGET TOOL CHAIN TAG ARCH DEFINE MDE MOD TSPG gEfiMdeModulePkgTokenSpaceGuid DEFINE NV_STOR_VAR_SIZE PcdFlashNvStorageVariableSize DEFINE FV_HDR SIZE 0x48 DEFINE VAR_STORE SIZE MDE MOD TSPG NV_STOR_VAR_SIZE FV_HDR_SIZE The MACRO can be used to create a shorthand notation that can be used elsewhere within the FDF file Macro values may
61. al statement that C programmers are familiar with Supported statements are lifdef ifndef if elseif else and endif Refer to the Macro Statement section for information on using Macros in conditional directives When using the ifdef or ifndef the macro name must be used the macro name must not be encapsulated between and For backward compatibility macro names encapsulated between and are allowed in FDF files that have FDF_SPECIFICATION versions less that 0x00010016 When using a marco in the if Or elseif conditionals the macro name must be encapsulated between and A macro that is not defined has a default value of 0 FALSE when used in a conditional comparison statement It is recommended you not use PCDs in the ifdef or ifndef statements Using a PCD in an ifdef or ifndef statement will cause the build to break with an error message When using a PCD in the if or elseif conditionals the PCD name TokenSpaceGuidCName PcdCname must be used the PCD name must not be encapsulated between s and Do not encapsulate the PCD name in the and required for macro values or in the pcp and used in Fv or Capsule sections as shown in the example below lif gTokenSpaceGuid PcdCname AND MY_MACRO TRUE DEFINE FOO TRUE lendif If the PCD is a string only the string needs to be encapsulated by double quotation marks while a Unicode string can
62. also used to define rules for module types that permit the user to define the content of the FFS file when an FFS type is not specified by either PI or UEFI specifications The Rules can have multiple modifiers as shown below Rule ARCH MODULE TYPE TEMPLATE NAME If nO TEMPLATE NAME is given then the match is based on ARCH and MODULE TYPE modifiers BINARY is a reserved TEMPLATE_NAME as a default rule name for binary modules The TEMPLATE NAME must be unique to the ARCH and MODULE TYPE It is permissible to use the Same TEMPLATE NAME for two or more Rule sections if the ARCH Or the MODULE TYPE listed are different for each of the sections A Rule section is terminated by another section header or the end of file The content of the Rule section is based on the FILE and section grammar of the FV section The difference is the FILE referenced in the RULE is a MACRO The section grammar is extended to include an optional argument Optional The Optional argument is used to say a section is optional That is to say if it does not exist then it is O K Note The include statement is valid for any part of the Rule section including an entire Rule 38 section The generic form of the entries for leaf sections is lt SectionType gt lt FileType gt Options lt Filename gt lt Extension gt When processing the FDF file the following rules apply in order 1 If lt SectionType gt not defined or not a legal name th
63. are additions to the FDF file and do not replace information in the FDF file The included file s content must match the content of the section that the include statement resides or it may contain completely new sections of the same section type If the included file contains new sections then the section being processed in the Platform FDF file is considered to have been terminated If the filename is a filename the tools will look for the file in the same directory as the FDF file If the file is not found and the directory containing this FDF file is not the same directory as the directory containing the DSC the tools must attempt to locate the file in the directory tree that contains the DSC file If the filename starts with a then the system environment variable will be used to locate the file If none of these methods find the file and a directory separator is in the filename the tools will attempt to find the file in a WORKSPACE relative path If the file cannot be found the build system must exit with an appropriate error message The include file cannot contain additional include statements Prototype lt IncludeStatement gt lt TS gt include lt MTS gt lt Filename gt lt EOL gt Example EDK II FDF include myPlatform NvRamDefs txt include myFeatures mak 3 3 Header Section This is an optional section Summary This section contains Copyright and License notices for the INF file in comments th
64. at start the file 56 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format This section is optional using a format of file Nt32 fdf Abstract Description Copyright License HH Prototype lt Header gt s z lt Comment gt lt Space gt lt Space gt file lt EOL gt lt Abstract gt lt Description gt lt Copyright gt lt EOL gt lt License gt lt EOL gt lt Filename gt lt Word gt lt Extension gt lt Abstract gt lt MTS gt lt AsciiString gt lt EOL gt lt EOL gt lt Description gt lt MTS gt lt AsciiString gt lt EOL gt lt EOL gt lt Copyright gt lt MTS gt lt CopyName gt lt Date gt lt CompInfo gt lt EOL gt lt CopyName gt Portions lt MTS gt Copyright c lt MTS gt lt Date gt lt Year gt lt TS gt lt DateList gt lt DateRange gt lt Year gt 2 0 9 0 9 0 9 lt DateList gt lt CommaSpace gt lt Year gt lt CommaSpace gt lt Year gt lt DateRange gt j lt TS gt lt Year gt lt CompInfo gt 0x20 0x7e lt MTS gt All rights reserved lt TS gt lt BR gt lt License gt lt MTS gt lt AsciiString gt lt EOL gt lt EOL gt Version 1 24 December 2014 57 EDK Il FDF File Format EDK II FDF File Spec Example file HH Em
65. ated PCDs If a DSC file contains a duplicate PCD setting the FDF file s PCD setting takes precedence and it is recommended that the build tools throw a warning message on the PCD defined in the DSC file Default values from DEC files are not permitted in the EDK II build system Version 1 24 December 2014 11 FDF Design Discussion EDK II FDF File Spec for PCDs specified in the FDF file PCD values set in this file override PCD settings in other EDK II meta data files Note that PCDs settings are positional within the FDF file Additionally the PCDs used in the FDF file must be specified as PcdTokenSpaceGuidCName PcdCName PCD RULES There are no PCD sections defined for the FDF file PCD values are assigned in the FDF file using two methods They may automatically be assigned based on a specific position as defined in the FDF specification or by using a SET statement e Within the FD sections PCDs that appear immediately following the line containing address size Or offset size values will have their values automatically assigned to the address size Or offset size using the same ordering Additionally some tokens such as BaseAddress which use a format of token value can have a PCD s value set at the same time The PCD must be on the same line and be separated from the value by field separator character If there are two values on the line separated by a field separator character the PCD names that will be assigned the val
66. ay contain zero or more PCI ROM image files binary only and zero or more UEFI driver images specified by either binary or INF files that are to be packaged into a single Option ROM image Additionally support for a single EFI driver with both native IA32 X64 IPF etc and EBC images in the same PCI Option ROM container is Version 1 24 December 2014 97 EDK Il FDF File Format 98 provided Conditional statements may be used anywhere within this section Prototype lt OptionRom gt lt DriverName gt lt Components gt lt InfComponent gt lt UseArch gt lt TargetArch gt lt InfFile gt lt Overrides gt lt Binary gt lt EfiBinary gt lt EfiFileName gt lt OtherBinary gt Restrictions TargetArch Only specific architectures are permitted use of common EDK II FDF File Spec OptionRom lt DriverName gt lt EOL gt lt Components gt a zA Z a zA 20 9 lt InfComponent gt lt Binary gt lt TS gt INF lt MTS gt lt UseArch gt lt InfFile gt lt Overrides gt lt EOL gt USE lt Eq gt lt TargetArch gt lt MTS gt lt arch gt gt inf lt PATH gt lt Word gt lt MTS gt lt EOL gt lt TS gt PCI_VENDOR ID lt Eq gt lt UINT16 gt lt EOL gt lt TS gt PCI CLASS CODE lt Eq gt lt UINT8 gt lt EOL gt lt TS gt PCI DEVICE ID lt Eq gt lt UINT16 gt lt EOL gt lt TS gt PCI REVISION lt Eq gt lt UINT8 gt
67. be scoped to subsections of the FDF file Macros are also positional with later values replacing values for macros at the same level When tools process this file the MACRO name will be expanded in commands or files emitted from the tools In the following example OUTPUT DIRECTORY is a variable whose value is found in the platform s DSC file and this file assigns OUT DIR as the variable name to use with the same value as OUTPUT DIRECTORY DEFINE OUT DIR OUTPUT DIRECTORY DEFINE FV DIR OUT DIR TARGET TOOL CHAIN TAG ARCH FV If the DSC file declares OUTPUT DIRECTORY WORKSPACE Build Nt32 TARGET DEBUG target txt uses MYTOOLS for the tool chain and the platform is IA32 then a statement later in the section that references FV_DIR is interpreted by the tools as being WORKSPACE Build Nt32 DEBUG MYTOOLS IA32 FV 2 3 3 FD SET statements SET statements are used to define the values of PCD statements The current PCD maps for regions include extra PCD entries that define properties of the region so the SET statement can occur anywhere within an FD section SET statements are positional within the FDF file SET PcdName VALUE Additionally a PCD Name is made up of two parts separated by a period character The format for a PcdName is PcdTokenSpaceGuidCName PcdCName The following is an example of the sET statement SET gFlashDevicePkgTokenSpaceGuid PcdEfiMemoryMapped TRUE The V
68. ber 2014 45 EDK II FDF File Format 46 lt UnicodeString gt lt HexDigit gt lt HexByte gt lt HexNumber gt lt HexVersion gt lt Major gt lt Minor gt lt DecimalVersion gt lt VersionVal gt lt GUID gt lt RegistryFormatGUID gt lt RHex4 gt lt RHex8 gt lt RHex12 gt lt RawH2 gt lt RawH4 gt lt OptRawH4 gt lt Hex2 gt lt Hex4 gt lt Hex8 gt lt Hex12 gt lt Hexl6 gt lt CFormatGUID gt December 2014 EDK II FDF File Spec L lt QuotedString gt a fA FO 9 ox 0X lt HexDigit gt lt HexDigit gt ox ox lt HexDigit gt Ox 0 lt Major gt lt Minor gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt ror 1 9 0 9 0 9 1 lt HexVersion gt 0 9 0 99 lt RegistryFormatGUID gt lt CFormatGUID gt lt RHex8 gt lt RHex4 gt lt RHex4 gt lt RHex12 gt lt RHex4 gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt RHex4 gt lt RHex4 gt lt RHex4 gt lt RHex4 gt lt RHex4 gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt 0x 0x 0x 0x 0x 0x 0x 0x 0x 0X lt OptRawH4 gt lt OptRawH4 gt lt OptRawH4 gt lt RawH4 gt
69. binations the parsing tools must terminate with an error Files specified by include statements may not contain include statements Macros defined in this FDF file or in the DSC file are not permitted in the path or file name of the include statement as these files are included prior to processing the file Version 1 24 December 2014 15 FDF Design Discussion EDK II FDF File Spec for macros If the path starts with a character then one of the system environment variables WORKSPACE EDK SOURCE EFI SOURCE Or ECP SOURCE is being used only these system environment variables are permitted to start the path of the included file Statements in include files must not break the integrity of the FDF file the included file is read in by tools in the exact position of the file and is functionally equivalent of copying the contents of the included file and inserting paste the content into the DSC file 2 2 6 Macro Statements Variables or macros used within the FDF file are typically used for path generation for locating files used in conditional statements or values for PCDs Token names reserved words defined in the EDK II meta data file specifications cannot be used as macro names As an example using PLATFORM NAME as a macro name is not permitted as it is a token defined in the DSC file s Defines section MACROS cannot be used to define keywords statements nor any other tokens defined in this sp
70. cation that can be accessed during boot at an EFI Shell Prompt prior to hand off to the OS Loader Foundation The set of code and interfaces that glue implementations of EFI together Framework Intel Platform Innovation Framework for EFI consists of the Foundation plus other modular components that characterize the portability surface for modular components designed to work on any implementation of the Tiano architecture GUID Globally Unique Identifier A 128 bit value used to name entities uniquely A unique GUID can be generated by an individual without the help of a centralized authority This allows the generation of names that will never conflict even among multiple unrelated parties GUID values can be registry format 8 4 4 4 12 or C data structure format GUID also refers to an API named by a GUID HII Human Interface Infrastructure This generally refers to the database that contains string font and IFR information along with other pieces that use one of the database components HOB Hand off blocks are key architectural mechanisms that are used to hand off system information in the early pre boot stages IFR Internal Forms Representation This is the binary encoding that is used for the representation of user interface pages INF EDK II meta data file describing module information Library Class A library class defines the API or interface set for a library The consumer of the library is coded to the library class
71. comparison operator Parameters Statements Any valid section section statement or set of statements defined in this specification may be within the scope of the conditional statements The encapsulated statements must not break the integrity of the file All statements within the encapsulation must end with lt EOL gt Version 1 24 December 2014 53 EDK Il FDF File Format EDK II FDF File Spec MACRO Usage in Expression Statements If a MACRO is used in expression statements the MACRO must be encapsulated between and character sets matching C format String comparisons are case sensitive and must exactly equal character for character leading and trailing white space characters included PcdFeatureFlag The Feature PCD is a boolean PCD that is set to either True 1 or False 0 The PCD datum type for a Feature PCD is always BOOLEAN It may be used in a logical expression FixedPcdName A Fixed PCD will have a set value at build time and that can not be modified in the binary image nor modified at runtime For directives the PCD datum type is limited to UINT8 UINT16 UINT32 UINT64 UINTN and BOOLEAN Using a Fixed At Build PCD that has a datum type of VOID is limited to text based comparisons in directives Using a PCD that has a value of a byte array is not permitted Fixed PCDs may be used in a logical expression Numeric Expression This is a test of numbers using relational or equality operators that eva
72. ction gt lt DxeAprioriSection gt lt InfStatements gt lt FileStatements gt lt GlobalStmts gt lt MacroDefinition gt lt IncludeStatement gt lt BlockStatements gt lt FixedBlocks gt lt FixedBlocks gt lt TS gt BlockSize lt Eq gt lt UINT32 gt lt EOL gt lt TS gt NumBlocks lt Eq gt lt UINT32 gt lt EOL gt lt SetStatements gt lt TS gt SET lt MTS gt lt PcdName gt lt Eg gt lt VALUE gt lt EOL gt lt VALUE gt lt Number gt lt Boolean gt lt GUID gt lt CArray gt lt CString gt lt UnicodeString gt lt Expression gt lt FvAlignment gt lt TS gt FvBaseAddress lt Eq gt lt UINT64 gt lt EOL gt lt TS gt FvForceRebase lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt FvAlignment lt Eq gt lt FvAlignmentValues gt lt EOL gt lt FvAttributes gt lt TS gt MEMORY MAPPED lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt 66 December 2014 Version 1 24 EDK II FDF File Spec lt FileSystemGuid gt lt FvNameGuid gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt InfStatements gt lt InfOptions gt lt Use gt lt TargetArch gt lt Rule gt lt SetVer gt lt SetUi gt lt InfFile gt Version 1 24 lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt EDK II FDF File Format LOCK STATUS lt Eq
73. d Conditional directive processing must emulate a C pre processor e All conditional directives can use MACRO Fixed at Build or Feature Flag PCD values which must evaluate to either True or False e Directives must be the only statement on a line e String evaluations are permitted and are case sensitive the two string values must be an exact match to evaluate to True e The expression immediately following the if statement controls whether the content after the line is processed or not TRUE is any non zero and or non NULL value other than zero e Each if within the source code must be matched with a closing lendif e Zero or more elseif statements are permitted only one else statement is permitted e Conditional directive blocks may be nested e Directives can be used to encapsulate entire sections or elements within a single section such that they do not break the integrity of the section definitions e Directives are in fix expressions that are evaluated left to right content within parenthesis is evaluated before the outer statements are evaluated Use of parenthesis is recommended to remove ambiguity e The values of the Fixed at Build and Feature Flag PCDs used in the conditional statements must be set in the PcdsFixedAtBuild or PcdsFeatureFlag section s of the DSC file or included in SET statements e Default values from the DEC file are not permitted Values used in directiv
74. d on this document Other names and brands may be claimed as the property of others Copyright 2007 2014 Intel Corporation All rights reserved il December 2014 Version 1 24 EDK II FDF File Spec Revision History Revision Revision History Date 1 0 Initial release December 2007 1 1 Updated based on errata August 2008 1 2 Updated based on enhancement requests June 2009 1 21 Updated based on enhancement requests and errata Added support for SMM_CORE Added support for CAPSULE_FLAGS_INITIATE_RESET Added Block Statements to all Capsule sections Added Auto keyword to FFS alignment Rule processing for file type lists is alphabetical i e files are added in alphabetical order HSD 203863 Macro Definitions in DSC file are now global to both DSC and FDF files PCD Values may be constructed using C style expressions provided the result ofthe expression matches the datum type of the PCD FeatureFlagExpression is now defined as a C style expression using C relational equality and logical numeric and bitwise operators and or arithmetic and bitwise operators that evaluate to a value that matches the Datum Type of the PCD Precedence and associativity follow C standards March 2010 1 22 Grammatical and formatting editing May 2010 Version 1 24 December 2014 EDK II FDF File Spec 1 22 w Errata A Updated to match the implementation
75. dUni MdeModUni S WNOEMHOOK PCD Pei Pcd inf RSCR_P ReportStatusCodeRouterPei inf StatusCodeHandler Pei StatusCodeHandlerPei inf WinNtOemHookStatusCodeHandlerPei inf Mee ee Ne Ne RI DXE MdeModulePkg Universal PCD Dxe Pcd inf Nt32Pkg MetronomeDxe MetronomeDxe inf MdeModulePkg Core Pei PeiMain inf MdeModulePkg Universal PCD Pei Pcd inf MdeMod ni RSCR P ReportStatusCodeRouterPei inf MdeModUni StatusCodeHandler Pei StatusCodeHandlerPei inf WINOEMHOOK WinNtOemHookStatusCodeHandlerPei inf Nt32Pkg BootModePei BootModePei inf Nt32Pkg StallPei StallPei inf Nt32Pkg WinNtFlashMapPei WinNtFlashMapPei inf Nt32Pkg WinNtAutoScanPei WinNtAutoScanPei inf Nt32Pkg WinNtFirmwareVolumePei WinNtFirmwareVolumePei inf MdeModulePkg Universal Variable Pei VariablePei inf Nt32Pkg WinNtThunkPPIToProtocolPei WinNtThunkPPIToProtocolPei inf MdeModulePkg Core DxeIplPeim Dxelpl inf DXE Phase modules MdeModulePkg Core Dxe DxeMain inf MdeModulePkg Universal PCD Dxe Ped inf Nt32Pkg MetronomeDxe MetronomeDxe inf Nt32Pkg RealTimeClockRuntimeDxe RealTimeClockRuntimeDxe inf Nt32Pkg ResetRuntimeDxe ResetRuntimeDxe inf MdeModulePkg Core RuntimeDxe RuntimeDxe inf Nt32Pkg FvbServicesRuntimeDxe FvbServicesRuntimeDxe inf MdeModulePkg Universal SecurityStubDxe SecurityStubDxe inf MdeModulePkg Universal SmbiosDxe SmbiosDxe inf MdeModulePkg Universal EbcDxe EbcDxe inf MdeModUni MemoryTest NullMemoryTestDxe NullMemoryTestDxe inf MdeM
76. definition Library classes are defined via a library class h file that is published by a package Library Instance An implementation of one or more library classes Module A module is either an executable image or a library instance For a list of module types supported by this package see module type Module Type All libraries and components belong to one of the following module types BASE SEC PEI_CORE PEIM SMM_CORE DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER 4 December 2014 Version 1 24 EDK II FDF File Spec Introduction DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER or UEFI_APPLICATION These definitions provide a framework that is consistent with a similar set of requirements A module that is of module type BASE depends only on headers and libraries provided in the MDE while a module that is of module type DXE_DRIVER depends on common DXE components For a definition of the various module types see module type The EDK II build system also permits modules of type USER_DEFINED These modules will not be processed by the EDK II Build system Package A package is a container It can hold a collection of files for any given set of modules Packages may be described as one of the following types of modules source modules containing all source files and descriptions of a module binary modules containing EFI Sections or a Framework File System and a description file specific to linking and binary editing of features and
77. e statement in the FDF files must be define in either the DSC file or the FDF file Conditional directives may appear before a Macro Fixed At Build or Feature Flag PCD has been defined Therefore the reference build tools may be required to perform two passes on this file to resolve all directive statements 1 Obtain the values of the Macros Fixed At Build or Feature Flag PCDs used for the conditional directives 2 Evaluate the conditional statements for inclusion in the build If the value of a Fixed at Build or Feature Flag PCD cannot be determined the build will break If the value of a Fixed at Build or Feature Flag PCD used in a conditional directive cannot be determined during the first pass the build should break Macros Fixed at Build and Feature Flag PCDs used in conditional statements in the first pass must not be located within conditional directives It is permissible to have a Macro that is undefined after the first pass It is permissible to have macros that are undefined used in ifdef and ifndef statements Fixed At Build or Feature Flag PCDs in the first pass must not be located within a conditional directive Macro and PCD values may be inherited from the DSC file December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format Note PCDs used in conditional directives must be defined and the value set in either the FDF or DSC file in order to be used in a conditional statement values from INF or DEC fi
78. e specified rule name The following are examples of INF statements DEFINE IFMP IntelFrameworkModulePkg INF USE IA32 EDK SOURCE Sample Universal Network Ip4 Dxe Ip4 inf INF EDK SOURCE Sample Universal Network Ip4Config Dxe Ip4Config inf INF RULE OVERRIDE MyCompress IFMP Bus Pci IdeBusDxe IdeBusDxe inf 2 4 6 FILE Statements FILE statements are provided so that a platform integrator can include complete EFI FFS files as well as a method for constructing FFS files using curly brace scoping FFS file specification syntax is one of the following FILE Type NAMED GUID Options FileName OR FILE Type NAMED GUID Options SECTION SECTION TYPE FileName SECTION SECTION TYPE FileName The first statement is commonly used with EFI_FV_FILETYPE_RAW files while the second type is used for most other file types The FileName is typically a binary file and the consumer of this type of file must have an a priori knowledge of the format The following describes the information that can be specified a File 32 December 2014 Version 1 24 EDK II FDF File Spec Type FDF Design Discussion EFI FV File Types one and only one of the following RAW Binary data FREEFORM Sectioned binary data SEC Sectioned data consisting of an optional pad section a terse section and an optional raw section PEI CORE Sectioned data consisting of one PE32 one user interface and one version section DXE_CORE Secti
79. e the Filename argument The file must contain the data for the section 2 5 Capsule Sections The optional Capsule sections are used to define the components and modules that make up formatted variable length data structure Capsules were designed for and are intended to be the major vehicle for delivering firmware volume changes to an existing implementation An update capsule is commonly used to update the firmware flash image or for an operating system to have information persist across a system reset A Capsule header section requires one modifier the vicapsuleName modifier Zero or more Capsule sections can be present in a FDF file Version 1 24 December 2014 35 FDF Design Discussion EDK II FDF File Spec The following is the format for the Capsule section header Capsule UiCapsuleName The first elements of a Capsule section are required Token elements using the following format Token VALUE 2 5 1 UEFI Implementation The UEFI specification defines the EFI CAPSULE HEADER structure in the runtime services chapter The header consists of the following elements The following tokens are required in a capsule conforming to the UEFI specification EFI CAPSULE GUID The GUID that defines the contents of a capsule used by the EFI system table which must point to one or more capsules that have the same EFI_CAPSULE GUID value EFI CAPSULE HEADER SIZE Size in bytes of the capsule header If the size specified here is lar
80. eGuid PcdFlashNvStorageSize DATA 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x8D 0x2B OxF1 OxFF 0x96 0x76 0x8B 0x4C The include statement is valid for hex array portion of the DATA RegionType The following is a valid usage for the include statement 0x0CA000 0x002000 gEfiMyTokenSpaceGuid PcdFlashNvStorageBase gEfiMyTokenSpaceGuid PcdFlashNvStorageSize DATA include NvStorelnit txt 2 3 4 3 FILE RegionType The FILE RegionType is a pointer to a binary file that will be loaded into the flash device starting at the first location pointed to by the Offset value It should be noted that a file can be fully qualified path and filename that is outside of the current WORKSPACE The file must be a binary efi or a raw binary file The format of the FILE RegionType is FILE FILE DIR Filename bin Caution If a fully qualified path and filename is specified the platform integrator must ensure that all developers using the DSC and FDF file are aware of the requirements for this path The following is an example of the FILE RegionType Version 1 24 December 2014 27 FDF Design Discussion EDK II FDF File Spec 0x0CC000 0x002000 gEfiCpuTokenSpaceGuid PcdCpuMicrocodePatchAddress gEfiCpuTokenSpaceGuid PcdCpuMicrocodePatchSize FILE OUTPUT DIRECTORY TARGET _ TOOL CHAIN TAG X64 Microcode bin 2 3 4 4 Capsule RegionType The CAPSULE RegionType is a pointer to a capsule section UiName t
81. eader is FV UiFvName The FV ViFvName must be unique for every declared user defined name within the file The viFvName is used for specifying the file that will be used in and FD section Nesting of Fv sections is permitted making it possible to create a tree structure containing multiple FV sections within a single Fv section Nested sections are specified using either the syntax FILE FV_IMAGE Name Or SECTION FV_IMAGE Name within the top Fv Section Use of the UiFvName modifier permits the user to include by UiFvName previously defined sections within another FV section This eliminates the need to re specify components or modules in multiple places This section also specifies how to define content for PI FV Extensions which provides a mapping between a GUID and an OEM file type The size of December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion EFI FIRMWARE VOLUME EXT HEADER and EFI FIRMWARE VOLUME EXT ENTRY sizes will be calculated based on content while the EFI FIRMWARE VOLUME EXT ENTRY type must be defined by the platform integrator based on the PI specification volume 3 The content is limited to the contents of a binary file specified by a FILE statement or a data array specified by a DATA statement The EFI FIRMWARE VOLUME EXT ENTRY OEM TYPE using TYPE 0x0001 is only support by including a file or data structure that completes the remainder of the OEM type entry where the first entry wo
82. ec All elements of a macro definition must appear on a single line the meta data file formats do not permit entries to span multiple lines Escape character sequences are only permitted within a quoted string Quoted strings are treated as literals escape character sequences within quoted strings will not be expanded by the tools Macros that appear in a double quoted string will not be expanded by parsing tools The expectation is that these macros will be expanded by scripting tools such as make or nmake The format and usage for the macro statements is DEFINE MACRO Path Any portion on a path or path and filename can be defined by a macro When assigning a string value to a macro the string must follow the C format for specifying a string as shown below DEFINE MACRO1 SETUP DEFINE MACRO2 L SETUP When assigning a numeric value to a macro the number may be a decimal integer or hex value as shown below DEFINE MACRO1 OxFFFFFFFF DEFINE MACRO2 2 3 DEFINE MACRO3 10 The format for usage of a Macro varies When used as a value the Macro name must be encapsulated by and as shown below MACRO filename foo When a macro is tested in a conditional directive statement determining whether it has been defined or undefined uses the following format 16 December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion ifdef MACRO Note For backward compatibility tools may allow
83. ed will be evaluated normally however only the numeric value of 1 will be considered a match to the and E9 operators against a boolean value of TRUE Additional scripting style operators may be used in place of C operators as shown in the table below 22 December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Table 5 Operator Precedence and Supported Operands Operator Use with Data Types Notes Priority or OR Number Boolean Lowest and AND amp amp Number Boolean Number Boolean Bitwise OR xor XOR Number Boolean Exclusive OR amp Number Boolean Bitwise AND l EQ NE All types The IN operator can only be used to IN test a unary object for membership in a list Space characters must be used before and after the letter operators Strings compared to boolean or numeric values using or EQ will always return FALSE while using the 1 or NE operators will always return TRUE lt gt lt gt All Space characters must be used LE GE LT GT before and after the letter operators Number Boolean Cannot be used with strings the system does not automatically do concatenation Tools should report a warning message if these operators are used with both a boolean and number value not NOT Number Boolean Highest The IN operator can only be used to test a literal string against elements in the following global variables FAMILY
84. egionLayout gt lt Offset gt lt Size gt lt RegionType gt lt CapsuleRegion gt lt PcdOffset gt lt PcdSize gt lt FvType gt lt FileType gt Version 1 24 EDK II FDF File Format FD lt FdUiName gt lt TokenStatements gt lt FdStatements gt u n lt EOL gt lt GlobalStmts gt lt SetStatements gt lt RegionLayout gt lt MacroDefinition gt lt IncludeStatement gt u a zA Z a zA Z0 9 lt TS gt BaseAddress lt Eq gt lt UINT64 gt lt SetPcd gt lt EOL gt lt TS gt Size lt Eq gt lt UINT64 gt lt SetPcd gt lt EOL gt lt TS gt ErasePolarity lt Eq gt 0 1 lt EOL gt lt BlockStatements gt lt FS gt lt PcdName gt lt TS gt BlockSize lt Eq gt lt UINT32 gt lt SetPcd gt lt EOL gt lt TS gt NumBlocks lt Eq gt lt UINT32 gt lt EOL gt lt TS gt SET lt PcdName gt lt Eq gt lt VALUE gt lt EOL gt lt Number gt lt Boolean gt lt GUID gt lt CArray gt lt CString gt lt UnicodeString gt lt Expression gt lt TS gt lt Offset gt lt FS gt lt Size gt lt EOL gt lt TS gt lt PcdOffset gt lt FS gt lt PcdSize gt lt EOL gt lt RegionType gt lt HexNumber gt lt Expression gt lt HexNumber gt lt Expression gt lt FvType gt lt FileType gt lt CapsuleRegion gt lt DataType gt lt TS gt CAPSULE lt Eq gt UiCapsuleName lt EOL gt lt PcdName gt
85. en error 2 If lt FileType gt not defined or not a legal name then error 3 If FilePath FileName then Add one section to FFS with a section type of lt SectionType gt 4 Else Find all files defined by the INF file whose file type is lt FileType gt and add each one to the FFS with a section type of lt SectionType gt in alphabetical order Add files defined in Sources followed by files defined in Binaries 5 If gt 1 vr section in final FFS then error December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion If gt 1 VER section in final FFS then error If gt 1 PEI_DEPEX section in final FFS then error If gt 1 DXE_DEPEX section in final FFS then error If gt 1 SMM DEPEX section in final FFS then error If a rule specifies a file type instead of specifying specific file names the files that match the extension must be processed in alphabetical order Example Rule Common ACPITABLE FILE FREEFORM NAMED GUID RAW ACPI Optional acpi RAW ASL Optional aml x Tools must add the processed acpi files alphabetically followed by the aml files which must also be added alphabetically The file would contain lt SOF gt al acpi a2 acpi bl acpi b2 acpi a aml b aml lt EOF gt where start of file is lt soF gt and end of file is lt EOF gt Refer to the EDK II INF File Specification for a description of the FileType for binary files O OND 2 8 OptionRom Sections The EDK II
86. enSpaceGuid PcdWinNtFdBaseAddress The size in bytes of the FLASH Device Size 0x002a0000 ErasePolarity 1 BlockSize 0x10000 NumBlocks 0x2a EE EE E BEREA EEE BEHEE ERE BEHEE EEE HEHEH HH HH HH HH HH ARR HHH HH HE Following are lists of FD Region layout which correspond to the locations of different images within the flash device Regions must be defined in ascending order and may not overlap December 2014 Version 1 24 EDK II FDF File Spec Nt32Pkg Flash Description File A Layout Region start with a eight digit hex offset leading 0x required followed by the pipe character followed by the size of the region also in hex with the leading 0x characters Like Offset Size PcdoffsetCName PcdSizeCName RegionType lt FV DATA or FILE gt de He HH HE HE HE HE HH HH HH HH HER HHHHHH HEHE HH HEHE HH HH RA HH ARR HARAMA HARA 0x00000000 0x00280000 gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashFvRecoveryBase gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashFvRecoverySize FV FvRecovery 0x00280000 0x0000c000 gEfiNt32PkgTokenSpaceGuid PcdWinNtFlashNvStorageVariableBase gEfiMdeModulePkgTokenSpaceGuid PcdFlashNvStorageVariableSize NV_VARIABLE STORE DATA This is the EFI FIRMWARE VOLUME HEADER ZeroVector 0x00 0x00 Ox00 Ox00 0x00 Ox00 0x00 0x00 0x00 0x00 Ox00 Ox00 0x00 Ox00 0x00 0x00 FileSystemGuid gEfiSystemNvDataFvGuid OxFFF12B8D 0x7696 Ox4C8B OxA9 0x85
87. ent 512K WRITE POLICY RELIABLE TRUE SECTION GUIDED 3EA022A4 1439 4f f 2 B4E4 A6F65A13A9AB SECTION FV_IMAGE Dxe APRIORI DXE INF WORKSPACE a a inf INF EDK SOURCE a c c inf INF WORKSPACE a b b inf December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format INF a d d inf en DEFINE SAMPLE EDK SOURCE Sample INF SAMPLE Universal Network Ip4 Dxe Ip4 inf INF SAMPLE Universal Network Ip4Config Dxe Ip4Config inf INF SAMPLE Universal Network Udp4 Dxe Udp4 inf INF SAMPLE Universal Network Tcp4 Dxe Tcp4 inf INF SAMPLE Universal Network Dhep4 Dxe Dhep4 inf INF Universal Network Mtftp4 Dxe Mtftp4 inf INF Universal Network SnpNt32 Dxe SnpNt32 inf SAMPLE SAMPLE 3 7 Capsule Sections These sections are optional Summary If capsule files are created they will be created in the OUTPUT DIRECTORY TARGET TAGNAME FV directory using the values from the individual instance of the build tools Build tools get these values after parsing DSC INF target txt tools def txt files and command line options Conditional statements may be used anywhere within this section Version 1 24 December 2014 75 EDK II FDF File Format 76 Prototype lt Capsule gt lt UiCapsuleName gt lt SetStatements gt lt VALUE gt lt UefiTokens gt lt CapsuleStmts gt lt GuidValue gt lt GuidCName gt lt Guid
88. enthesis is encouraged to remove ambiguity 2 4 4 APRIORI Scoping 30 Within some firmware volumes an APRIORI file can be created which is a GUID named list of modules in the firmware volume The modules will be invoked or dispatched in the order they appear in the APRIORI file Within a Firmware Volume only one PEI and one DXE Apriori file are permitted Since nested Firmware Volumes are permitted Apriori files are limited to specifying the files not FVs that are within the scope of the FV image in which it is located It is permissible for nested FV images to have one PEI and one DXE Apriori file per FV Scoping is accomplished using the curly braces The following example demonstrates an example of multiple APRIORI files December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Fv Root DEFINE NT32 WORKSPACE EdkNt32Pkg DEFINE BuildDir OUTPUT DIRECTORY PLATFORM NAME TARGET TOOL CHAIN TAG APRIORI DXE FILE DXE CORE B5596C75 37A2 4b69 B40B 72ABD6DD8708 SECTION COMPRESS SECTION PE32 BuildDir X Y 2 B5596C75 37A2 4b69 B40B 72ABD6DD8708 DxeCore efi SECTION VERSION 1 2 3 H INF VERSION 1 NT32 Dxe WinNtThunk Cpu Cpu inf FILE FV IMAGE EF41A0E1 40B1 481f 958E 6FB4D9B12E76 SECTION GUIDED 3EA022A4 1439 4ff2 BAE4 A6F65AI3AYAB SECTION FV IMAGE Dxe APRIORI DXE INF a a a inf INF a c c inf INF a b b inf INF a d d inf In the
89. epInstruct gt lt EOL gt lt MTS gt END lt EOL gt lt MTS gt SOR lt MTS gt lt BoolStmt gt before after lt MTS gt lt Filename gt SECTION lt MTS gt lt FfsAlignment gt SMM DEPEX EXP lt Eg gt lt EOL gt lt DxeDepex gt lt EOL gt December 2014 83 EDK Il FDF File Format EDK II FDF File Spec Restrictions Filename For BINARY ONLY content UEFI_DRIVER and UEFI_APPLICATION efi files the file names specified in the elements FILE and SECTION of this section must be relative to the directory identified by the WORKSPACE system environment variable TargetArch Only specific architectures are permitted use of common is prohibited Parameters UiCapsuleName Filename that will be used to create an FV file CreateFile Filename to create instead of using the UiCapsuleName FvBaseAddress The FvBaseAddress if present must be listed before the FvAlignment element The FvForceRebase flag if present must immediately follow the FvBaseAddress SUBTYPE GUID This is short hand notation refering to content that will be placed in a Section of type EFI_SECTION FREEFORM SUBTYPE GUID A single EFI SECTION FREEFORM SUBTYPE GUID section is permitted in an FFS File of type EFI FV FILETYPE FREEFORM Depex Depex sections are prohibited for modules with a MODULE TYPE of UEFI DRIVER UEFI APPLICATION PEI CORE DXE CORE or SEC modules with MODULE TYPE of USER DEFINED and all Library in
90. er first in list first append second in list is appended after the first These are strictly data files which can only be used by a driver that has a prior knowledge of the content June 2012 August 2013 1 24 Updates Changed specification version to 1 24 Updated FDF_SPECIFICATION to 0x00010018 and updated EBNF to specify this value as 1 24 Updated UEFI specification and EDK Il meta data specifications in section 1 2 added the EDK II UNI Unicode File Specification and EDK Il Expression Syntax Specification December 2014 December 2014 Version 1 24 EDK II FDF File Spec Contents 1 DOVER OU EON NAM A 1 1 1 OverVieW aka nenne 1 1 2Relatedinformation eee 2 1 3 TEMM Seia an a ya i aa ek ya gana laa damak akl yelda la a sa l 2 1 4 Target Aldienee nie E Mila a am ie Dana dede ilam ecele 6 1 5 Conventions sedinthisDocument tenn nenn 6 1 5 1 Data Structure Descriptions nnee eneen enen ennn nnan enen enen venten enen 6 1 5 2 Pseudo Code Conventions nennen eenen ereen een enen vens nennenen vennen 6 1 5 3 Typographic Conventions asen ei 7 2 FDF Design Discussion u aa 9 2 1 Processing OVenieW ee 9 2 1 1 Platform Configuration Database PCD Settings nnen 11 2 2FlashDescriptionFileFormat 12 2 2 1 Section EN NE Sisman ikea sada laa sakala alandan dala 12 2 2 2 Commen
91. ffer from the defacto format in that the semi vun colon character cannot be used to indicate a comment Leading and trailing space tab characters must be ignored It is recommended that duplicate section names be merged by tools This description file consists of sections delineated by section names enclosed within December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion square brackets Section names are case insensitive The different sections and their usage are described below The text of a given section can be used for multiple section names by separating the section names with a comma For example Rule IA32 SEC Rule X64 SEC The content below each section heading is processed by the parsing utilities in the order that they occur in the file The precedence for processing these architecture section tags is from right to left with sections defining an architecture having a higher precedence than a section which uses common or no architecture extension as the architecture modifier Note Content such as filenames directory names MACROs and C variable names within a section IS case sensitive IA32 la32 and ia32 within a section in a directory or file name are processed as separate items Refer to Naming Conventions below for more information on directory and or file naming Sections are terminated by the start of another section or the end of the file Comments are not permitted between square
92. fferent architectures unable to determine which module to use Version 1 24 December 2014 115 Common Error Messages EDK II FDF File Spec 116 December 2014 Version 1 24 EDK Il FDF File Spec Appendix C Reports The following reports could be generated by either usage enhancement tools or the build tools Refer to the EDK II Build Specification for the description of reports generated by the EDK II build system Version 1 24 December 2014 117 Reports EDK II FDF File Spec 118 December 2014 Version 1 24
93. from the BaseAddress and the size of the section that is being described Since completely filling a block is not probable part of the last block of a region can be left empty To ensure that no extraneous information is left in a partial block it is recommended that the block be erased prior to burning it into the device Regions must be defined in ascending order and may not overlap A layout region start with an eight digit hex offset leading 0x required followed by the pipe character followed by the size of the region also in hex with the leading 0x characters The layout region is terminated by the start of another region or an FV Section header The format for an FD Layout Region is Offset Size TokenSpaceGuidCName PcdOf fsetCName TokenSpaceGuidCName PcdSizeCName RegionType Setting the optional PCD names in this fashion is shortcut The two regions listed below are identical with the first example using the shortcut and the second using the long method 0x000000 0x0C0000 gEfiMyTokenSpaceGuid PcdFlashFvMainBaseAddress gEfiMyTokenSpaceGuid PcdFlashFvMainSize FV FvMain 0x000000 0x0C0000 SET gEfiMyTokenSpaceGuid PcdFlashFvMainBaseAddress 0x000000 SET gEfiMyTokenSpaceGuid PcdFlashFvMainSize 0x0C0000 FV FvMain The shortcut method is preferred as the user does not need to maintain the values in two different locations The RegionType if specified must be one of the following FV DATA FILE Or CAP
94. ger than the size of the EFI CAPSULE HEADER then the capsule GUID value implies extended header entries u EFI_CAPSULE FLAGS Currently three bit flags have been defined PersistAcrossReset CAPSULE FLAGS PERSIST ACROSS RESET InitiateReset CAPSULE FLAGS INITIATE RESET and PopulateSystemTable CAPSULE FLAGS POPULATE SYSTEM TABLE The value of the EFI CAPSULE IMAGE SIZE which is the size in bytes of the capsule is determined by the tools In order to use the InitiateReset flag the PersistAcrossReset flag must also be set 2 5 2 Capsule SET Statements SET statements are used to define the values of PCD statements These statements are positional in the FDF file SET statements are set for the Capsule section those set under the Capsule section header are global for all sub sections within the Capsule section SET PcdName VALUE The following is an example of the ser statement SET gEfiMyTokenSpaceGuid PcdSecStartLocalApicTimer TRUE The VALUE specified must match the PCD s datum type and must be the content data For a PCD that has a datum type of vorp the data can be a Unicode string as in L text a valid C data array it must be either a C format GUID or a hex Byte array as in 0x20002000 0x32FF 0x00AA OxFF OxFO 0x00 0x00 0x00 OxFO 0x00 0x00 0x00 OxEF OxlA 0x55 or a hex value as in 0x0000000F with a value that is consistent with the PCD s datum type 2 5 3 Capsule Data EFI CAPSULE DATA fo
95. ges option ROM images and update capsules for bootable images that comply with the UEFI specifications listed above The FDF file describes the content and layout of binary images that are either a boot image or PCI Option ROMs This document describes the format of EDK II FDF files that are required for building binary images for an EDK II platform The goals are Compatibility No compatibility with EDK FDF files exists in format or tools Simplified platform build and configuration The FDF files simplify the process of adding EDK components and EDK II modules to a firmware volume on any given platform The EDK build tools are provided as part of the EdkCompatibilityPkg which is included in EDK II Table 1 shows the FDF compatibility between platform module and component builds Version 1 24 December 2014 Introduction EDK II FDF File Spec Table 1 EDK Build Infrastructure Support Matrix EDK FDF EDK II FDF EDK DSC EDK II DSC EDK Build Tools YES NO YES NO EDK II Build Tools NO YES NO YES 1 2 Related Information The following publications and sources of information may be useful to you or are referred to by this specification Unified Extensible Firmware Interface Specification Version 2 4 Unified EFI Inc 2014 http www uefi org UEFI Platform Initialization Specification Version 1 3 Unified EFI Inc 2013 http www uefi org UEFI Platform Initialization Distribution Package Specif
96. gt PCD lt PcdName gt lt UINT8 gt 0x 0x x0 xFF lt UINT16 gt siz Ox Ox x0 xFFFF lt UINT32 gt zeem 0x 0Ox x0 xFFFFFFFF lt UINT64 gt sz Ox 0Ox x0 xXFFFFFFFFFFFFFFFF Version 1 24 December 2014 47 EDK II FDF File Format 48 lt UINT8z gt lt UINT16z gt lt UINT32z gt lt UINT64z gt lt ShortNum gt lt IntNum gt lt LongNum gt lt LongLongNum gt lt NumValUint8 gt lt NumValUint16 gt lt NumValUint32 gt lt NumValUint64 gt lt ModuleType gt lt ModuleTypeList gt lt IdentifierName gt lt MembershipExpression gt lt NotOp gt lt InOp gt lt TargetExress gt lt ArchExpress gt December 2014 EDK II FDF File Spec ox 0X lt HexDigit gt lt HexDigit gt ox 0X lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt ox ox lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt ox ox lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt lt HexDigit gt 0 255 0 65535 0 4294967295 0 18446744073709551615 lt ShortNum gt lt UINT8 gt lt IntNum gt lt UINT16 gt lt L
97. gt lt EOL gt lt TS gt WRITE LOCK STATUS lt Eq gt lt BoolType gt lt EOL gt lt TS gt WRITE ENABLED CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt WRITE DISABLED CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt WRITE STATUS lt Eq gt lt BoolType gt lt EOL gt lt TS gt STICKY WRITE lt Eq gt lt BoolType gt lt EOL gt lt TS gt WRITE POLICY RELIABLE lt Eq gt lt BoolType gt lt EOL gt lt TS gt READ LOCK CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt READ LOCK STATUS lt Eq gt lt BoolType gt lt EOL gt lt TS gt READ ENABLED CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt READ DISABLED CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt READ STATUS lt Eq gt lt BoolType gt lt EOL gt lt PeiAprioriSection gt lt DxeAprioriSection gt Restrictions FName APRIORI PEI lt MTS gt lt EOL gt lt MacroDefinition gt lt FileStatements gt lt TS gt lt EOL gt APRIORI DXE lt MTS gt lt EOL gt lt MacroDefinition gt lt FileStatements gt lt TS gt lt EOL gt For BINARY ONLY content UEFI_DRIVER and UEFI_APPLICATION efi files the file names specified in directory identified by 92 the SECTION element of this section must be relative to the the WORKSPACE system environment variable December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format Parameters S INF VERSION
98. gt lt TrueFalse gt lt EOL gt WRITE LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE LOCK STATUS lt Eq gt lt TrueFalse gt lt EOL gt WRITE ENABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE DISABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt WRITE STATUS lt Eq gt lt TrueFalse gt lt EOL gt STICKY WRITE lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt WRITE POLICY RELIABLE lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt lt TS gt ae READ LOCK CAP lt Eq gt lt TrueFalse gt lt EOL gt READ LOCK STATUS lt Eq gt lt TrueFalse gt lt EOL gt READ ENABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt READ DISABLED CAP lt Eq gt lt TrueFalse gt lt EOL gt READ STATUS lt Eq gt lt TrueFalse gt lt EOL gt ERASE POLARITY lt Eg gt 0 1 lt EOL gt lt TS gt FileSystemGuid lt Eq gt lt NamedGuid gt lt EOL gt lt TS gt FvNameGuid lt Eq gt lt NamedGuid gt lt EOL gt lt TS gt APRIORI lt MTS gt PEI lt MTS gt lt EOL gt lt MacroDefinition gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt lt TS gt APRIORI lt MTS gt DXE lt MTS gt lt EOL gt lt MacroDefinition gt lt InfStatements gt lt FileStatements gt lt TS gt lt EOL gt lt TS gt INF lt MTS gt lt InfOptions gt lt InfFile gt lt Use gt
99. hat will be loaded into the flash device starting at the first location pointed to by the Offset value The format of the FILE RegionType is CAPSULE UiCapsuleName The following is an example of the CAPSULE RegionType 0x0CC000 0x002000 gEfiTokenSpaceGuid PcdCapsuleOffset gEfiTokenSpaceGuid PcdCapsuleSize CAPSULE MyCapsule 2 3 4 5 No RegionType Specified It is permissible to define a region with no data pre loaded For example event logging needs a data region to store events This region is filled with data that matches the ErasePolarity bit during the initial installation of the firmware or through UEFI or operating system commands and services An example of no region type specified is 0x0CE000 0x002000 gEfiMyTokenSpaceGuid PcdFlashNvStorageEventLogBase gEfiMyTokenSpaceGuid PcdFlashNvStorageEventLogBase 2 4 FV Sections 28 The Fv sections are required for platform images are optional for Capsule images and are not required for Option ROM only images The Fv section defines what components or modules are placed within a flash device file These sections define the order the components and modules are positioned within the image The Fv section consists of define statements set statements and module statements A single Fv section is terminated by the start of another section header or the end of the file The FV section has one required modifier a user defined section name The format for FV section h
100. have the double quoted string prefixed by u as in the following example lif gTokenSpaceGuid PcdCname L Setup DEFINE FOO TRUE lendif When used in i and telseif conditional comparison statements it is the value of the Macro or the PCD that is used for testing not the name of the macro or PCD Strings can only be compared to strings of a like type testing an ASCII string against a Unicode format string must fail numbers can only be compared against numbers and boolean objects can only evaluate to TRUE or FALSE See the Operator Precedence table in the Expressions section below for a list of restrictions on comparisons Using macros in conditional directives that contain flags for use in the BuildOptions sections of DSC files is not recommended If a PCD is used in a conditional statement the value must first come from the FDF file then from the DSC file If the value cannot be determined from these two locations the build system should break with an error message Note PCDs used in conditional directives must be defined and the value set in either the FDF or DSC file in order to be used in a conditional statement values from INF or DEC files are not permitted The following is an example of conditional statements Version 1 24 December 2014 21 FDF Design Discussion EDK II FDF File Spec lif MSFT in S FAMILY or INTEL in FAMILY statements lelse if FAMILY GCC statements lendif lifdef
101. he minor number yielding a maximum value 99 99 Removed support for variable block size in the FD section not currently supported by build tools Removed paragraph about build options in section 2 2 6 Updated priority list described precedence of the SET statements overriding previous definitions removing set scoping statements Update EBNF for conditionals and removed lt SectionStatements gt in EBNF Remove the word should and replace it with other text that means recommended but not required replaced remaining instances of should with either must or will Updated 2 2 8 to include text to describe examples Added 2 2 9 section which includes expression table and text Updated 2 2 10 to state that macros are evaluated when used not when entered Added the IN operator as an Equality Operator added description and restriction of it s usage using lt MemberExpression gt Define how EDK_GLOBAL values can be used but not defined in the FDF file Add text regarding the FvForceRebase flag Removed PART_NAME from Defines section as it is not supported by current tools and none of the FDF files have the Defines section Removed the GuidCName from lt NamedGuid gt as this is not supported by tools at this time December 2011 Version 1 24 December 2014 vi EDK II FDF File Spec 1 22 w Errata B 1 22 w Errata C Updates e Section 1 3 Updated UEFI and PI specifications to ref
102. hese pre defined macro statements These macros should never be expanded during the initial parsing phase as other tools use these macros to generate the UEFI and PI compliant images Additionally the macro names should never be set by the user as these values are Version 1 24 December 2014 19 FDF Design Discussion EDK II FDF File Spec filled in by the build tools based other file and base names Table 4 Reserved Rule Section Macro Strings Variable String Description src Source file s to be built full path s_path Source file directory absolute path s_dir Source file relative directory within a module Note s_dir is always equals to if source file is given in absolute path s_name Source file name without path s_base Source file name without extension and path s_ext Source file extension dst Destination file s built from src full path d_path Destination file directory absolute path d_name Destination file name without path d_base Destination file name without extension and path d_ext Destination file extension The SET and DEFINE statements are not permitted in the Rule section 2 2 7 PCD Names Unique PCDs are identified using the format to identify the named PCD PcdTokenSpaceGuidCName PcdCName The PCD s Name PcdName is defined as PCD Token Space Guid C name and the PCD C name se
103. hey permitted between the dot and the PcdcName 3 1 3 Paths for filenames Note that for specifying the path for a file name if the path value starts with a dollar sign character either a local MACRO or system environment variable is being specified If the path value starts with one of letter or the path must be a fully qualified URI location If it does not the specified path is relative to the WORKSPACE environment variable Caution The use of and in a path element is prohibited For all FDF files the specified directory path must use the forward slash character for separating directories For example MdePkg Include is Valid Note Ifthe platform integrator is working on a Microsoft Windows environment and will not be working on a non windows platform then the DOS style directory separator can be used The forward slash Unix style directory separator is mandatory for distributions where the build environment is unknown Unless otherwise noted all file names and paths are relative the system environment variable WORKSPACE A directory name that starts with a word is assumed by the build tools to be located in the WoRKSPACE directory Each module may have one or more INF files that can be used by tools to generate images Specifically the EDK Compatibility Package may contain two INF files for any module that contains assembly code Since the ECP can be used with existing EDK tools which is
104. hin EDK II FDF files must use the forward slash character to separate directories as well as directories from filenames Example C Work Edk2 edksetup bat File names must also follow the same naming convention required for directories No white space characters are permitted The special characters permitted in directory names are the only special characters permitted in file names The relative path is relative to the directory the FDF file must be used unless otherwise noted Use of and in the path of the file is strictly prohibited All files listed in this section must reside in the directory this INF file is in or in sub directories of this directory 2 2 5 linclude Statements The include statement may appear within an EDK II FDF file The included file content must match the content type of the current section definition contain complete sections or combination of both The argument of this statement is a filename The full path using one of the system environment variables as in WORKSPACE NoSuchPlatform MyInclude txt relative to the WORKSPACE variable may be given as in Conf MyIncludeFile txt or it may be just the filename MyIncludeFile txt If the latter case parsing tools must check the directory containing this FDF file and if not found check the directory containing the platform description DSC file if it is different If the file is not found after testing for the possible com
105. iateReset PopulateSystemTable PersistAcrossReset InitiateReset PersistAcrossReset InitiateReset PersistAcrossReset PopulateSystemTable InitiateReset PopulateSystemTable PersistAcrossReset PersistAcrossReset PersistAcrossReset InitiateReset lt InfStatements gt lt FileStatements gt lt FvStatements gt lt FdStatenents gt lt Afile gt lt TS gt INF lt MTS gt lt InfOptions gt lt InfFile gt lt EOL gt lt Use gt lt Rule gt lt SetVer gt lt SetUi gt USE lt Eq gt lt TargetArch gt lt MTS gt lt arch gt RuleOverride lt Eq gt lt RuleUiName gt BINARY lt MTS gt VERSION lt Eq gt lt CString gt lt MTS gt UI lt Eq gt lt CString gt lt MTS gt if MODULE TYPE SEC MODULE TYPE PEI CORE MODULE TYPE PEIM lt PATH gt lt Word gt inf lt FS gt lt RelocFlags gt else lt PATH gt lt Word gt inf RELOCS STRIPPED RELOCS RETAINED lt Target gt lt TagName gt lt TargetArch gt December 2014 77 EDK II FDF File Format 78 lt Target gt lt TagName gt lt FileStatements gt lt typel gt lt type2 gt lt type3 gt lt type4 gt lt type5 gt lt FvTypel gt lt FvType2 gt lt NamedGuid gt lt NamedGuidOrPcd gt lt Optionsl gt lt Options2 gt lt FileOpts gt lt FfsAlignment gt lt FvAlignment gt EDK I
106. ication Version 1 0 with Errata B Unified EFI Inc 2014 http www uefi org Intel Platform Innovation Framework for EFI Specifications Intel 2007 http www intel com technology framework http tianocore sourceforge net wiki EDK II Specifications EDK II Module Writers Guide Intel 2010 EDK II User Manual Intel 2010 EDK II C Coding Standard Intel 2014 EDK II DSC Specification Intel 2014 EDK II INF File Specification Intel 2014 EDK II FDF Specification Intel 2014 EDK II Build Specification Intel 2014 EDK II UNI Unicode File Specification Intel 2014 EDK II Expression Syntax Specification Intel 2014 VFR Programming Language Intel 2012 EDK II Platform Configuration Database Infrastructure Description Intel 2009 INI file Wikipedia http en wikipedia org wiki INI file C Now C Programming Information Langston University Tulsa Oklahoma J H Young 1999 2011 http c comsci us syntax expression ebnf html 1 3 Terms The following terms are used throughout this document to describe varying aspects of input localization BaseTools The BaseTools are the tools required for an EDK II build BDS Framework Boot Device Selection phase BNF BNF is an acronym for Backus Naur Form John Backus and Peter Naur introduced for the first time a formal notation to describe the syntax of a given language December 2014 Version
107. ile Format 90 lt GuidHeaderSize gt lt LeafSections gt lt C16Sec gt lt PeSec gt lt PicSec gt lt TeSec gt lt RawSec gt lt DxeDepSec gt lt SmmDepSec gt lt UiSec gt lt VerSec gt lt PeiDepSec gt lt SubtypeGuidSec gt lt FileOrExt gt lt FileOrExtOrPcd gt lt Ext gt lt C16FileType gt lt Pe32FileType gt lt ChkReloc gt EDK II FDF File Spec EXTRA HEADER SIZE lt Eq gt lt Number gt lt MTS gt lt TS gt lt C16Sec gt lt PeSec gt lt PicSec gt lt TeSec gt lt FvSec gt lt RawSec gt lt DxeDepSec gt lt UiSec gt lt VerSec gt lt PeiDepSec gt lt SmmDepSec gt lt SubtypeGuidSec gt COMPAT16 lt MTS gt lt C16FileType gt lt FileOrExt gt lt EOL gt PE32 lt MTS gt lt Pe32FileType gt lt FileOrExt gt lt EOL gt PIC lt MTS gt lt PicFileType gt lt FileOrExt gt lt EOL gt TE lt MTS gt lt TeFileType gt lt FileOrExt gt lt EOL gt RAW lt MTS gt lt RawFileType gt lt FileOrExtOrPcd gt lt EOL gt DXE DEPEX lt MTS gt lt DdFileType gt lt FileOrExt gt lt EOL gt SMM DEPEX lt MTS gt lt DdFileType gt lt FileOrExt gt lt EOL gt UI lt MTS gt lt UiFileType gt lt FileOrExt gt lt EOL gt VERSION lt MTS gt lt VerFileType gt lt FileOrExt gt lt EOL gt PEI DEPEX lt MTS gt lt PdFileType gt lt FileOrExt gt lt EOL gt SUBTYPE GUID lt M
108. in a rules section Rules are used as templates normally using variable names instead of fully qualified names while INF statements are always are fully qualified file names The following list specifies the allowed variables that may be used exactly as typed WORKSPACE EDK SOURCE EFI SOURCE TARGET TOOL CHAIN TAG ARCH MODULE NAME OUTPUT DIRECTORY BUILD NUMBER INF VERSION NAMED GUID INF OUTPUT Conditional statements may be used anywhere within this section December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format Prototype lt Rules gt Rule lt RuleArgs gt lt EOL gt lt FileStatements gt lt RuleArgs gt lt arch gt lt ModuleType gt lt TemplateName gt lt ModuleType gt lt EdkComponentType gt lt Edk2ModuleType gt lt Edk2ModuleType gt i SEC PEI_CORE PEIM SMM_CORE DXE_CORE DXE_DRIVER DXE SAL DRIVER DXE_SMM_DRIVER DXE RUNTIME DRIVER UEFI DRIVER UEFI APPLICATION USER DEFINED LIBRARY APPLICATION AcpiTable BINARY BS DRIVER LOGO Legacy16 Microcode PE32_PEIM RAWFILE RT_DRIVER SAL RT DRIVER SECURITY_CORE COMBINED PEIM DRIVER PIC_PEIM RELOCATABLE PEIM PEI CORE lt EdkComponentType gt ORE lt TemplateName gt 5 lt RuleUiName gt lt RuleUiName gt lt Word gt BINARY lt FileStatements g
109. ing gt lt NamedMacros gt INF VERSION MODULE NAME Optional lt MTS gt lt FfsAlignment gt lt VerFile gt lt VerString gt VERSION lt MTS gt lt VerOpts gt Optional lt MTS gt lt BuildAlign gt STRING lt Eq gt lt VerStringVal gt lt MTS gt lt BuildAlign gt lt UnicodeString gt lt Quotedstring gt INF_VERSION Optional lt MTS gt lt BuildArg gt lt FfsAlignment gt BUILD NUM BUILD NUMBER lt MTS gt PEI DEPEX lt MTS gt lt DpxAlign gt FV IMAGE lt MTS gt lt FvBin gt lt FvImageSection gt December 2014 91 EDK II FDF File Format EDK II FDF File Spec lt FvBin gt FV lt MTS gt lt FfsAlignment gt lt FileOrExt gt lt EOL gt lt FvImgSection gt FV IMAGE lt MTS gt lt FvImgArgs gt lt FvImgArgs gt siz lt EOL gt lt MacroDefinition gt lt FvAlignment gt lt FvAttributes gt lt AprioriSection gt lt FileStatements gt lt TS gt lt EOL gt lt FvAlignment gt lt TS gt FvBaseAddress lt Eq gt lt UINT64 gt lt EOL gt lt TS gt FvAlignment lt Eq gt lt FvAlignmentValues gt lt EOL gt lt FvAttributes gt lt TS gt MEMORY MAPPED lt Eq gt lt BoolType gt lt EOL gt lt TS gt LOCK CAP lt Eq gt lt BoolType gt lt EOL gt lt TS gt LOCK STATUS lt Eq gt lt BoolType gt lt EOL gt lt TS gt WRITE LOCK CAP lt Eq gt lt BoolType
110. ion 1 24 December 2014 xi EDK II FDF File Spec xii December 2014 Version 1 24 EDK II FDF File Spec Introduction 1 Introduction This document describes the EDK II Flash Description FDF file format This format was designed to support new build requirements of building EDK and EDK II modules within the EDK II build infrastructure The EDK II Build Infrastructure supports generation of current Unified EFI Inc UEFI 2 4 and PI 1 3 compliant binary images The FDF file is used to describe the content and layout of binary images Binary images described in this file may be any combination of boot images capsule images or PCI Options ROMs Note EDK II FDF file formats have no similarity to EDK FDF file formats New utilities and functionality have been provided to process these files 1 1 Overview EDK II tools use INI style text based files to describe components platforms and firmware volumes The EDK II Build Infrastructure supports generation of binary images compliant with Unified EFI Forum UEFI specifications UEFI and Platform Initialization PI The EDK II build processes defined in the EDK II Build Specification use separate steps to create EFI images EDK Build Tools are included as part of the EDK II compatibility package In order to use EDK II Modules or the EDK II Build Tools EDK II DSC and FDF files must be used The EDK II FDF file is used in conjunction with an EDK II DSC file to generate bootable ima
111. ion Syntax Specification for more information Location For BINARY ONLY files the location specified in the FILE element of this section must be relative to the directory identified by the WORKSPACE system environment variable Version 1 24 December 2014 63 EDK II FDF File Format EDK II FDF File Spec 64 Example FD FdMain BaseAddress OxFFF00000 gEfiMyPlatformTokenSpaceGuid PcdFlashAreaBaseAddress Size 0x102000 ErasePolarity 1 BlockSize 0x10000 NumBlocks 16 BlockSize 0x1000 NumBlocks 2 Offset Size 0x000000 0x0C0000 gEfiMyPlatformTokenSpaceGuid PcdFlashFvMainBase gEfiMyPlatformTokenSpaceGuid PcdFlashFvMainSize FV FvMain 0x0C0000 0x00A000 gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageBase gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageSize Data Variable Store 0x00 0x00 0x00 0x00 0x00 Ox00 Ox00 0x00 0x00 0x00 Ox00 Ox00 0x00 0x00 Ox00 0x00 0x8D Ox2B OxXF1 OxFF 0x96 0x76 Ox8B Ox4C OxA9 0x85 0x27 0x47 0x07 Ox5B Ox4F 0x50 0x00 0x00 0x02 0x00 0x00 Ox00 Ox00 0x00 0x5F 0x46 0X56 0x48 OxFF Ox8E OxFF OxFF Ox5A OXFE 0x00 0x00 0x00 0x00 0x00 0x00 0x0CA000 0x002000 gEfiCpuTokenSpaceGuid PcdCpuMicrocodePatchAddress gEfiCpuTokenSpaceGuid PcdCpuMicrocodePatchSize FILE FV Microcode bin 0x0CC000 0x002000 Event Log gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageEventLogBase gEfiMyPlatformTokenSpaceGuid PcdFlashNvStorageEventLogSize
112. irectory Parameters lt BinFile gt Filename If a filename is given the file must have an extension for a binary type file such as bin or BIN Filenames are case sensitive so the correct case must be used for all filenames lt SymFile gt Filename If a filename is given the file must have an extension for a symbol type file such as sym or SYM Filenames are case sensitive so the correct case must be used for all filenames Example VTF IPF MyBsf IA32 RST BIN IA32 RST BIN COMP NAME PAL A Component Name COMP LOC FvRecovery F In the first VIF file COMP TYPE 0xF Component Type PAL A 0x0F defined in SAL Spec COMP_VER 7 01 Version will come from header of PAL A binary COMP CS 1 Checksum Validity CV bit COMP BIN PAL A GEN BIN Path of binary COMP SYM PAL A GEN SYM Path of SYM symbol COMP SIZE Preferred component size in bytes COMP NAME PAL B Component Name COMP LOC F In the first VIF file COMP TYPE 0x01 Component Type PAL A 0x0F defined in SAL Spec COMP VER Version will come from header of PAL A binary COMP CS 1 Checksum Validity CV bit COMP BIN PAL B BIN Path of binary COMP SYM PAL B Sym Path of SYM symbol COMP SIZE Preferred component size in bytes 3 10 PCI OptionRom Section This is an optional section Summary This section is used to specify the content of a PCI Option ROM container A PCI Option ROM image m
113. ive hyper link to the code definition for that function or type definition Click on the word to follow the hyper link VAR This symbol VAR defined by the utility or input files Italic Monospace In code or in text words in Italic Monospace indicate placeholder names for variable information that must be supplied i e arguments Version 1 24 December 2014 7 Introduction EDK II FDF File Spec Note Due to management and file size considerations only the first occurrence of the reference on each page is an active link Subsequent references on the same page will not be actively linked to the definition and will use the standard non underlined BOLD Monospace typeface Find the first instance of the name in the underlined BOLD Monospace typeface on the page and click on the word to jump to the function or type definition The following typographic conventions are used in this document to illustrate the Extended Backus Naur Form item Square brackets denote the enclosed item is optional item Curly braces denote a choice or selection item only one of which may occur on a given line lt item gt Angle brackets denote a name for an item range range Parenthesis with characters and dash characters denote ranges of values for example a zA Z0 9 indicates a single alphanumeric character while 0 9 indicates a single digit item Characters within guotation marks are
114. le This is only a convention and developers can maintain different flash description files using different file names for example a given size or model of flash part The file can have any name however it is recommended that developers use the FDF extension for all flash description files The flash description file is normally in the same directory as the platform description DSC file The remainder of this document uses FDF instead of Flash Description File The EDK II Build generates UEFI and PI specification compliant binary images The tools provided in the EDK and the EdkCompatibilityPkg module support earlier versions of the specifications Because PI 1 2 described a new flash format modules written for previous PI specifications that touch flash must be modified to work with the new flash image format Note Path and Filename elements within the FDF are case sensitive in order to support building on UNIX style operating systems Names that are used in C code are case sensitive as well as MACRO names used as short cuts within the FDF file Use of 7 and in path and filename elements is prohibited Note GUID values are used during runtime to uniquely map the C names of PROTOCOLS PPIS PCDS and other variable names Note This document uses to indicate that a line that cannot be displayed in this document on a single line Within the DSC specification each entry must appear on a single line
115. lect Errata Section 2 2 6 Provide clarification on MACRO values e Section 3 8 Remove undocumented tags that begin with SEC that are used internally by tools Sections 2 4 6 2 3 6 3 7 and 3 8 Provide explanation of SUBTYPE_GUID in Parameters section Sections 3 6 3 7 and 3 8 Modify the EBNF entries for section SUBTYPE_GUID to allow specifying the GUID value 3 6 3 7 and 3 8 Clarify User Interface entries in parameters section Section 3 2 1 Remove invalid reference to ExtendedLine e Section 3 2 1 Fix the DOS EOL character sequence The FDF Specification Version will not change in the Defines section Updates e Section 1 3 Updated UEFI and PI specifications with Errata e Section 2 3 4 3 2 4 5 3 5 3 6 3 7 3 8 and 3 10 Allow binary files to be located outside of the WORKSPACE e Section 2 4 6 and 2 4 6 1 added type DISPOSABLE to encapsulation file types e Sections 3 6 3 7 and 3 8 Clarify that the plain text file for the User Interface is plain ASCII text e Section 2 1 Updated the figure to remove top level Makefile e Section 2 1 Update location of the FDF file e Section 2 2 8 and 3 2 3 Clarify PCD usage in conditional directive statements e Included new section PCD RULES Added reference to the EDK II Build Specification for PCD Processing Rules e Added lt Afile gt Definition to the Capsule section EBNF for appending the contents of a binary file to a section appends are listed in ord
116. les are not permitted Prototype lt Conditional gt lt IfStatement gt lt ElseIfConditional gt lt ElseConditional gt lt TS gt lendif lt EOL gt lt IfStatement gt lt TS gt lif lt MTS gt lt ExpressionStatement gt lt TS gt ifdef lt MTS gt lt MACRO gt lt EOL gt lt TS gt ifndef lt MTS gt lt MACRO gt lt EOL gt lt Statements gt lt Statements gt lt Statements gt lt Conditional gt lt ElseIfConditional gt lt TS gt elseif lt MTS gt lt ExpressionStatement gt lt EOL gt lt Statements gt lt ElseConditional gt lt TS gt lelse lt EOL gt lt Statements gt lt ExpressionStatement gt lt Expression gt lt EOL gt Restrictions MACRO and PCD Values When a MACRO is used in conditional directives if or elseif the lt MACROVAL gt MACRO format is used When a PCD is used in a conditional directive or in an expression the lt PCDVAL gt PcdName format is used Number values For Numeric expressions numbers must not be encapsulated by double quotation marks Strings Strings in lt PCDVAL gt elements must be NULL terminated The NULL character is not part of the string that is tested All other string comparisons do not include the double quotation marks encapsulating the string If the string is myapple the only characters that would be tested are myapple When using strings in the expression statements there must be a
117. llows the EFI CAPSULE HEADER token definitions in the 36 December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Capsule section or sub sections The content consists of one or more files FD UiName FV UiName or the following 2 5 3 1 INF Statements The INF statement syntax is common to the syntax used for Fv sections Refer to section 2 4 4 above 2 5 3 2 FILE Statements FILE statement syntax is common to the syntax used for Fv sections Refer to Section 2 4 5 2 6 VTF Sections The optional vTF sections specify information regarding the IPF Boot Strap File BSF or the IA32 Volume Top File VTF Both the ARCH and the viname modifier fields are required The VTF section terminates with either the start of another section or the end of the file The vTF section modifier usage is shown below VTF ARCH UiName Underneath the vrr section are specific statements defining information about the VTF file EDK Bsf inf files use two different sections an OPTIONS section and a COMPONENTS section For EDK II the grammar of the vrr section statements defines these sections rather than having separate sub sections within the VTF section The format for statements within the section is illustrated below STATEMENT NAME Value The component version number COMP VER values are binary coded decimal 1 byte for the major number and 1 byte for the minor number As a result the maximum value is
118. lt EOL gt lt TS gt PCI_COMPRESS lt Eq gt lt TrueFalse gt lt EOL gt lt TS gt lt EOL gt lt EfiBinary gt lt OtherBinary gt lt EfiFileName gt lt TS gt FILE lt MTS gt EFI lt Overrides gt lt EOL gt lt MTS gt lt PATH gt lt Word gt efi EFI Efi lt TS gt FILE lt MTS gt BIN lt Filename gt lt EOL gt or the wildcard character is prohibited Paths For BINARY ONLY content UEFI_DRIVER and UEFI_APPLICATION efi files the file names specified in lt EfiFileName gt of this section must be relative to the directory identified by the WORKSPACE system environment variable In some cases the tools will search well known paths for some files for example for FD filenames the output will typically be located in the OUTPUT_DIRECTORY TARGET TAGNAME FV directory December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format Related Definitions DriverName Specifies the name of the created PCI Option ROM image that will be placed in the build s FV directory USE Specifies the architecture to use to create a PCI Option ROM Filename Filenames must match the actual case of the file three variations are shown for the efi extension in the ENBF above Example OptionRom AtapiPassThru INF USE IA32 OptionRomPkg AtapiPassThruDxe AtapiPassThruDxe inf PCI_REVISION 0x0020 INF USE EBC OptionRomPkg AtapiPassThruDxe AtapiPassTh
119. luates to TRUE or FALSE Logical Expression This is a test where the expression MACRO value or PCD value include lt MACROVAL gt or lt PCDVAL gt used in an expression must evaluate to either TRUE 1 or FALSE 0 no operators are required however logical operators as well full expressions can be used expressions that do not evaluate to TRUE or FALSE must break the build String Expressions The strings must be exactly identical in order to match Literal strings must be encapsulated by double quotation marks There must be a comparison operator between two strings using a string without an operator is not permitted Also permitted are the membership expressions for architectures targets and tool chain tag names All Expression C style expression using C relational equality and logical numeric and bitwise operators that evaluate to either TRUE 1 or FALSE 0 Values other than zero or one are invalid Precedence and associativity follow C standards Along with absolute values macro names and PCDs may be used within an expression For both macro names and PCDs the element must be previously defined before it can be used A new operator in is also permitted for testing membership of an item in a list of one or more items 54 December 2014 Version 1 24 EDK II FDF File Spec Example lif MyPlatformTspGuid IPF VERSION 1 S MyPlatformTspGuid IPF VERSION 2 VTF IPF MyBsf lifdef IA32RESET IPF VERSION is
120. may also be specified as decimal value such as 1 24 PcdNames PCDs defined in this section take precedence over PCD values specified in other meta data files Note that PCDs defined via the SET statements in sub sections of the document can override the values set here as well as in other EDK II meta data files Version 1 24 December 2014 59 EDK Il FDF File Format EDK II FDF File Spec Example Defines FDF SPECIFICATION 0x00010018 DEFINE BIG STUFF False SET gEfiMyPlatformTokenSpaceGuid MyUsbFlag True 3 5 FD Sections This is a required section for platform flash parts and is not required for simple Option ROM creation Summary This describes the FD section tag which is required in all FDF files This file is created by the platform integrator and along with the platform DSC file is an input to the parsing utilities All FD files will be created in the OUTPUT DIRECTORY TARGET TAGNAME FV directory using the values from the individual instance of the build tools Build tools get these values after parsing DSC INF target txt tools_def txt files and command line options Conditional statements may be used anywhere within this section 60 December 2014 Version 1 24 EDK II FDF File Spec Prototype lt FD gt lt FdStatements gt lt GlobalStmts gt lt FdUiName gt lt TokenStatements gt lt SetPcd gt lt BlockStatements gt lt SetStatements gt lt VALUE gt lt R
121. n be used in different BuildOptions sections Make sure that macros are not restricted to only directories Prohibit macros in the filename specified in include statements Updated 2 3 3 and 2 4 3 to allow macro and expression for value in a set statement Added lt Filename gt to Macro values Clarify that only a limited number of system environment variables not macros can be used in the include statement Clarify the rules for finding the include files Clarify how macros can be shared between sections Add statement about not expanding macros that are in a double quoted string Update macro usages in conditional directive statements Put in rules for combining sections and where macros can be inherited December 2014 December 2011 Version 1 24 EDK II FDF File Spec 1 22 w Errata A Cont Updates Updated OptionROM section for COMPRESS to PCI_COMPRESS matching the INF spec Removed CREATE_FILE from all FDF sections that had it Add FvBaseAddress attribute in FV section Added BCD Hex choice for COMP_VER in VTF section Changed elif to elseif in 3 2 3 to match implementation Removed duplicate definition of true in 3 2 3 Added EBNF for lt Extension gt Allow DATA section to contain a GUID value Add reserved keyword BINARY as Rule name updated rule override information for binary modules Clarify that the VTF COMP_VER value is stored in BCD using 1 byte for major and one byte for t
122. nd the number of blocks that are needed for FV images that do NOT get put into a physical flash part such as the recovery image that gets put on a floppy or USB key BLOCK SIZE VALUE NUM BLOCKS VALUE The following is an example of the BLOCK statement BLOCK SIZE 512 2 4 3 FV SET Statements SET statements are used to define the values of PCDs These statements are positional within the FDF file SET statements set a PcdName to a VALUE for this FV Version 1 24 December 2014 29 FDF Design Discussion EDK II FDF File Spec SET lt PcdName gt VALUE The following is an example of the ser statement SET gEfiMyTokenSpaceGuid PcdDisableOnboardVideo TRUE The VALUE specified must match the Pcd s datum type and must be the content data For a PCD that has a datum type of vorp the data can be a Unicode string as in L text a valid C data array it must be either a C format GUID or a hex byte array as in 0x20 0x00 0x20 0x00 0x32 OxFF 0x00 OxAA OxFF OxFO 0x00 0x00 0x00 or a hex value as in 0x0000000F with a value that is consistent with the PCD s datum type The value may also be a macro or it may be computed using arithmetic operations arithmetic expressions and or logical expressions The value portion of the SET statement when using any of these computations are in fix expressions that are evaluated left to right with items within parenthesis evaluated before the outer expressions are evaluated Use of par
123. ne NAMED GUID Tool parsing FILE GUID statement in the INF file MODULE NAME Tool parsing the BASE NAME statement in the INF file INF VERSION Tool parsing the VERSION STRING statement in the INF file INF OUTPUT The OUTPUT directory created by the build system for each EDK II module TARGET Valid values are derived from INF DSC target txt and tools_def txt FDF parsing tools may obtain these values from command line options TOOL CHAIN TAG Valid values are derived from INF DSC target txt and tools_def txt FDF parsing tools may obtain these values from command line options ARCH Valid values are derived from INF DSC target txt and tools_def txt FDF parsing tools may obtain these values from command line options Note System environment variables may be referenced however their values must not be altered 18 December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Table 3 Using System Environment Variable Macro Style Used in Meta Windows Environment Linux amp OS X Environment Data files Variable Variable WORKSPACE WORKSPACE WORKSPACE EFl_SOURCE EFI_SOURCE EFI_LSOURCE EDK_SOURCE EDK_SOURCE EDK_SOURCE EDK_TOOLS_PATH EDK_TOOLS_PATH EDK_TOOLS_PATH ECP_SOURCE ECP_SOURCE ECP_SOURCE Macros defined in the FDF file are local to the FDF file They are also positional in nature with later definitions
124. niversal Network Mtftp4Dxe Mtftp4Dxe inf INF MdeModulePkg Universal Network Tcp4Dxe Tcp4Dxe inf INF MdeModulePkg Universal Network Udp4Dxe Udp4Dxe inf INF Nt32Pkg SnpNt32Dxe SnpNt32Dxe inf INF MdeModulePkg Universal Network UefiPxeBcDxe UefiPxeBcDxe inf INF MdeModulePkg Universal Network IScsiDxe IScsiDxe inf BEER EEE EEE EEE EEE EEE kkk kkk kkk ik kik FILE statements are provided so that a platform integrator can include complete EFI FFS files as well as a method for constructing FFS files using curly brace scoping The following three FILEs are for binary shell binary fat and logo module de He HE HH HE HH HH HH HH ARAR HH HH HH HH RA HH HH HH HH HH HH HIER FILE APPLICATION PCD gEfiIntelFrameworkModulePkgTokenSpaceGuid PcdShellFile SECTION PE32 EdkShellBinPpkg FullShell Ia32 Shell_Full efi FILE DRIVER 961578FE B6B7 44c3 AF35 6BC705CD2B1F SECTION PE32 FatBinPkg EnhancedFatDxe Ia32 Fat efi FILE FREEFORM PCD gEfiIntelFrameworkModulePkgTokenSpaceGuid PcdLogoFile SECTION RAW MdeModulePkg Logo Logo bmp HEERE EEE EEE EREA BEER Rules are use with the FV section s module INF type to define how an FFS file is created for a given INF file The following Rule are the default rules for the different module type User can add the customized rules to define the content of the FFS file HEERE EERE EER HHRHH HH kik kik kkk AAE HH HHHHHRHHHREHHHHHH HH HHHHH HEHE HH HH HEH
125. objects Unless otherwise noted the ordering is assumed to be FIFO Pseudo code is presented in a C like format using C conventions where appropriate The coding style particularly the indentation style is used for readability and does not necessarily comply with an implementation of the Extensible Firmware Specification 1 5 3 Typographic Conventions This document uses the typographic and illustrative conventions described below Typographic Convention Plain text Typographic convention description The normal text typeface is used for the vast majority of the descriptive text in a specification Plain text blue Any plain text that is underlined and in blue indicates an active link to the cross reference Click on the word to follow the hyperlink Bold In text a Bold typeface identifies a processor register name In other instances a Bold typeface can be used as a running head within a paragraph Italic In text an Italic typeface can be used as emphasis to introduce a new term or to indicate a manual or specification name BOLD Monospace Computer code example code segments and all prototype code segments use a BOLD Monospace typeface with a dark red color These code listings normally appear in one or more separate paragraphs though words or segments can also be embedded in a normal text paragraph Bold Monospace Words ina Bold Monospace typeface that is underlined and in blue indicate an act
126. odulePkg Universal HiiDatabaseDxe HiiDatabaseDxe inf Nt32Pkg WinNtThunkDxe WinNtThunkDxe inf Nt32Pkg CpuRuntimeDxe CpuRuntimeDxe inf IntelFrameworkModulePkg Universal BdsDxe BdsDxe inf MdeModUni FaultTolerantWriteDxe FaultTolerantWriteDxe inf Nt32Pkg MiscSubClassPlatformDxe MiscSubClassPlatformDxe inf Nt32Pkg TimerDxe TimerDxe inf December 2014 Version 1 24 EDK II FDF File Spec Nt32Pkg Flash Description File DEFINE RSCR_RD ReportStatusCodeRouter RuntimeDxe INF MdeModUni RSCR_RD ReportStatusCodeRouterRuntimeDxe inf DEFINE SCH_RD StatusCodeHandler RuntimeDxe INF MdeModUni SCH_RD StatusCodeHandlerRuntimeDxe inf DEFINE NTWINNTOEMHOOK Nt32Pkg WinNtOemHookStatusCodeHandlerDxe INF NTWINNTOEMHOOK WinNtOemHookStatusCodeHandlerDxe inf INF MdeModulePkg Universal Variable RuntimeDxe VariableRuntimeDxe inf INF MdeModulePkg Universal WatchdogTimerDxe WatchdogTimer inf DEFINE MCRD MonotonicCounterRuntimeDxe INF MdeModUni MCRD MonotonicCounterRuntimeDxe inf INF MdeModulePkg Universal CapsuleRunt imeDxe CapsuleRuntimeDxe inf INF MdeModulePkg Universal Console ConPlatformDxe ConPlatformDxe inf INF MdeModulePkg Universal Console ConSplitterDxe ConSplitterDxe inf INF MdeModUni Console GraphicsConsoleDxe GraphicsConsoleDxe inf INF MdeModulePkg Universal Console TerminalDxe TerminalDxe inf INF MdeModulePkg Universal DevicePathDxe DevicePathDxe inf INF MdeModulePkg Universal Disk DiskIoDxe Disk
127. on must be specified To specify additional section information for a file the EFI Encapsulation Sections must be contained within curly braces that follow the FILE line while leaf sections are denoted by an EFI SECTION type keyword Encapsulation and leaf section types are described below Caution If a fully qualified path and filename are specified the platform integrator must ensure that all developers using the DSC and FDF file are aware of the requirements for this path The following is an example for using additional sections 1 The EDK II build system does not support creation of COMBO PEIM DRIVER FV type Version 1 24 December 2014 33 FDF Design Discussion EDK II FDF File Spec Encapsulation Compress FILE FOO 12345678 0000 AAAA FFFF 0123ABCD12BD SECTION COMPRESS SECTION PE32 WORKSPACE EdkModulePkg Core Dxe DxeMain inf SECTION VERSION 1 2 3 Encapsulation GUIDED FILE FV_IMAGE 87654321 FFFF BBBB 2222 9874561230AB SECTION GUIDED gEfiTianoCompressionScheme SECTION PE32 WORKSPACE EdkModulePkg Core Dxe DxeMain inf LEAF Section FILE DXE CORE B5596C75 37A2 4b69 B40B 72ABD6DD8708 SECTION VERSION BUILD DIR ARCH D6A2CB7F 6A18 4E2F B43B 9920A733700A DxeMain ver 2 4 6 1 EFI Encapsulation Sections 34 There are two types of encapsulation sections a COMPRESSION section and the GUIDED section The DISPOSABLE encapsulation section is not su
128. on to any item the comment must start with a hash character e All comments terminate with the end of line character e Field separators for lines that contain more than one field are pipe characters This character was selected to reduce the possibility of having the field separator character appear in a string such as a filename or text string Note The only notable exception is the PcdName which is a combination of the PcdTokenSpaceGuidCName and the PcdCName that are separated by the period character This notation for a PCD name is used to uniquely identify the PCD e A line terminates with either an end of line character sequence or a comment e When processing numeric values either integer or hex leading zeros specified in the entry may be ignored For example 0x00000000000000000000001 can bea valid value for a UINTS data type as the actual value is 1 3 1 1 Line Extension Backslash The backslash character in this document is only for lines that cannot be displayed within the margins of this document The backslash character must not be used to extend a line over multiple lines in the FDF file Version 1 24 December 2014 41 EDK Il FDF File Format EDK II FDF File Spec 3 1 2 Whitespace characters Whitespace space and tab characters are permitted between token and field separator elements for all entries Whitespace characters are not permitted between the PcdTokenSpaceGuidCName and the dot nor are t
129. oned data containing one or more other sections PEIM Dispatched by PEI Core DRIVER Dispatched by DXE core COMBO PEIM DRIVER Combined PEIM DXE driver containing PEI and DXE depex sections as well as PE32 and version sections SMM CORE Sectioned data containing one or more other sections DXE SMM DRIVER Dispatched by the SMM Core APPLICATION Application so will not be dispatched FV_IMAGE File contains an FV image DISPOSABLE This section type is not supported by the EDK II build system 0x00 OxFF Hex values are legal too See PI specification Volume 3 for details NAMED GUID The NAMED GUID is usually constructed from an INF file s Defines section FILE GUID element Options The Fixed and Checksum attributes are boolean flags both default to FALSE specifying Fixed enables the flag to TRUE The Alignment attribute requires the value Fixed File can not be moved default not specified is relocate able Alignment Data value is one of 1 2 4 8 16 32 64 128 512 1K 2K 4K 8K 16K 32K 64K byte aligned Checksum It is recommended that this be controlled on an entire FV basis not at the file level however we are including this attribute for completeness UEFI and PI Specifications have rules for file type construction that by default will be used by the tools In addition to the arguments on the FILE line for EFI FV File types that are not RAw additional EFI section informati
130. ongNum gt lt UINT32 gt lt LongLongNum gt lt UINT64 gt BASE SEC PEI CORE PEIM DXE_CORE DXE DRIVER SMM CORE DXE RUNTIME DRIVER DXE SAL DRIVER DXE SMM DRIVER UEFI DRIVER UEFI APPLICATION USER_DEFINED lt ModuleType gt lt ModuleType gt lt TS gt lt MACROVAL gt lt PcdName gt lt TS gt lt TargetExpress gt lt ArchExpress gt lt ToolExpress gt lt UnaryOperator gt lt MTS gt lt MTS gt lt NotOp gt IN in lt MTS gt A Z A Z0 9 lt InOp gt TARGET lt DblQuote gt lt Arch gt lt DblQuote gt lt InOp gt Version 1 24 EDK II FDF File Spec lt Arch gt lt ToolExpress gt lt Boolean gt lt EOL gt lt OA gt lt arch gt lt FvAlignmentValues gt lt FfsAlignmentValues gt Note When using the characters or open and close parenthesis EDK II FDF File Format ARCH IA32 xe4 IPF EBC lt OA gt A Z a zA Z0 9 lt InOp gt TOOL CHAIN TAG lt BoolType gt lt Expression gt lt TS gt 0x0D 0x0A a zA Z a zA 20 9 TA32 x64 IPF EBC lt OA gt common u11 2 ran 8 16 32 64 128 256 55121 1K 2K 4K 8k 16K 32K 64K 128K 256K 512K 1m 2m rame 8M 16M 32M 64M 128M 256M 512M ian 2G Anko ee
131. only supported by Microsoft and Intel Windows based tools a separate INF file to support the multiple tool chain capability of the EDK II build system must be provided for the modules that contain assembly code The EDK II ECP will use the basename_edk2 inf for the filename of the EDK II build system compatible INF files for non Windows based tool chains and use just the basename inf for the filename of EDK only INF files used by the EDK build system 3 2 FDF Definition The FDF definitions define the final properties for a flash image PCD settings in this file override any other PCD settings that may have been set in the platform description DSC file Summary The EDK II Flash Description FDF file has the following format using the EBNF 42 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format lt EDK II FDF gt lt Header gt lt Defines gt lt FD gt lt FV gt lt Capsule gt lt VIF gt lt Rules gt lt OptionRom gt lt UserExtensions gt Note Assignments set as command line arguments to the parsing tools take precedence over all assignments defined in the FDF file If a variable value assignment is specified on the build tool s command line that value will override any variable value assignment defined in the FDF file Note Conditional statements may be used anywhere within the FDF file with the ability to group any item within a section as well as entire sections Note The
132. owards the lower address F First VTF File N Not in VTF File S Second VTF File Type Component Type Predefined values are 0x00 FIT Header entry 0x01 PAL B 0x02 0x0E Reserved OxOF PAL A 0x10 0x7E OEM defined 0x7F Unused Version XX major version number decimal number YY minor version number decimal number Component Version number XX YY Checksum_Flag 0 1 Checksum Flag equivalent to CV bit Checksum Byte always equals 0 CV 0 calculate Checksum Byte CV 1 Checksum Byte sum of component Checksum Byte modulus 0x100 Path_of Binary File Path of the Binary file of the component Path_of_SYM File Path of the SYM symbol file of the component Preferred Size User preferred component size overrides actual component file size Valid is equal Version 1 24 or greater than the actual file size December 2014 range of 0 to 99 range of 0 to 99 95 EDK II FDF File Format EDK II FDF File Spec Prototype lt VTF gt iz VTF lt Modifiers gt lt EOL gt lt OptionStatement gt lt ComponentStatements gt lt Modifiers gt lt arch gt lt UiName gt lt ArchList gt lt ArchList gt f Ny lt Archs lt Arch gt IA32 X64 IPF lt UiName gt Words lt OptionStatement gt lt TS gt IA32 RST BIN lt Eq gt lt Filename gt lt EOL gt lt ComponentStatements gt lt TS gt COMP NAME lt Eq gt lt WORD gt
133. parated by a period character PCD C names are used in C code and must follow the C variable name rules A PCD s values are positional with in the FDF file and may be set by either the automatic setting grammar defined in this specification or through SET statements Once the PCD s value has been defined it may be used anywhere within the FDF file they are not limited to sections that they are defined in PCD values may be absolute values defined by macros or expressions Refer to the EDK II Build Specification section 8 4 1 for PCD processing rules 2 2 8 Conditional Statements lif 20 Conditional statements are used by the build tools preprocessor function to include or exclude statements in the FDF file Most section definitions in the EDK II meta data files have architecture modifiers in the section tags Use of architectural modifiers in the section tag is the recommended method for specifying architectural differences Some sections do not have architectural modifiers and there are some unique cases where having a method for specifying architectural specific items would be valuable hence the ability to use these values Statements are prefixed by the exclamation character Conditional statements may appear anywhere within the FDF file December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Note A limited number of statements are supported This specification does not support every condition
134. pec 2 2 2 Comments The hash character indicates comments in the FDF file In line comments terminate the processing of a line In line comments must be placed at the end of the line Only BsBaseAddress 0x0000C1000 in the following example is processed by tools the remainder of the line is ignored BsBaseAddress 0x0000C100 set boot driver base address Note Blank lines and lines that start with the hash character must be ignored by tools Hash characters appearing within a quoted string are permitted with the string being processed as a single entity The following example must handle the quoted string as single element by tools UI Copyright 2007 NoSuch LTD All rights reserved Comments are terminated by the end of line If a hash character is required in a value field the value field must be encapsulated by double quotation marks 2 2 3 Valid Entries Processing of a line is terminated by the end of the line Processing of the line is also terminated if a comment is encountered Items in quotation marks are treated as a single token and have the highest precedence Items encapsulated in parenthesis are also treated as tokens with embedded tokens being processed first All other processing occurs from left to right In the following example B C is processed first then result is added to A followed by adding 2 finally 3 is added to the result A B C 2 3 In the next example A B
135. pported by the EDK II build system The COMPRESS encapsulation section uses the following format SECTION COMPRESS type SECTION EFI SECTION TYPE SECTION EFI SECTION TYPE FILENAME String The type argument is optional only EFI STANDARD COMPRESSION is supported by the PI specification The current EDK enumerations for compression are a violation of the PI specification and SECTION GUIDED must be used instead The EFI_SECTION TYPE and FILENAME are required sub elements within the compression encapsulation section for most sections However both the VERSION EFI SECTION VERSION and UI EFI SECTION USER INTEFACE may specify a string that will be used to create an EFI section The GUIDED encapsulation section uses one of the following formats SECTION GUIDED GUID CNAME auth SECTION EFI SECTION TYPE FILENAME SECTION EFI SECTION TYPE string SECTION GUIDED GUID CNAME auth FILENAME The required argument is the GUIDED name followed by an optional auth flag If the argument auth flag is specified then the attribute EFI GUIDED SECTION AUTH STATUS VALID must be set For non scoped statements the second SECTION statement of the two listed above if December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion filename exists the Attribute EFI GUIDED SECTION PROCESSING REQUIRED must be set to TRUE The file pointed to by filename is the data If filename does not exist EFI GUIDED SE
136. r executable tool MACRO values that appear in quoted strings in CFlags content must not be expanded by parsing tools OA Other Architecture One or more user defined target architectures such as ARM or PPC The architectures listed here must have a corresponding entry in the EDK II meta data file Conf tools_def txt Only IA32 X64 IPF and EBC are routinely validated FileSep FileSep refers to either the back slash or forward slash characters that are used to separate directory names All EDK II FDF files must use the forward slash character when specifying the directory portion of a filename Microsoft operating systems that normally use a back slash character for separating directory names will interpret the forward slash character correctly TokenSpaceGuidCName A word that is a valid C variable that specifies the name space for a particular PCD PcdCName A word that is a valid C variable that specifies the name of the token number which a member of the name space specified by the TokenSpaceGuidCName CArray All C data arrays used in PCD value fields must be byte arrays The C format GUID style is a special case that is permitted in some fields that use the lt CArray gt nomenclature EOL The DOS End Of Line 0x0D 0x0A character sequence must be used for all EDK II meta data files All Nix based tools can properly process the DOS EOL characters Microsoft based tools cannot process the Nix style EOL character
137. ruDxe inf 3 11 UserExtensions Sections This is an optional section Summary The UserExtensions sections which are build specific may be used in the FDF file This permits definition of custom image creation steps file formats or build rules The EDK II build system command GenFds will generate a warning message if this section is present The user must have a priori knowledge of any processing involved for this content Conditional statements may be used anywhere within this section Version 1 24 December 2014 99 EDK Il FDF File Format EDK II FDF File Spec Prototype lt UserExtension gt UserExtensions lt UserUnique gt lt EOL gt lt Statements gt lt UserUnique gt lt UserId gt lt Identifier gt lt attr gt lt UserId gt lt Word gt lt ReservedUserId gt lt ReservedUserId gt TianoCore lt Identifier gt siz lt Word gt lt QuotedString gt lt ReservedId gt lt ReservedId gt PRE PROCESS POST PROCESS lt attr gt i e T T lt archs lt Statements gt lt AsciiString gt lt EOL gt Parameters Statements Content is user defined and unique for any given UserId Identifier pair 100 December 2014 Version 1 24 EDK II FDF File Spec Appendix A Nt32Pkg Flash Description File This section provides a sample FDF using the Nt32Pkg Nt32Pkg fdf file Version 1 24 December 2014 103 Nt32Pkg Flash Description File EDK II FDF File Spec Note
138. s 3 2 2 MACRO Statements 50 Use of MACRO statements is optional Summary Macro statements are characterize by a DEFINE line or may be defined on a command line of a parsing tool Define statements are processed according to the following precedence Highest Priority 1 Command line option D MACRO Value 2 Most Recent in file 3 Macros defined in the FDF file s Defines section 4 Macros defined in the DSC file s Defines section Lowest Priority If the Macro statement is within the Defines section then the Macro is common to the entire file with local definitions taking precedence if the same MACRO name is used in subsequent sections then the MACRO value is local to only that section December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format Macro statements may not be referenced before they are defined Macros may be inherited from the DSC file specifying this FDF file All content for a macro statement must appear on a single line If the tools encounter a MacroVal as in MACRO that is not defined the build tools must break Prototype lt MacroDefinition gt lt TS gt DEFINE lt MTS gt lt MACRO gt lt Eq gt lt VALUE gt lt EOL gt lt VALUE gt lt Number gt lt BoolType gt lt CFormatGUID gt lt PATH gt lt CString gt lt UnicodeString gt lt CArray gt lt Expression gt lt CFlags gt lt Filename gt Restrictions System Environment
139. s 1161 732 4 eae za 512 1K 4K 32K 64K in an expression the expression must be encapsulated in Note Comments may appear anywhere within a FDF file provided they follow the rules that a comment may not be enclosed within Section headers and that in line comments must appear at the end of a statement Parameter Definitions Expression Refer to the EDK II Expression Syntax Specification for more information UnicodeString When the lt UnicodeString gt element these characters are string literals as defined by the C99 specification L string not actual Unicode characters is included in a value the build tools may be required to expand the ASCII string between the quotation marks into a valid UCS 2LE encoded string The build tools parser must treat all content between the field separators excluding white space characters around the field separators as ASCII literal content when generating the AutoGen c and AutoGen h files Comments Strings that appear in comments may be ignored by the build tools An ASCII string matching the format of the ASCII string defined by lt UnicodeString gt L Foo for example that appears in a comment must never be expanded by any tool Version 1 24 December 2014 49 EDK Il FDF File Format EDK II FDF File Spec CFlags CFlags refers to a string of valid arguments appended to the command line of any third party or provided tool It is not limited to just a compile
140. sAlignment gt lt SecData gt lt LeafSecType gt lt MTS gt lt ChkReloc gt lt MTS gt lt SectionOrFile gt COMPAT16 PE32 PIC TE RAW FV IMAGE DXE_DEPEX SMM DEPEX UI PEI DEPEX VERSION lt TS gt SECTION lt MTS gt lt FfsAlignment gt lt STG Data gt SUBTYPE GUID lt MTS gt lt GuidValue gt lt Eq gt lt NormalFile gt lt EOL gt if LeafSectionType PE32 LeafSectionType TE amp amp MODULE TYPE SEC MODULE TYPE PEI CORE MODULE TYPE PEIM lt RelocFlags gt lt Eq gt lt NormalFile gt lt EOL gt lt EncapSec gt lt TS gt SECTION lt MTS gt lt FfsAlignment gt lt EncapSection gt lt EOL gt lt CompressSection gt lt GuidedSection gt lt TS gt COMPRESS lt MTS gt lt CompType gt lt EOL gt lt EncapSec gt lt LeafSections gt lt TS gt lt EOL gt PI_STD PI_NONE lt MTS gt GUIDED lt MTS gt lt NamedGuid gt lt MTS gt lt GuidedOptions gt lt EOL gt lt EncapSec gt lt LeafSections gt lt TS gt lt EOL gt lt GuidAttrPr gt lt GuidAttrASV gt lt GuidHeaderSize gt PROCESSING REQUIRED lt Eq gt lt TrueFalse gt lt MTS gt AUTH STATUS VALID lt Eq gt lt TrueFalse gt lt MTS gt December 2014 Version 1 24 EDK II FDF File Spec lt GuidHeaderSize gt lt DepexExpSection gt lt Depex gt lt PeiDepexE
141. sign Discussion EDK II FDF File Spec Macro must be defined in either the DSC file or the FDF file and must be defined before they can be used Macro values specified on the command line over ride all definitions of that Macro The EDK_GLOBAL macros can only be defined in the DSC file however they are considered global during the processing of the DSC FDF and EDK INF files Global variables that may be used in this file are listed in the Well known Macro Statements table while the format of the System Environment variables that may be used in EDK II DSC and FDF files are in the next table Table 2 Well known Macro Statements Exact Notation Derivation WORKSPACE System Environment Variable EDK SOURCE System Environment Variable EFI SOURCE System Environment Variable EDK TOOLS PATH System Environment Variable ECP SOURCE System Environment Variable OUTPUT DIRECTORY Tool parsing from either the DSC file or via a command line option This is typically the Build Platform name directory created by the build system in the EDK II WORKSPACE BUILD NUMBER Tool parsing from either an EDK INF file or the EDK II DSC file s BUILD NUMBER statement The EDK II DSC file s BUILD NUMBER takes precedence over an EDK INF file s BUILD NUMBER if and only if the EDK II DSC specifies a BUILD NUMBER Future implementation may allow for setting the BUILD NUMBER variable on the build tool s command li
142. stances may or may not have a DEPEX section Modules that use DXE RUNTIME DRIVER as the MODULE TYPE require a DEPEX section if and only if they are pure DXE Runtime drivers VEFI Runtime Drivers that use the DXE RUNTIME DRIVER MODULE TYPE must not have a DEPEX section If a library instance is required by a module that prohibits depex sections the libraries depex section is ignored For modules that do require a depex section the depex section of all dependent libraries is AND ed with the depex section of the module Expression Refer to the EDK II Expression Syntax Specification for more information Paths Unless otherwise specified all file specified paths are relative to the WORKSPACE directory In some cases the tools will search well known paths for some files for example for FD filenames the output will typically be located in the OUTPUT DIRECTORY TARGET TAGNAME FV directory COMPRESS Compression sections that use PI STD compression do not have PROCESSING REQUIRED TRUE flag it is only required for GUIDED sections 84 December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format User Interface UI entries There are three possible methods for specifying a User Interface string 1 Specify the string value in the FDF file 2 specify a plain ASCII text file that has an extension of ui or 3 specify a UCS 2LE encoded file with an extension of uni that contains a single Unicode string
143. t if MODULE TYPE SEC MODULE TYPE PEI CORE MODULE TYPE PEIM COMPONENT TYPE PEI CORE COMPONENT TYPE PIC PEIM COMPONENT TYPE RELOCATABLE PEIM COMPONENT TYPE SECURITY CORE COMPONENT TYPE PE32 PEIM lt TS gt FILE lt MTS gt lt FvTypel gt lt Eq gt lt FileStatement1 gt elif MODULE TYPE DXE CORE MODULE TYPE DXE DRIVER MODULE TYPE DXE SAL DRIVER MODULE TYPE SMM CORE MODULE TYPE DXE SMM DRIVER MODULE TYPE UEFI DRIVER MODULE TYPE UEFI APPLICATION MODULE TYPE USER DEFINED COMPONENT TYPE BS DRIVER COMPONENT TYPE COMBINED PEIM DRIVER COMPONENT TYPE APPLICATION lt FileStatement2 gt lt FileStatement3 gt Version 1 24 December 2014 87 EDK II FDF File Format 88 lt FileStatementl gt lt FileStatement2 gt lt FileStatement3 gt lt FileStatement4 gt lt NamedGuid gt lt Sym gt lt NamedGuidOrPcd gt lt GuidValue gt lt GuidCName gt lt GuidStructure gt lt FvTypel gt lt FvType2 gt lt RelocFlags gt lt Options gt lt UseLocal gt lt KeyString gt lt Target gt lt TagName gt lt ToolArch gt EDK II FDF File Spec elif MODULE TYPE FV_IMAGE lt FileStatement4 gt else lt TS gt FILE lt MTS gt NON FFS FILE lt Eq gt lt NamedGuid gt lt Options gt lt EOL gt lt NamedGuid gt lt RelocFlags gt lt MTS gt lt Options gt lt EOL gt
144. t into Firmware Volumes FVs and finally the FV sections are combined into one or more Flash Device binary image FD The following diagrams illustrate the process flow for generating the PE PE32 Coff files that will be used for Flash Image files Figure 1 EDK II Build Data Flow Module Makefiles Build Parser WF DSC File Autogen c Autogen h Genfds Parser The following diagram shows the overview of the process used to create final image files Library Makefiles December 2014 Version 1 24 EDK II FDF File Spec FDF Design Discussion Figure 2 EDK Il Create Image Flow Distributed PE Coff Binaries FD images DSC File FDF File Parsing amp Genf ds Tools Compiled PEiCoff Binaries It should be noted that some SEC PEI_CORE and or PEIM modules are coded XIP eXecute In Place running directly from ROM rather than from memory For modules that always execute from ROM the relocation reloc section of the PE32 image can be removed after running a fix up tool as a space saving technique Some PEIM modules may run from either ROM or from memory There are several methods that can be used to retain this information as well as the reloc sections of stripped images Due to this possibility the SEC PEI CORE and PEIM descriptions are different from the remaining module types The default for all SEC PEI CORE and PEIM modules is to strip the reloc sec
145. ta DATA Data lt KnownSection gt lt SubTypeGuid gt SECTION lt MTS gt lt FfsAlignment gt lt SecData gt lt LeafSecType gt lt ChkReloc gt lt SectionOrFile gt COMPAT16 PE32 pIc TE RAW FV_IMAGE DXE DEPEX SMM DEPEX UI PEI_DEPEX VERSION December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format lt SubTypeGuid gt lt TS gt SECTION lt MTS gt lt FfsAlignment gt lt SgData gt lt SgData gt SUBTYPE GUID lt MTS gt lt GuidValue gt lt Eq gt lt NormalFile gt lt EOL gt lt GuidValue gt lt GuidCName gt lt GuidStructure gt lt GuidCName gt lt CName gt lt GuidStructure gt lt RegistryFormatGUID gt lt CFormatGUID gt lt ChkReloc gt if LeafSecType PE32 LeafSecType TE amp amp MODULE TYPE SEC MODULE TYPE PEI CORE MODULE TYPE PEIM lt RelocFlags gt lt SectionOrFile gt lt Eq gt lt NormalFile gt lt EOL gt lt EncapSec gt lt EncapSec gt SECTION lt MTS gt lt FfsAlignment gt lt EncapSection gt lt EncapSection gt lt CompressSection gt lt GuidedSection gt lt CompressSection gt COMPRESS lt MTS gt lt CompType gt lt EOL gt lt MacroDefinition gt lt PeiAprioriSection gt lt DxeAprioriSection gt lt EncapSec gt lt LeafSections gt lt TS gt lt EOL gt lt CompType gt
146. ted Definitions Note that no space characters are permitted on the left side of the expression before the equal sign Target This value must match a target identifier in the EDK II too s def txt file the first field where fields are separated by the underscore character Wildcard characters are not permitted TagName This must match a tag name field in the EDK II tools def txt file second field Wildcard characters are not permitted Version 1 24 December 2014 73 EDK II FDF File Format EDK II FDF File Spec 74 Example Fv Root FvAlignment 64 ERASE POLARITY 1 MEMORY MAPPED TRUE STICKY WRITE TRUE LOCK CAP TRUE LOCK STATUS TRUE WRITE DISABLED CAP TRUE WRITE ENABLED CAP TRUE WRITE STATUS TRUE WRITE LOCK CAP TRUE WRITE LOCK STATUS TRUE READ DISABLED CAP TRUE READ ENABLED CAP TRUE READ STATUS TRUE READ LOCK CAP TRUE READ LOCK STATUS TRUE INF VERSION 1 WORKSPACE EdkNt32Pkg Dxe WinNtThunk Cpu Cpu inf FILE DXE CORE B5596C75 37A2 4b69 B40B 72ABD6DD8708 SECTION COMPRESS DEFINE DC WORKSPACE Build Nt32 DEBUG IA32 SECTION PE32 DC B5596C75 37A2 4b69 B40B 72ABD6DD8708 DxeCore efi SECTION VERSION 1 2 3 FILE FREEFORM 85C3EBE1 F58F 4820 8AD3 F2FB62DC3A23 FvAlignment 512K SECTION SUBTYPE GUID AFC13561 9A65 4754 9C93 E133B3B8767C WORKSPACE MyPackage MyNewType Binary newform bin FILE FV IMAGE EF41A0E1 40B1 481f 958E 6FB4D9B12E76 FvAlignm
147. ternatives and super subscripts indicating between n and m occurrences EDK Extensible Firmware Interface Development Kit the original implementation of the Intel Platform Innovation Framework for EFI Specifications developed in 2007 EDK II EFI Development Kit version II that provides updated firmware module layouts and custom tools superseding the original EDK EDK Compatibility Package ECP The EDK Compatibility Package ECP provides libraries that will permit using most existing EDK drivers with the EDK II build environment and EDK II platforms EFI Generic term that refers to one of the versions of the EFI specification EFI 1 02 EFI 1 10or any of the UEFI specifications FDF EDK II Flash definition file This file is used to define the content and binary image layouts for firmware images update capsules and PCI option ROMs Version 1 24 December 2014 3 Introduction EDK II FDF File Spec FLASH This term is used throughout this document to describe one of the following e An image that is loaded into a hardware device on a platform traditional ROM image e An image that is loaded into an Option ROM device on an add in card e A bootable image that is installed on removable bootable media such as a Floppy CD ROM or USB storage device e An image that is contains update information that will be processed by OS Runtime services to interact with EFI Runtime services to update a traditional ROM image e A UEFI appli
148. the exact content of an item as they must appear in the output text file The guestion mark denotes zero or one occurrence of an item The star character denotes zero or more occurrences of an item The plus character denotes one or more occurrences of an item itemtn A superscript number n is the number occurrences of the item that must be used Example 0 9 indicates that there must be exactly item rn eight digits so 01234567 is valid while 1234567 is not valid A superscript number n within curly braces followed by a comma indicates the minimum number of occurrences of the item with no maximum number of occurrences item tn A superscript number n within curly brackets preceded by a comma vor indicates a maximum number of occurrences of the item item nm un A super script number n followed by a comma and a number m indicates that the number of occurrences can be from n to m occurrences of the item inclusive December 2014 Version 1 24 EDK II FDF File Spec 2 FDF Design Discussion This section of the document provides an overview to processing Flash Description File FDF used to create firmware images Option ROM images or bootable images for removable media For the purposes of this design discussion the FDF file will be referred to as FlashMap fdf By convention the name FlashMap fdf has been used for the flash description fi
149. tion The modules coded to use REGISTER FOR SHADOW must not have the reloc section stripped Also of note not all of the INF files listed in the FDF file need to be listed in the DSC file Since the DSC file is primarily used to generate Makefiles for a build binary only modules do not need to be listed in a DSC file and can be listed in the FDF file 2 1 1 Platform Configuration Database PCD Settings The FD FV and Capsule sections and nested sections permit setting PCD default values All PCDs must be declared in a DEC file in order to be used It is recommended that the PCDs set in the FDF file be for Addresses Sizes and or other fixed information needed to define or create the flash image Use of PCDs is permitted in the FDF file The Dynamic and DynamicEx PCDs can be accessed or modified during execution as result they cannot be set within the FDF file Note The PCD values set in this file are assumed to be correct on all conditions that the reset vector in SEC is executed such as power on reset and ACPI S3 resume Use of the PatchablelnModule PCD access type for base addresses is permitted but when this PCD type is used module implementations must always access the values through the PcdGet and PcdSet operations to guarantee that stale base address values are never used All FLASH related PCD settings MUST be set in the FDF file not in the platform description DSC file The FDF file has the final values for Flash Rel
150. ts sarsan iile a ee een beya 13 22 3 Valld Entries nina 13 2 2 4 Naming Convenlionsae kennen 14 2 25lincludeStatemenis A gt A gt A gt A gt A gt A gt gt A gt m m m nen eennenne enen enne nennen een 15 2 2 6 Macro Statements nnee nennen eeen enee eenn enen m 15 2 2 AP CDINAMES mmm nm mn m ee 20 2 2 8 Conditional Statements ll aaa ne 20 2 2 S EXPIESSIONS rn e maa mal m N SA teha M D EE 22 PACH DRS 1e let CEE 24 2 3 1 FD TOKEN Statements mmm 24 2 3 2 FD DEFINE statements Mmmmmmmememeiee ennen 25 2 33 FD SET statements ne nina ke 25 2 3 4 FD Region Layout a a ed ee asi aaa ala nn 26 2 4 FV Sections ae ee nen 28 2 4 1 DEFINE Statements nnee nennen venten eeen vennen ennen ennn ennen enen 29 2 4 2 Block Statements nennen nennen enen eeen eeen eneen nennen ennn eenen ennn 29 2 4 3 FV SET Statements nennen eneen eenenen ennn eenenen eeen vennenen enen vennen 29 2 4 4 APRIORI Scoping u anna kds het pala a 30 245INFStatements eeen ven enen enen a eenen ennn 31 2 4 6 FILE Statements nnee eneen enen enen nenn vennen ensen ennen ennen 32 2 Capsulel SSCHONS eieren nerede dt Rene el elli 35 25 1UEFiimplementatioen AAAAAmmedl m m m 36 2 5 2 Capsule SET Statemenis nn 36 2 5 3 Capsule Data ini 36 2 6 V IF Sections aaa ee 37 2 6 1 Options Statement neee eenen enen
151. ture modifier If a common section contains filenames that have directories with architecture modifiers the file will be processed for all architectures not just the architecture specified in the directory name Space Characters in filenames The build tools must be able to process the tool definitions file tools_def txt describing the location and flags for compiler and user defined tools which may contain space characters in paths on Windows systems The tools_def txt file is the only file the permits the use of space characters in the directory name The EDK II Coding Style specification covers naming conventions for use within C Code files and as well as specifying the rules for directory and file names This section is meant to highlight those rules as they apply to the content of the FDF files Architecture keywords IA32 IPF X64 and EBC are used by build tools and in meta data files for describing alternate threads for processing of files These keywords must not be used for describing directory paths Additionally directory names with architectural names 1a32 Ipf X64 and Ebc do not automatically cause the build tools or meta data files to follow these alternate paths Directories and Architectural Keywords are similar in name only For clarity this specification will use all upper case letters when describing architectural keywords and the directory names with only the first letter in upper case All directory paths wit
152. ues must appear on the next line and must also be separated by the field separator character e Specific tokens assigned to values within the FD sections can have a PCD automatically assign the same value by placing a field separator character between the value and PCD name The PCD name must always follow the value field separator character sequence e Other PCDs may be assigned using the SET statement in the FDF file e PCD Values assigned in this file using SET PcdName value override values assigned in the DSC file or if a value is not specified in the DSC then they will override values assigned in an INF file or if a value is not specified in the DSC or the INF then they will override values assigned in the DEC file e Dynamic and DynamicEx PCDs cannot be set in the FDF file 2 2 Flash Description File Format The EDK II FDF file describes the layout of UEFI PI compliant binary images located within hardware removable media or update capsules The binary files must already exist in order for the build tools to create the final images Some content such as PCD definitions may be used during the creation of binary files 2 2 1 Section Entries To simplify parsing the EDK II meta data files continue using the INI format This style was introduced for EDK meta data files when only the Windows tool chains were supported It was decided that for compatibility purposes that INI format would continue to be used EDK II formats di
153. ulation Platform Pseudo Flash Part The Emulation Platform can be used to debug individual modules prior to creating a real platform This also provides an example for how to create an FDF file Copyright c 2006 2008 NoSuch 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 3 4 Defines Section This is an optional section This section if present must be the first section following comment blocks at the beginning of the file Summary This section describes the defines section content in the FDF files This file can be created by a developer and is an input to the EDK II build tool parsing utilities Elements may appear in any order within this section The code for this version of the FDF specification is 0x00010018 and new versions of this specification must increment the minor 0018 portion of the specification code for backward compatible changes and increment the major number for non backward compatible specification changes Conditional statements may be used anywhere within this section 58 December 2014 Version 1 24 EDK II FDF
154. uld have to be a UINT32 representing the TypeMask Additional types defined by the PI spec will be supported in this manner as well The build system permits a recovery feature that allows placing two copies of a PEI fv in the flash top If the top one is corrupt backup one will be swapped to the top and work The backup must be the same as the top PEI fv although it is placed into another place Therefore the backup FV must be rebased to run at another address The FvBaseAddress and the optional FvForceRebase attributes must be above FvAlignment attribute 2 4 1 DEFINE Statements DEFINE statements are used to define Macro definitions that are scoped to the individual Fv sections DEFINE statements are processed in order so a later DEFINE statement for a given MACRO over writes the previous definition for the remainder of the section or sub section The DEFINE statements are typically used for creating short cut names for directory path names but may be used for identifying other items or values that will be used in later statements DEFINE MACRO VALUE The following are examples of the DEFINE statement DEFINE EDKMOD WORKSPACE EdkModulePkg DEFINE MDE MOD TSPG gEfiMdeModulePkgTokenSpaceGuid DEFINE NV_STOR VAR SIZE PcdFlashNvStorageVariableSize DEFINE FV_HDR SIZE 0x48 DEFINE VAR STORE SIZE MDE MOD TSPG NV_STOR VAR SIZE FV_HDR SIZE 2 4 2 Block Statements BLOCK_ statements are used to define block size a
155. urned into a system s flash or an Update Capsule image that will be used to update and existing system flash Multiple FD sections can be defined in a FDF file The section header format is FD FdUiName where the FdUiName can be any value defined by the user If only a single FD is constructed for a platform then FduiName is optional and the processing tools will use the DSC file Defines section s PLATFORM NAME value for creating the FD file An FD section is terminated by any other section header section or the end of the file This section is required for platform images and not required for OptionROM images 2 3 1 FD TOKEN Statements The Token statements are used to define the physical part These include the base address of the image the size of the image the erase polarity and block information Only one of each of the valid token names can be defined in any one FD section except as noted below Token VALUE PcdName Only one token statement can appear on a single line and each token statement must be on a single line Multi line token statements are not permitted There are five valid Token names defined by this specification BaseAddress The base address of the FLASH Device Size The size in bytes of the FLASH Device ErasePolarity Either 0 or 1 depending on the erase polarity of the Flash Device BlockSize One or More Size of a block optionally followed by number of blocks Multiple BlockSize statements are leg
156. ust immediately follow the FvBaseAddress Parameters FvBaseAddress A UINT64 value that will be used to rebase the code to run at a different address than the address specified by the location of the FV in the FD section SUBTYPE GUID This is short hand notation refering to content that will be placed in a Section of type EFI_LSECTION_FREEFORM_SUBTYPE_GUID A single EFI SECTION FREEFORM SUBTYPE GUID section is permitted in an FFS File of type EFI FV FILETYPE FREEFORM GuidCName A word that is a valid C variable for a GUID Expression Refer to the EDK II Expression Syntax Specification for more information COMPRESS Compression sections that use PI_STD compression do not have PROCESSING REQUIRED TRUE flag it is only required for GUIDED sections December 2014 Version 1 24 EDK II FDF File Spec EDK II FDF File Format User Interface UI entries There are three possible methods for specifying a User Interface string 1 Specify the string value in the FDF file 2 specify a ASCII plain text file that has an extension of ui or 3 specify a UCS 2LE encoded file with an extension of uni that contains a single Unicode string Paths Unless otherwise noted all file paths are relative to the WORKSPACE directory In some cases the tools will search well known paths for some files for example for FD filenames the output will typically be located in the OUTPUT_DIRECTORY TARGET _ TAGNAME FV directory Rela
157. where they are defined It is recommended that tools break the build and report an error if an expression cannot be evaluated Any defined MACRO definitions will be expanded by tools when they encounter the entry in the section except when the macro is within double quotation marks in build options sections The expectation is that macros in the quoted values will be expanded by external build scripting tools such as nmake or gmake they will not be expanded by the build tools If a macro that is not defined is used in locations that are not expressions where the tools would just do macro expansion as in path names in an INF statement in the Fv section nothing will be emitted If the macro MACROJ has not been defined then INF MACRO1 GraphicsDriver inf After macro expansion the logical result would be equal to INF GraphicsDriver inf It is recommended that tools remove any excess space characters when processing these types of lines Additionally pre defined global variables may be used in the body of the FDF file The following is an example of using pre defined variables FILE OUTPUT DIRECTORY TARGET TOOL CHAIN TAG FV Microcode bin The following table lists the global variables permitted in generating a path statement as well as variables that can be passed as an argument for a rule Macro statements defined the FDF file are local to the file Macro names used in values Version 1 24 December 2014 17 FDF De
158. xp gt lt PeiDepex gt lt BoolStmt gt lt Bool gt lt GuidCName gt lt BoolExpress gt lt Not gt lt OP gt lt DepInstruct gt Version 1 24 EDK II FDF File Format EXTRA HEADER SIZE lt Eq gt lt Number gt lt MTS gt if COMPONENT TYPE LIBRARY LIBRARY CLASS is declared in defines section of the INF MODULE TYPE USER DEFINED lt Depex gt else if MODULE TYPE PEIM MODULE TYPE MODULE TYPE MODULE TYPE MODULE TYPE lt Depex gt else if MODULE TYPE amp amp MODULE TYPE DXE DRIVER DXE RUNTIME DRIVER DXE SAL DRIVER DXE SMM DRIVER UEFI APPLICATION UEFI DRIVER amp amp MODULE TYPE PEI CORE amp amp MODULE TYPE DXE CORE amp amp MODULE TYPE SMM CORE amp amp MODULE TYPE SEC No DEPEX section is permitted if MODULE TYPE PEIM lt PeiDepexExp gt else if MODULE TYPE DXE SMM DRIVER lt SmmDepexExp gt lt DxeDepexExp gt else lt DxeDepexExp gt lt TS gt SECTION lt MTS gt lt F fsAlignment gt PEI DEPEX EXP lt Eq gt lt EOL gt lt PeiDepex gt lt EOL gt lt TS gt lt BoolStmt gt lt EOL gt lt MTS gt lt TS gt lt DepInstruct gt lt EOL gt lt MTS gt lt TS gt end lt EOL gt lt MTS gt lt Bool gt lt BoolExpress gt lt GuidCName gt lt EOL gt lt MTS gt TRUE FALSE lt GuidCName gt lt CName gt A Guid C

Download Pdf Manuals

image

Related Search

Related Contents

Vuolas Electronics Oy Ltd.  Philips Portable DVD Player PD709  

Copyright © All rights reserved.
Failed to retrieve file