首先,INF/DEC/DSC/FDF file是標準編譯UEFI code所需要準備的,在 AMI code裡DSC/FDF file是AutoGen出來的,而且因為AMI有自己的編譯介面,所以編譯AMI code還須要準備 "SDL", "CIF", "VEB"和 "ldl"檔。
以下介紹INF/DEC/DSC files
● 先定義名詞: $(Arch) (對像是何種architecture)
Arch | Description |
IA32 | X86 32位CPU |
X64 | X86 64位CPU |
IPF | Itanium Processor Family |
ARM | |
EBC | EFI Byte Code |
● $(MORDULE_TYPE) (如SEC, PEI_CORE, PEIM, DXE_CORE,...)
以下列出INF, DSC, DEC常見的內容並加注解說明
####################################################################
# INF (module Information File): Use to Compile module
####################################################################
#以下是UDK2014 AtaBus.inf範例
[Defines]
#細項範例
INF_VERSION = 0x00010005
BASE_NAME = AtaBusDxe #The name for .efi
FILE_GUID = 19DF145A-B1D4-453f-8507-38816676D7F6
MODULE_TYPE = UEFI_DRIVER
# 若為Library則宣告成BASE
# 其他常見的有SEC,PEIM,DXE_DRIVER,DXE_SMM_DRIVER,UEFI_APPLICATION
# LIBRARY_CLASS = XXXLLib
# 若此模組是library才須宣告
VERSION_STRING = 1.0
ENTRY_POINT = InitializeAtaBus
[Sources]
AtaBus.h
AtaBus.c
AtaPassThruExecute.c
ComponentName.c
#引用的Package
[Packages]
MdePkg/MdePkg.dec
#用到的LibraryClasses
[LibraryClasses]
DevicePathLib
UefiBootServicesTableLib
UefiRuntimeServicesTableLib
MemoryAllocationLib
BaseMemoryLib
UefiLib
BaseLib
UefiDriverEntryPoint
DebugLib
TimerLib
ReportStatusCodeLib
#用到的Guid
[Guids]
gEfiDiskInfoIdeInterfaceGuid # CONSUMES ## GUID
gEfiDiskInfoAhciInterfaceGuid # CONSUMES ## GUID
gEfiMemoryOverwriteControlDataGuid # CONSUMES ## GUID
#用到的Protocols
[Protocols]
gEfiDiskInfoProtocolGuid # BY_START
gEfiBlockIoProtocolGuid # BY_START
gEfiBlockIo2ProtocolGuid # BY_START
gEfiAtaPassThruProtocolGuid # TO_START
gEfiDevicePathProtocolGuid # TO_START
gEfiStorageSecurityCommandProtocolGuid # BY_START
####################################################################
# DSC file (Description file): Use to Compile Package
####################################################################
[Defines]
#細項範例
PLATFORM_NAME = MdeModule
PLATFORM_GUID = 587CE499-6CBE-43cd-94E2-186218569478
PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/MdeModule
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
#
# Used by [Components.$(Arch)], Coded as well as the supported
# module types
#
[LibraryClasses.$(Arch).$(MORDULE_TYPE)]
LibraryName | Path/LibraryName.inf
#
# A list of modules to compile from source into UEFI-compliant binaries.
#
[Components.$(Arch)]
Path\Exectuables.inf
Path\Exectuables_1.inf {
<LibraryClasses>
LibraryName|Path\LibraryName.inf
}
[BuildOptions]
#請參考BuildOptions
[PCD]
####################################################################
# DEC file (Declaration file): Designed to support building
# packaging and distribution.此Package對外提供哪些數據和interface
# 給其它module使用
####################################################################
[Defines]
#細項範例
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = MdeModulePkg
PACKAGE_GUID = BA0D78D6-2CAF-414b-BD4D-B6762A894288
PACKAGE_VERSION = 0.93
#以下用來宣告此Package提供資訊
[Includes.$(Arch)]
Path #本Package提供header file的所在路徑
[LibraryClasses.$(Arch)]
[Guids]
[Ppis]
[Protocols]
沒有留言:
張貼留言