超越bios: uefi开发环 境的更新换代 - intel developer zone...• pcd entries are used for...

26
超越BIOS: UEFI开发环 境的更新换代 英特尔 平台软件基础架构部 开发经理 田鹤 Copyright © 2006-2010 Intel Corporation

Upload: others

Post on 17-Sep-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

超越BIOS: UEFI开发环境的更新换代

英特尔

平台软件基础架构部

开发经理 田鹤

Copyright © 2006-2010 Intel Corporation

Page 2: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 3

Agenda

• UEFI Technical Specifications updates

• EDK II Changes

• Package

• Library Enhancements

• PCD – Platform Configuration Database

Page 3: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 4

Standard Firmware Interfaces

• UEFI: Unified Extensible Firmware Interface– a new model for the interface

between the OS and platform firmware

• PI: Platform Initialization– Standardization: key to

interoperability across implementations

– Modular components like silicon drivers (e.g. PCI) and value-add drivers (security)

– Preferred way to build UEFI

Pla

tform

Initia

lization

PI Modular components

Hardware

UEFI-

enabled

OS

UEFI

Shell Legacy

OS

Option

ROMs

CPU PEI

Modules

C/S PEI

Modules

UEFI

• • •

UE

FI D

rive

r

DX

E D

rive

r

Co

mp

atib

ility

Su

pp

ort M

od

ule

UE

FI D

rive

r

BD

S

UE

FI D

rive

r

UEFI is Architected for Dynamic Modularity

Page 4: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 5

Latest UEFI Specifications

• Platform Initialization (PI)

1.2 Spec

• Packaging 1.0 Spec

• UEFI 2.3 Spec

• Self Certification Tests

(SCT) for UEFI 2.1 Spec

• Shell 2.0 Spec

Advancements in firmware technologies continue to evolve. Join the UEFI forum www.UEFI.org

Pla

tform

Initia

lization

PI Modular components

Hardware

UEFI-

enabled

OS

UEFI

Shell Legacy

OS

Option

ROMs

CPU PEI

Modules

C/S PEI

Modules

UEFI

• • •

UE

FI D

rive

r

DX

E D

rive

r

Co

mp

atib

ility

Su

pp

ort M

od

ule

UE

FI D

rive

r

BD

S

UE

FI D

rive

r

Page 5: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 6

UEFI Specification Timeline

20102009200820072006

UEFI 2.0

PI 1.0

UEFI 2.1

PI 1.1

UEFI 2.3UEFI 2.2

EDK 1.01: UEFI 2.0

Shell 2.0

PI 1.2

Packaging 1.0

SCT UEFI 2.1

EDK 1.04: UEFI 2.1PI 1.0

Specific

ations

Imple

menta

tion

http://uefi.org

Open Source

EDK 1.05: UEFI 2.1+PI 1.0

SCTPI 1.0

SCT UEFI 2.0

EDK II: UEFI 2.3+PI 1.2+

EDK II: UEFI 2.1+PI 1.0

New

Page 6: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 7

Agenda

• UEFI Technical Specifications updates

• EDK II Changes

• Package

• Library Enhancements

• PCD – Platform Configuration Database

Page 7: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 8

What Changed

• Philosophy of EDKII

– Support all UEFI and PI development needs

– Separate tool code from source code

– Build existing EDK modules

• Via EDK Compatibility Package (ECP)

– Package Definition File: DEC

• DEC defines package of modules

– FLASH Mapping Tool

– Move as much as possible to C code

Page 8: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 9

Stand Alone Tools Project

• New project that contains common tools

– Single location for the source, documentation, and instructions

• Adds compatibility with GCC / OS X / Linux

– Microsoft / Windows* based tools still work

• C preferred for binary manipulation

• Python (free & portable) preferred for text manipulation

– Replaced EDK tools MakeDeps and ProcessDSC

– Also use for value added tools not required to build

• EDK II contains binary versions of tools

– Build executes tools directly from binary location

• Build performance improved with faster build tools• Record is ~30 seconds

Page 9: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 10

New Directory Structure

- NT32 Emulation

2 Steps to Build>EdkSetup –-nt32

>Build -p

Nt32Pkg\Nt32Pkg.dsc

-a IA32

Page 10: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 11

Agenda

• UEFI Technical Specifications updates

• EDK II Changes

• Package

• Library Enhancements

• PCD – Platform Configuration Database

Page 11: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 12

Modules

• A module is the smallest separate object

compiled in the EDKII. A module is a single

resultant .EFI file.

• Module examples:

– A UEFI/DXE driver

– A PEIM

– A UEFI application

– A Library

Page 12: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 13

Package Philosophy

• As standards evolve there is a need

to target your development on the

set of standards you care about

• Solution: break the EDK II up into

“packages” and enable customers

to make their own packages.

• Only package together what is

needed

Page 13: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 14

Packages• What is a Package?

– A Package is a group of 0 or more modules. Can be just definitions

– Example package concepts:• Drivers, libraries, and applications relating to specific

hardware

• Drivers, libraries, and applications relating to UEFI spec

– Modules within may be dependant on other packages for definitions or elements

• All modules will reference the “root” package

– Include files may also be contained in a Package.• Standard spec

• PPI

• Protocols

Page 14: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 15

Package Examples

• Nt32Pkg – contains drivers

and applications required for

running over Windows.

• MdePkg – All industry

