edk 2 的基本架构

edk 2 的基本架构写在最前,meta-datafile指的就是dsc,dec,inf,fdf文件。出自dscspec,thebuildtoolsuseEDKIImeta-datafiles(INF,DEC,DSCand,optionally,theFDF)tocreateMakefilesthatarethenprocessed…

大家好,欢迎来到IT知识分享网。

 

 

 

写在最前, meta-data file 指的就是dsc, dec , inf, fdf 文件。 出自dsc spec,

the build tools use EDK II meta-data files (INF, DEC, DSC and , optionally, the FDF) to create Makefiles that are

then processed by third party tools.

 

首先FDF 是Flash Description File 的缩写,用来创建 firmware images, option rom images 或者 bootable images .

为了这一节的讨论,我们还要参考FlashMap.fdf 文件,一般约定FlashMap.fdf 用来作为flash 描述文件(flash

description file). 一般建议用fdf 后缀作为flash 描述文件。

一般来讲, flash 描述文件是和dsc 文件放在同一个文件夹里面的。

在后续的章节里面我们用fdf 代替 Flash Description File.”

 

EDK II 编译生成符合 UEFI 和PI 规范的binary images。

注意: FDF文件里面路径以及文件名是大小写敏感的,因为它需要支持unix style 操作系统,

 

条件语句  Conditional Statements( !if…)

条件语句用来给编译工具的预处理函数决定包含还是不包含某个语句。

 

3.10  PCD Sections

The PCD sections are optional. optional 就是可有可无的。

PCD Values listed in the DSC file must be absolute values, macro names or expressions which may include

other PCD names and/or macro names that have been previously defined. While each PCD type has its own

section definition, it is possible for PCDs accessed using either the FixedAtBuild or PatchableInModule

methods to have different values for different modules.

 

It is not permitted to list a PCD in different type sections. A PCD can only be listed under one type. All

PCDs listed in these sections must be declared in a DEC file if the PCD is used in any modules listed in the

DSC or FDF file.

 

inf 描述一个module, dsc 描述一个platform, 如果在编译的时候,遇到error 4000: Instance of libray class [DxeServicesLib] is not found

 

edk 2 的基本架构

 

如果我在nt32pkg.dsc 里面将

edk 2 的基本架构

 

 

 

 

DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf

 

 

注释掉,然而DxeMain.inf 又要用到这个lib.

 

所以就会出现这个问题。

 

 

例外,还可以显示的给某个模块一个特定的lib

edk 2 的基本架构

 

下面是来自官方的对dsc [Libraryclasses] seciton 的介绍

每个module 要用到各种各样的lib, 而lib 必然有一个相应的instance. 建立这种映射关系就得靠我们这里说的 libraryClasses section了。

举个例子,在EDK II里面, DebugLib 有很多个instance, 但具体到每个component 的时候,肯定只能link 一个进去,这时候,就需要我们去选取了:

 

edk 2 的基本架构

edk 2 的基本架构

 

 

DSC 的文件构成

 

依次下来,有这些section

[Defines]

[BuildOptions]

[BuildOptions.IA32]

[BuildOptions.X64]

[SkuIds]

[LibraryClasses.common]

LibraryClasses.IA32.SEC]

[LibraryClasses.IA32.PEIM, LibraryClasses.IA32.PEI_CORE, LibraryClasses.IA32.SEC]

[LibraryClasses.common.DXE_DRIVER]

[LibraryClasses.common.DXE_SMM_DRIVER]

LibraryClasses.common.SMM_CORE]

[LibraryClasses.common.DXE_RUNTIME_DRIVER]

[LibraryClasses.common.UEFI_DRIVER]

[LibraryClasses.X64.UEFI_APPLICATION]

 

 

Pcd Section

[PcdsFeatureFlag.common]

[PcdsFixedAtBuild.common]

[PcdsPatchableInModule.common]

[PcdsDynamicExHii.common.DEFAULT]

[PcdsDynamicExDefault.common.IA32]

[PcdsDynamicExDefault.common.DEFAULT]

 

Components Section 

[Components.IA32]    可以没有[Components.X64] ? 

 

Components section 是必不可少的。

 

几是列在components section 里面的module 或者component 都将会被编译器以及EDK II A工具生成PE32/PE32+/Coff image 文件。

 

在Components section 里面 !include 语句是可以使用的,但是,一般不推荐使用。

 

 

 

 

[Components.common]

 

 

[BuildOptions]

[BuildOptions.Common.EDKII]

 

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

(0)

相关推荐

发表回复

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

关注微信