edk2中的fdf文件简介

edk2中的fdf文件简介fdf的全称叫做flashdevicefile,它用于描述固件在flash中的布局和位置,他可以分为几个部分[Defines],[FD],[FV],[Rule],本文主要介绍如下关键的3个部分:FDSection用于描述一个flashdevice,这个部分需要在起始的地方标注[FD]。###############################################…

大家好,欢迎来到IT知识分享网。edk2中的fdf文件简介"

fdf的全称叫做flash device file,它用于描述固件在flash中的布局和位置,他可以分为几个部分[Defines],[FD],[FV],[Rule],本文主要介绍如下关键的3个部分:

  • FD Section
    这个部分需要在起始的地方标注[FD.xxx],一个fdf文件中可以分为多个FD Section。
 ################################################################################
 #
 # 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.
 #
 ################################################################################



 [FD.QcomModule_EFI]
 BaseAddress   = 0x80200000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress  #The base address of the FLASH Device.
 Size          = 0x00024000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize         #The size in bytes of the FLASH Device
 ErasePolarity = 1
 BlockSize     = 0x200
 NumBlocks     = 0x120 
  • FD Region

每个FD的最后都会跟上该FD的区域布局,通过Region Type可以来表示存放在该FD中的内容类型,比如是FV还是DATA,或者是FILE。举例如下:

 ################################################################################
 #
 # 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.
 #
 # 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 <FV, DATA, or FILE>
 #
 ################################################################################

 # 512 bytes of configuration header & 8 bytes of image header
 0x00000000|0x00024000
 gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize
 FV = FVMAIN_COMPACT

这里的FV表示存放在该FD中的FV是什么,本例表示存放的是FVMAIN_COMPACT这个FV,它会在下面进行定义。

  • FV(Flash Volume)

该区域定义该FD的布局形势,其中包含很多inf文件,表示的是该FD包含的各个子模块,该区域需要在起始位置标注[FV]如下所示:

################################################################################
#
# 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.
#
################################################################################

[FV.FvMain]
BlockSize          = 0x40
NumBlocks          = 0         # This FV gets compressed so make it just big enough
FvAlignment        = 8         # FV alignment and FV attributes setting.
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
FvNameGuid         = 046fae99-cf2e-49ed-a6a8-a1488b7e80d3



INF QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf
 [FV.FVMAIN_COMPACT]
 FvAlignment        = 8
 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
 
   FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
     SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
       SECTION FV_IMAGE = FVMAIN
     }
   }
 

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/22456.html

(0)

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信