standards (UEFI, PI, ACPI,

SmBios, etc…), most base

library definitions (IE memory

access), and others with no

outside dependency.

Page 15: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 16

Agenda

• UEFI Technical Specifications updates

• EDK II Changes

• Package

• Library Enhancements

• PCD – Platform Configuration Database

Page 16: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 17

Library Enhancements for EDK II

• Library Instance is selected by platform build and a module only defines the Library Class it requires

• Library Classes are better documented

• More than one instance of a given library class can exist

• Library Classes are phase independent

• Libraries maximize the reuse of source code. – Allows sources to be moved between phases with

little/no porting.

Page 17: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 18

UEFI /PI Execution Phases

Pre EFIInitialization

(PEI)

Driver Execution

Environment (DXE)

Boot DevSelect(BDS)

Transient System Load

(TSL)

After Life(AL)

Power on [ . . Platform initialization . . ] [ . . . . OS boot . . . . ] Shutdown

Run Time(RT)

?

OS-PresentApp

Final OS Environment

Final OS Boot Loader

OS-AbsentApp

Transient OS Environment

Transient OS Boot Loader

Boot Manager

CPUInit

Chipset Init

Board Init

ve

rify

Device, Bus, or Service Driver

ExposedPlatformInterface

Pre Verifier

EFI Driver Dispatche

r

Intrinsic Services

security

Security (SEC)

Same lib classes exist across multiple phases

Page 18: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 19

Agenda

• UEFI Technical Specifications updates

• EDK II Changes

• Package

• Library Enhancements

• PCD – Platform Configuration Database

Page 19: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 20

Platform Configuration Database

Knobs to fine tune your firmware• PCD entries are used for module “parameterization”.

• Benefits:

– Reduce the need to edit source code

– No searching for “magic” #define statements

– Maximize module reuse across platforms

– APIs for access to PCD entries

• PCDs can store platform information– Vital Product Data (VPD)

– Serial Number, etc…

– Setup options

0123

4 5 6789

10 0123

4 5 6789

100123

4 5 6789

10

Page 20: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 21

Platform Configuration DB

• The PCD is generated by the build. It contains

PCD entries specified by:

– DEC – declarations of PCD entries

– INF – which PCDs are referenced

– DSC – value and access method

– FDF – flash layout related values

• The documentation for each file type and the

build spec define how each interacts with the

PCD.

Maximizes the re-use of modules Minimize Source code editing

Page 21: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 22

Summary

• EDK II represents evolutionary improvements

upon EDK

• Technical changes focus tool portability, faster

and more efficient builds, and easier build

control

• New platform configuration separates builds

from flash to ease porting

• PCD allows for significant reuse of modules

without changes made to the code.

Page 22: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 23

Additional resources

• UEFI Web – UEFI Specification and PI Specification– http://www.uefi.org

• UEFI open source Code http://www.tianocore.org– EFI Developer Kit (EDK II)

• EDK II https://edk2.tianocore.org– Nt32, DUET, and Unix environments

– Shell binaries

• EDK II Documentation: https://edk2.tianocore.org/servlets/ProjectDocumentList?folderID=82&expandFolder=82&folderID=0

– EFI Shell• EFI shell https://efi-shell.tianocore.org/

• EFI shell Documentation: https://efi-shell.tianocore.org/servlets/ProjectDocumentList?folderID=50&expandFolder=50&folderID=0

Page 23: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 24

Intel® UDK2010• Intel® UDK2010 is EDK II

– The current EDK II sources in the Subversion

repository on The UEFI Open Source Community

Website (URL: www.tianocore.org) are UDK2010.

– The UDK2010 contains current content from other

industry standard specification groups as well:

• PCI, ACPI, USB, SAL, SMBIOS, ATAPI, SCSI, TPM, etc

• “UDK2010” represents a milestone EDK II

development

– EDK II development will continue

– EDK II Releases will be designated under the UDK

designation (when appropriate)

24

Page 24: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 25

Intel® Logo

Page 25: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 26

Distribution

• Distribution Package

– Mix of XML and files / directories

– Build independent way to distribute content

• Other

– ZIP or an industry standard compression can be used

– Not build independent, not clear on usage, more

prone to error

Page 26: 超越BIOS: UEFI开发环 境的更新换代 - Intel Developer Zone...• PCD entries are used for module “parameterization”. • Benefits: –Reduce the need to edit source code

EDKII Training 2010Copyright © 2006-2010 Intel Corporation

•Other trademarks and brands are the property of their respective ownersSlide 27

Description Content File

Workspace DirectoryBaseTools\Conf\NoSuchCorpPkg \

Bus \Pci \PeerBusDxe \PciBusDxe \SuperDuperIODxe\

Include \Common \GUID \● ● ●

MdePkg \MdeModulePkg\

Distribution Description File<DistributionHeader ReadOnly" true" RePackage="false">

<Name BaseName="NosuchChipset"> NosuchChipset</Name><GUID Version="1.2">AF0DDA2E-EA83-480b-B2CE-

FC0BB2F894C2</GUID><Vendor>NosuchCorporation</Vendor><Date>2008-03-24T09:30:00</Date><Copyright>Copyright©2008, NosuchCorporation.All rights

reserved.</Copyright>

Distribution Package File layout

• Packaging

Specification

Distribution Package File (ZIP, .dist)

Disttribution Description File (XML, .pkg)

Disttribution Content File (ZIP, .content)