logo资料库

GPT分区格式技术规范文档.pdf

第1页 / 共1084页
第2页 / 共1084页
第3页 / 共1084页
第4页 / 共1084页
第5页 / 共1084页
第6页 / 共1084页
第7页 / 共1084页
第8页 / 共1084页
资料共1084页,剩余部分请下载后查看
Extensible Firmware Interface Specification
Disclaimer
Revision History
Contents
1 Introduction
1.1 EFI Driver Model Extensions
1.2 Overview
1.3 Goals
1.4 Target Audience
1.5 EFI Design Overview
1.6 EFI Driver Model
1.6.1 EFI Driver Model Goals
1.6.2 Legacy Option ROM Issues
1.7 Migration Requirements
1.7.1 Legacy Operating System Support
1.7.2 Supporting the EFI Specification on a Legacy Platform
1.8 Conventions Used in This Document
1.8.1 Data Structure Descriptions
1.8.2 Protocol Descriptions
1.8.3 Procedure Descriptions
1.8.4 Instruction Descriptions
1.8.5 Pseudo-Code Conventions
1.8.6 Typographic Conventions
2 Overview
2.1 Boot Manager
2.1.1 EFI Images
2.1.2 EFI Applications
2.1.3 EFI OS Loaders
2.1.4 EFI Drivers
2.2 Firmware Core
2.2.1 EFI Services
2.2.2 Runtime Services
2.3 Calling Conventions
2.3.1 Data Types
2.3.2 IA-32 Platforms
2.3.2.1 Handoff State
2.3.3 Itanium®-Based Platforms
2.3.3.1 Handoff State
2.4 Protocols
2.5 EFI Driver Model
2.5.1 Legacy Option ROM Issues
2.5.1.1 IA-32 16-Bit Real Mode Binaries
2.5.1.2 Fixed Resources for Working with Option ROMs
2.5.1.3 Matching Option ROMs to their Devices
2.5.1.4 Ties to PC-AT System Design
2.5.1.5 Ambiguities in Specification and Workarounds Born of Experience
2.5.2 Driver Initialization
2.5.3 Host Bus Controllers
2.5.4 Device Drivers
2.5.5 Bus Drivers
2.5.6 Platform Components
2.5.7 Hot-Plug Events
2.6 Requirements
2.6.1 Required Elements
2.6.2 Platform-Specific Elements
2.6.3 Driver-Specific Elements
3 Boot Manager
3.1 Firmware Boot Manager
3.2 Globally-Defined Variables
3.3 Boot Option Variables Default Behavior
3.4 Boot Mechanisms
3.4.1 Boot via Simple File Protocol
3.4.1.1 Removable Media Boot Behavior
3.4.2 Boot via LOAD_FILE Protocol
3.4.2.1 Network Booting
3.4.2.2 Future Boot Media
4 EFI System Table
4.1 EFI Image Entry Point
EFI_IMAGE_ENTRY_POINT
4.2 EFI Table Header
EFI_TABLE_HEADER
4.3 EFI System Table
EFI_SYSTEM_TABLE
4.4 EFI Boot Services Table
EFI_BOOT_SERVICES
4.5 EFI Runtime Services Table
EFI_RUNTIME_SERVICES
4.6 EFI Configuration Table
EFI_CONFIGURATION_TABLE
4.7 EFI Image Entry Point Examples
4.7.1 EFI Image Entry Point Examples
4.7.2 EFI Driver Model Example
4.7.3 EFI Driver Model Example (Unloadable)
4.7.4 EFI Driver Model Example (Multiple Instances)
5 Services - Boot Services
5.1 Event, Timer, and Task Priority Services
CreateEvent()
CloseEvent()
SignalEvent()
WaitForEvent()
CheckEvent()
SetTimer()
RaiseTPL()
RestoreTPL()
5.2 Memory Allocation Services
AllocatePages()
FreePages()
GetMemoryMap()
AllocatePool()
FreePool()
5.3 Protocol Handler Services
5.3.1 Driver Model Boot Services
InstallProtocolInterface()
UninstallProtocolInterface()
ReinstallProtocolInterface()
RegisterProtocolNotify()
LocateHandle()
HandleProtocol()
LocateDevicePath()
OpenProtocol()
CloseProtocol()
OpenProtocolInformation()
ConnectController()
DisconnectController()
ProtocolsPerHandle()
LocateHandleBuffer()
LocateProtocol()
InstallMultipleProtocolInterfaces()
UninstallMultipleProtocolInterfaces()
5.4 Image Services
LoadImage()
StartImage()
UnloadImage()
EFI_IMAGE_ENTRY_POINT
Exit()
ExitBootServices()
5.5 Miscellaneous Boot Services
SetWatchdogTimer()
Stall()
CopyMem()
SetMem()
GetNextMonotonicCount()
InstallConfigurationTable()
CalculateCrc32()
6 Services - Runtime Services
6.1 Variable Services
GetVariable()
GetNextVariableName()
SetVariable()
6.2 Time Services
GetTime()
SetTime()
GetWakeupTime()
SetWakeupTime()
6.3 Virtual Memory Services
SetVirtualAddressMap()
ConvertPointer()
6.4 Miscellaneous Runtime Services
ResetSystem()
GetNextHighMonotonicCount()
7 Protocols - EFI Loaded Image
EFI_LOADED_IMAGE Protocol
LOADED_IMAGE.Unload()
8 Protocols - Device Path Protocol
8.1 Device Path Overview
8.2 EFI_DEVICE_PATH Protocol
EFI_DEVICE_PATH Protocol
8.3 Device Path Nodes
8.3.1 Generic Device Path Structures
8.3.2 Hardware Device Path
8.3.2.1 PCI Device Path
8.3.2.2 PCCARD Device Path
8.3.2.3 Memory Mapped Device Path
8.3.2.4 Vendor Device Path
8.3.2.5 Controller Device Path
8.3.3 ACPI Device Path
8.3.4 Messaging Device Path
8.3.4.1 ATAPI Device Path
8.3.4.2 SCSI Device Path
8.3.4.3 Fibre Channel Device Path
8.3.4.4 1394 Device Path
8.3.4.5 USB Device Path
8.3.4.6 USB Class Device Path
8.3.4.7 IO Device Path
8.3.4.8 MAC Address Device Path
8.3.4.9 IPv4 Device Path
8.3.4.10 IPv6 Device Path
8.3.4.11 InfiniBand Device Path
8.3.4.12 UART Device Path
8.3.4.13 Vendor-Defined Messaging Device Path
8.3.4.14 UART Flow Control Messaging Path
8.3.5 Media Device Path
8.3.5.1 Hard Drive
8.3.5.2 CD-ROM Media Device Path
8.3.5.3 Vendor-Defined Media Device Path
8.3.5.4 File Path Media Device Path
8.3.5.5 Media Protocol Device Path
8.3.6 BIOS Boot Specification Device Path
8.4 Device Path Generation Rules
8.4.1 Housekeeping Rules
8.4.2 Rules with ACPI _HID and _UID
8.4.3 Rules with ACPI _ADR
8.4.4 Hardware vs. Messaging Device Path Rules
8.4.5 Media Device Path Rules
8.4.6 Other Rules
9 Protocols - EFI Driver Model
9.1 EFI Driver Binding Protocol
EFI_DRIVER_BINDING_PROTOCOL
EFI_DRIVER_BINDING_PROTOCOL.Supported()
EFI_DRIVER_BINDING_PROTOCOL.Start()
EFI_DRIVER_BINDING_PROTOCOL.Stop()
9.2 EFI Platform Driver Override Protocol
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriver()
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriverPath()
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.DriverLoaded()
9.3 EFI Bus Specific Driver Override Protocol
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL.GetDriver()
9.4 EFI Driver Configuration Protocol
EFI_DRIVER_CONFIGURATION_PROTOCOL
EFI_DRIVER_CONFIGURATION_PROTOCOL.SetOptions()
EFI_DRIVER_CONFIGURATION_PROTOCOL.OptionsValid()
EFI_DRIVER_CONFIGURATION_PROTOCOL.ForceDefaults()
9.5 EFI Driver Diagnostics Protocol
EFI_DRIVER_DIAGNOSTICS_PROTOCOL
EFI_DRIVER_DIAGNOSTICS_PROTOCOL.RunDiagnostics()
9.6 EFI Component Name Protocol
EFI_COMPONENT_NAME_PROTOCOL
EFI_COMPONENT_NAME_PROTOCOL.GetDriverName()
EFI_COMPONENT_NAME_PROTOCOL.GetControllerName()
10 Protocols - Console Support
10.1 Console I/O Protocol
10.1.1 Overview
10.1.2 ConsoleIn Definition
10.2 Simple Input Protocol
SIMPLE_INPUT
SIMPLE_INPUT.Reset()
SIMPLE_INPUT.ReadKeyStroke()
10.2.1 ConsoleOut or StandardError
10.3 Simple Text Output Protocol
SIMPLE_TEXT_OUTPUT Protocol
SIMPLE_TEXT_OUTPUT.Reset()
SIMPLE_TEXT_OUTPUT.OutputString()
SIMPLE_TEXT_OUTPUT.TestString()
SIMPLE_TEXT_OUTPUT.QueryMode()
SIMPLE_TEXT_OUTPUT.SetMode()
SIMPLE_TEXT_OUTPUT.SetAttribute()
SIMPLE_TEXT_OUTPUT.ClearScreen()
SIMPLE_TEXT_OUTPUT.SetCursorPosition()
SIMPLE_TEXT_OUTPUT.EnableCursor()
10.4 Universal Graphics Adapter Protocols
10.4.1 UGA ROM
10.4.2 UGA Draw Protocol
10.4.3 Blt Buffer
10.4.4 UGA I/O Protocol
10.4.5 Fallback Mode Driver
10.5 UGA Draw Protocol
EFI_UGA_DRAW_PROTOCOL
EFI_UGA_DRAW_PROTOCOL.GetMode()
EFI_UGA_DRAW_PROTOCOL.SetMode()
EFI_UGA_DRAW_PROTOCOL.Blt()
10.6 Rules for PCI/AGP Devices
10.7 UGA I/O Protocol
EFI_UGA_IO_PROTOCOL
EFI_UGA_IO_PROTOCOL.CreateDevice()
EFI_UGA_IO_PROTOCOL.DeleteDevice()
PUGA_FW_SERVICE_DISPATCH.DispatchService()
10.8 Implementation Rules for an EFI UGA Driver
10.9 UGA Draw Protocol to UGA I/O Protocol Mapping
10.9.1 UGA System Requirements
10.9.2 System Abstraction Requirements
10.9.3 Firmware to OS Hand-off
10.10 Simple Pointer Protocol
EFI_SIMPLE_POINTER_PROTOCOL
EFI_SIMPLE_POINTER.Reset()
EFI_SIMPLE_POINTER.GetState()
10.11 EFI Simple Pointer Device Paths
10.12 Serial I/O Protocol
SERIAL_IO_PROTOCOL
SERIAL_IO.Reset()
SERIAL_IO.SetAttributes()
SERIAL_IO.SetControl()
SERIAL_IO.GetControl()
SERIAL_IO.Write()
SERIAL_IO.Read()
11 Protocols - Bootable Image Support
11.1 LOAD_FILE Protocol
LOAD_FILE Protocol
LOAD_FILE.LoadFile()
11.2 File System Format
11.2.1 System Partition
11.2.1.1 File System Format
11.2.1.2 File Names
11.2.1.3 Directory Structure
11.2.2 Partition Discovery
11.2.2.1 EFI Partition Header
11.2.2.2 ISO-9660 and El Torito
11.2.2.3 Legacy Master Boot Record
11.2.2.4 Legacy Master Boot Record and GPT Partitions
11.2.3 Media Formats
11.2.3.1 Removable Media
11.2.3.2 Diskette
11.2.3.3 Hard Drive
11.2.3.4 CD-ROM and DVD-ROM
11.2.3.5 Network
11.3 File System Protocol
Simple File System Protocol
EFI_FILE_IO_INTERFACE.OpenVolume()
11.4 EFI_FILE Protocol
EFI_FILE Protocol
EFI_FILE.Open()
EFI_FILE.Close()
EFI_FILE.Delete()
EFI_FILE.Read()
EFI_FILE.Write()
EFI_FILE.SetPosition()
EFI_FILE.GetPosition()
EFI_FILE.GetInfo()
EFI_FILE.SetInfo()
EFI_FILE.Flush()
EFI_FILE_INFO
EFI_FILE_SYSTEM_INFO
EFI_FILE_SYSTEM_VOLUME_LABEL
11.5 DISK_IO Protocol
DISK_IO Protocol
EFI_DISK_IO.ReadDisk()
EFI_DISK_IO.WriteDisk()
11.6 BLOCK_IO Protocol
BLOCK_IO Protocol
EFI_BLOCK_IO.Reset()
EFI_BLOCK_IO.ReadBlocks()
EFI_BLOCK_IO.WriteBlocks()
EFI_BLOCK_IO.FlushBlocks()
11.7 UNICODE_COLLATION Protocol
UNICODE_COLLATION Protocol
UNICODE_COLLATION.StriColl()
UNICODE_COLLATION.MetaiMatch()
UNICODE_COLLATION.StrLwr()
UNICODE_COLLATION.StrUpr()
UNICODE_COLLATION.FatToStr()
UNICODE_COLLATION.StrToFat()
12 Protocols - PCI Bus Support
12.1 PCI Root Bridge I/O Support
12.1.1 PCI Root Bridge I/O Overview
12.1.1.1 Sample PCI Architectures
12.2 PCI Root Bridge I/O Protocol
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollMem()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollIo()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Read() EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Write()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Read() EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Write()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.CopyMem()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Map()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Unmap()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.AllocateBuffer()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.FreeBuffer()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Flush()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.GetAttributes()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.SetAttributes()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Configuration()
12.2.1 PCI Root Bridge Device Paths
12.3 PCI Driver Model
12.3.1 PCI Driver Initialization
12.3.1.1 Driver Configuration Protocol
12.3.1.2 Driver Diagnostics Protocol
12.3.1.3 Component Name Protocol
12.3.2 PCI Bus Drivers
12.3.2.1 Driver Binding Protocol for PCI Bus Drivers
12.3.2.2 PCI Enumeration
12.3.3 PCI Device Drivers
12.3.3.1 Driver Binding Protocol for PCI Device Drivers
12.4 EFI PCI I/O Protocol
EFI_PCI_IO_PROTOCOL
EFI_PCI_IO_PROTOCOL.PollMem()
EFI_PCI_IO_PROTOCOL.PollIo()
EFI_PCI_IO_PROTOCOL.Mem.Read() EFI_PCI_IO_PROTOCOL.Mem.Write()
EFI_PCI_IO_PROTOCOL.Io.Read() EFI_PCI_IO_PROTOCOL.Io.Write()
EFI_PCI_IO_PROTOCOL.Pci.Read() EFI_PCI_IO_PROTOCOL.Pci.Write()
EFI_PCI_IO_PROTOCOL.CopyMem()
EFI_PCI_IO_PROTOCOL.Map()
EFI_PCI_IO_PROTOCOL.Unmap()
EFI_PCI_IO_PROTOCOL.AllocateBuffer()
EFI_PCI_IO_PROTOCOL.FreeBuffer()
EFI_PCI_IO_PROTOCOL.Flush()
EFI_PCI_IO_PROTOCOL.GetLocation()
EFI_PCI_IO_PROTOCOL.Attributes()
EFI_PCI_IO_PROTOCOL.GetBarAttributes()
EFI_PCI_IO_PROTOCOL.SetBarAttributes()
12.4.1 PCI Device Paths
12.4.2 PCI Option ROMs
12.4.2.1 PCI Bus Driver Responsibilities
12.4.2.2 PCI Device Driver Responsibilities
12.4.3 Nonvolatile Storage
12.4.4 PCI Hot-Plug Events
13 Protocols - SCSI Bus Support
13.1 SCSI Pass Thru Protocol
EFI_SCSI_PASS_THRU Protocol
EFI_SCSI_PASS_THRU_PROTOCOL.PassThru()
EFI_SCSI_PASS_THRU_PROTOCOL.GetNextDevice()
EFI_SCSI_PASS_THRU_PROTOCOL.BuildDevicePath()
EFI_SCSI_PASS_THRU_PROTOCOL.GetTargetLun()
EFI_SCSI_PASS_THRU_PROTOCOL.ResetChannel()
EFI_SCSI_PASS_THRU_PROTOCOL.ResetTarget()
13.2 SCSI Pass Thru Device Paths
14 Protocols - USB Support
14.1 USB Host Controller Protocol
14.1.1 USB Host Controller Protocol Overview
EFI_USB_HC_PROTOCOL
EFI_USB_HC_PROTOCOL.Reset()
EFI_USB_HC_PROTOCOL.GetState()
EFI_USB_HC_PROTOCOL.SetState()
EFI_USB_HC_PROTOCOL.ControlTransfer()
EFI_USB_HC_PROTOCOL.BulkTransfer()
EFI_USB_HC_PROTOCOL.AsyncInterruptTransfer()
EFI_USB_HC_PROTOCOL.SyncInterruptTransfer()
EFI_USB_HC_PROTOCOL.IsochronousTransfer()
EFI_USB_HC_PROTOCOL.AsyncIsochronousTransfer()
EFI_USB_HC_PROTOCOL.GetRootHubPortNumber()
EFI_USB_HC_PROTOCOL.GetRootHubPortStatus()
EFI_USB_HC_PROTOCOL.SetRootHubPortFeature()
EFI_USB_HC_PROTOCOL.ClearRootHubPortFeature()
14.2 USB Driver Model
14.2.1 Scope
14.2.2 USB Driver Model Overview
14.2.3 USB Bus Driver
14.2.3.1 USB Bus Driver Entry Point
14.2.3.2 Driver Binding Protocol for USB Bus Drivers
14.2.3.3 USB Hot-Plug Event
14.2.3.4 USB Bus Enumeration
14.2.4 USB Device Driver
14.2.4.1 USB Device Driver Entry Point
14.2.4.2 Driver Binding Protocol for USB Device Drivers
14.2.5 EFI USB I/O Protocol Overview
EFI_USB_IO Protocol
EFI_USB_IO_PROTOCOL.UsbControlTransfer()
EFI_USB_IO_PROTOCOL.UsbBulkTransfer()
EFI_USB_IO_PROTOCOL.UsbAsyncInterruptTransfer()
EFI_USB_IO_PROTOCOL.UsbSyncInterruptTransfer()
EFI_USB_IO_PROTOCOL.UsbIsochronousTransfer()
EFI_USB_IO_PROTOCOL.UsbAsyncIsochronousTransfer()
EFI_USB_IO_PROTOCOL.UsbGetDeviceDescriptor()
EFI_USB_IO_PROTOCOL.UsbGetConfigDescriptor()
EFI_USB_IO_PROTOCOL.UsbGetInterfaceDescriptor()
EFI_USB_IO_PROTOCOL.UsbGetEndpointDescriptor()
EFI_USB_IO_PROTOCOL.UsbGetStringDescriptor()
EFI_USB_IO_PROTOCOL.UsbGetSupportedLanguages()
EFI_USB_IO_PROTOCOL.UsbPortReset()
14.2.6 USB Device Paths
14.2.6.1 USB Device Path Node
14.2.6.2 USB Device Path Example
15 Protocols - Network Support
15.1 EFI_SIMPLE_NETWORK Protocol
EFI_SIMPLE_NETWORK Protocol
EFI_SIMPLE_NETWORK.Start()
EFI_SIMPLE_NETWORK.Stop()
EFI_SIMPLE_NETWORK.Initialize()
EFI_SIMPLE_NETWORK.Reset()
EFI_SIMPLE_NETWORK.Shutdown()
EFI_SIMPLE_NETWORK.ReceiveFilters()
EFI_SIMPLE_NETWORK.StationAddress()
EFI_SIMPLE_NETWORK.Statistics()
EFI_SIMPLE_NETWORK.MCastIPtoMAC()
EFI_SIMPLE_NETWORK.NvData()
EFI_SIMPLE_NETWORK.GetStatus()
EFI_SIMPLE_NETWORK.Transmit()
EFI_SIMPLE_NETWORK.Receive()
15.2 NETWORK_INTERFACE_IDENTIFIER Protocol
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL
15.3 PXE Base Code Protocol
EFI_PXE_BASE_CODE Protocol
EFI_PXE_BASE_CODE.Start()
EFI_PXE_BASE_CODE.Stop()
EFI_PXE_BASE_CODE.Dhcp()
EFI_PXE_BASE_CODE.Discover()
EFI_PXE_BASE_CODE.Mtftp()
EFI_PXE_BASE_CODE.UdpWrite()
EFI_PXE_BASE_CODE.UdpRead()
EFI_PXE_BASE_CODE.SetIpFilter()
EFI_PXE_BASE_CODE.Arp()
EFI_PXE_BASE_CODE.SetParameters()
EFI_PXE_BASE_CODE.SetStationIp()
EFI_PXE_BASE_CODE.SetPackets()
15.4 PXE Base Code Callback Protocol
EFI_PXE_BASE_CODE_CALLBACK Protocol
EFI_PXE_BASE_CODE_CALLBACK.Callback()
15.5 Boot Integrity Services Protocol
EFI_BIS_PROTOCOL
EFI_BIS.Initialize()
EFI_BIS.Shutdown()
EFI_BIS.Free()
EFI_BIS.GetBootObjectAuthorizationCertificate()
EFI_BIS.GetBootObjectAuthorizationCheckFlag()
EFI_BIS.GetBootObjectAuthorizationUpdateToken()
EFI_BIS.GetSignatureInfo()
EFI_BIS.UpdateBootObjectAuthorization()
EFI_BIS.VerifyBootObject()
EFI_BIS.VerifyObjectWithCredential()
16 Protocols - Debugger Support
16.1 Overview
16.2 EFI Debug Support Protocol
16.2.1 EFI Debug Support Protocol Overview
EFI_DEBUG_SUPPORT_PROTOCOL
EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex()
EFI_DEBUG_SUPPORT_PROTOCOL.RegisterPeriodicCallback()
EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback()
EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache()
16.3 EFI Debugport Protocol
16.3.1 EFI Debugport Overview
EFI_DEBUGPORT_PROTOCOL
EFI_DEBUGPORT_PROTOCOL.Reset()
EFI_DEBUGPORT_PROTOCOL.Write()
EFI_DEBUGPORT_PROTOCOL.Read()
EFI_DEBUGPORT_PROTOCOL.Poll()
16.3.2 Debugport Device Path
16.3.3 EFI Debugport Variable
16.4 EFI Debug Support Table
16.4.1 Overview
16.4.2 EFI System Table Location
16.4.3 EFI Image Info
17 Protocols - Compression Algorithm Specification
17.1 Algorithm Overview
17.2 Data Format
17.2.1 Bit Order
17.2.2 Overall Structure
17.2.3 Block Structure
17.2.3.1 Block Header
17.2.3.2 Block Body
17.3 Compressor Design
17.3.1 Overall Process
17.3.2 String Info Log
17.3.2.1 Data Structures
17.3.2.2 Searching the Tree
17.3.2.3 Adding String Info
17.3.2.4 Deleting String Info
17.3.3 Huffman Code Generation
17.3.3.1 Huffman Tree Generation
17.3.3.2 Code Length Adjustment
17.3.3.3 Code Generation
17.4 Decompressor Design
17.5 Decompress Protocol
EFI_DECOMPRESS_PROTOCOL
EFI_DECOMPRESS_PROTOCOL.GetInfo()
EFI_DECOMPRESS_PROTOCOL.Decompress()
18 Protocols - Device I/O Protocol
18.1 Device I/O Overview
18.2 DEVICE_IO Protocol
DEVICE_IO Protocol
DEVICE_IO.Mem(), .Io(), and .Pci()
DEVICE_IO.PciDevicePath()
DEVICE_IO.Map()
DEVICE_IO.Unmap()
DEVICE_IO.AllocateBuffer()
DEVICE_IO.Flush()
DEVICE_IO.FreeBuffer()
19 EFI Byte Code Virtual Machine
19.1 Overview
19.1.1 Processor Architecture Independence
19.1.2 OS Independent
19.1.3 EFI Compliant
19.1.4 Coexistence of Legacy Option ROMs
19.1.5 Relocatable Image
19.1.6 Size Restrictions Based on Memory Available
19.2 Memory Ordering
19.3 Virtual Machine Registers
19.4 Natural Indexing
19.4.1 Sign Bit
19.4.2 Bits Assigned to Natural Units
19.4.3 Constant
19.4.4 Natural Units
19.5 EBC Instruction Operands
19.5.1 Direct Operands
19.5.2 Indirect Operands
19.5.3 Indirect with Index Operands
19.5.4 Immediate Operands
19.6 EBC Instruction Syntax
19.7 Instruction Encoding
19.7.1 Instruction Opcode Byte Encoding
19.7.2 Instruction Operands Byte Encoding
19.7.3 Index/Immediate Data Encoding
19.8 EBC Instruction Set
ADD
AND
ASHR
BREAK
CALL
CMP
CMPI
DIV
DIVU
EXTNDB
EXTNDD
EXTNDW
JMP
JMP8
MOD
MODU
MOV
MOVI
MOVIn
MOVn
MOVREL
MOVsn
MUL
MULU
NEG
NOT
OR
POP
POPn
PUSH
PUSHn
RET
SHL
SHR
STORESP
SUB
XOR
19.9 Runtime and Software Conventions
19.9.1 Calling Outside VM
19.9.2 Calling Inside VM
19.9.3 Parameter Passing
19.9.4 Return Values
19.9.5 Binary Format
19.10 Architectural Requirements
19.10.1 EBC Image Requirements
19.10.2 EBC Execution Interfacing Requirements
19.10.3 Interfacing Function Parameters Requirements
19.10.4 Function Return Requirements
19.10.5 Function Return Values Requirements
19.11 EBC Interpreter Protocol
EFI_EBC_PROTOCOL
EFI_EBC_PROTOCOL.CreateThunk()
EFI_EBC_PROTOCOL.UnloadImage()
EFI_EBC_PROTOCOL.RegisterICacheFlush()
EFI_EBC_PROTOCOL.GetVersion()
19.12 EBC Tools
19.12.1 EBC C Compiler
19.12.2 C Coding Convention
19.12.3 EBC Interface Assembly Instructions
19.12.4 Stack Maintenance and Argument Passing
19.12.5 Native to EBC Arguments Calling Convention
19.12.6 EBC to Native Arguments Calling Convention
19.12.7 EBC to EBC Arguments Calling Convention
19.12.8 Function Returns
19.12.9 Function Return Values
19.12.10 Thunking
19.12.10.1 Thunking EBC to Native Code
19.12.10.2 Thunking Native Code to EBC
19.12.10.3 Thunking EBC to EBC
19.12.11 EBC Linker
19.12.12 Image Loader
19.12.13 Debug Support
19.13 VM Exception Handling
19.13.1 Divide By 0 Exception
19.13.2 Debug Break Exception
19.13.3 Invalid Opcode Exception
19.13.4 Stack Fault Exception
19.13.5 Alignment Exception
19.13.6 Instruction Encoding Exception
19.13.7 Bad Break Exception
19.13.8 Undefined Exception
19.14 Option ROM Formats
19.14.1 EFI Drivers for PCI Add-in Cards
19.14.2 Non-PCI Bus Support
Appendix A GUID and Time Formats
Appendix B Console
B.1 SIMPLE_INPUT
B.2 SIMPLE_TEXT_OUTPUT
Appendix C Device Path Examples
C.1 Example Computer System
C.2 Legacy Floppy
C.3 IDE Disk
C.4 Secondary Root PCI Bus with PCI to PCI Bridge
C.5 ACPI Terms
C.6 EFI Device Path as a Name Space
Appendix D Status Codes
Appendix E 32/64-Bit UNDI Specification
E.1 Introduction
E.1.1 Definitions
E.1.2 Referenced Specifications
E.1.3 OS Network Stacks
E.2 Overview
E.2.1 32/64-bit UNDI Interface
E.2.2 UNDI Command Format
E.3 UNDI C Definitions
E.3.1 Portability Macros
E.3.2 Miscellaneous Macros
E.3.3 Portability Types
E.3.4 Simple Types
E.3.5 Compound Types
E.4 UNDI Commands
E.4.1 Command Linking and Queuing
E.4.2 Get State
E.4.3 Start
E.4.4 Stop
E.4.5 Get Init Info
E.4.6 Get Config Info
E.4.7 Initialize
E.4.8 Reset
E.4.9 Shutdown
E.4.10 Interrupt Enables
E.4.11 Receive Filters
E.4.12 Station Address
E.4.13 Statistics
E.4.14 MCast IP To MAC
E.4.15 NvData
E.4.16 Get Status
E.4.17 Fill Header
E.4.18 Transmit
E.4.19 Receive
E.5 UNDI as an EFI Runtime Driver
Appendix F Using the Simple Pointer Protocol
Appendix G Using the EFI SCSI Pass Thru Protocol
Appendix H Compression Source Code
Appendix I Decompression Source Code
Appendix J EFI Byte Code Virtual Machine Opcode Summary
Appendix K Alphabetic Function Lists
References
Glossary
Index
Extensible Firmware Interface Specification Version 1.10 December 1, 2002
Extensible Firmware Interface Specification Acknowledgements The UGA Protocol sections of this specification were developed in close consultation with Microsoft as part of the Universal Graphics Adapter (UGA) initiative. Microsoft has made significant contributions to the interface definitions presented here to ensure that they will work well with video adapters supporting the Microsoft UGA specification. These efforts are gratefully acknowledged. The EFI Byte Code Virtual Machine sections (Chapter 19) of this specification were developed in close consultation with Microsoft, LSI, Hewlett Packard, Compaq, and Phoenix Technologies. The efforts of all contributors to these sections are gratefully acknowledged. 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 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, except that a license is hereby granted to copy and reproduce this specification for internal use only. 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. This document contains information on products in the design phase of development. Do not finalize a design with this information. Revised information will be published when the product is available. Verify with your local sales office that you have the latest datasheet or specification before finalizing a design. Intel, the Intel logo, Pentium, Itanium, and MMX are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. † Other names and brands may be claimed as the property of others. Intel order number: A79614-002 Copyright  1998–2002 Intel Corporation. All Rights Reserved. ii 12/01/02 Version 1.10
Revision 1.0 Revision History Official release of EFI 1.10 Specification, revision 1.0. Date 12/01/02 History Version 1.10 12/01/02 iii
Extensible Firmware Interface Specification iv 12/01/02 Version 1.10
Contents 1 Introduction 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.6.1 1.6.2 1.7.1 1.7.2 EFI Driver Model Extensions............................................................................... 1-2 Overview............................................................................................................. 1-3 Goals .................................................................................................................. 1-6 Target Audience.................................................................................................. 1-8 EFI Design Overview .......................................................................................... 1-8 EFI Driver Model................................................................................................. 1-9 EFI Driver Model Goals ............................................................................ 1-10 Legacy Option ROM Issues...................................................................... 1-11 Migration Requirements .................................................................................... 1-11 Legacy Operating System Support........................................................... 1-11 Supporting the EFI Specification on a Legacy Platform ............................ 1-11 Conventions Used in This Document ................................................................ 1-12 Data Structure Descriptions...................................................................... 1-12 Protocol Descriptions ............................................................................... 1-12 Procedure Descriptions ............................................................................ 1-13 Instruction Descriptions ............................................................................ 1-13 Pseudo-Code Conventions....................................................................... 1-14 Typographic Conventions......................................................................... 1-14 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 2 Overview 2.1 2.2 2.3 2.4 2.5 2.1.1 2.1.2 2.1.3 2.1.4 2.2.1 2.2.2 2.3.1 2.3.2 2.3.3 Boot Manager ..................................................................................................... 2-2 EFI Images................................................................................................. 2-2 EFI Applications ......................................................................................... 2-3 EFI OS Loaders ......................................................................................... 2-4 EFI Drivers ................................................................................................. 2-4 Firmware Core .................................................................................................... 2-5 EFI Services............................................................................................... 2-5 Runtime Services ....................................................................................... 2-6 Calling Conventions ............................................................................................ 2-7 Data Types................................................................................................. 2-7 IA-32 Platforms .......................................................................................... 2-9 2.3.2.1 Handoff State .................................................................................. 2-10 Itanium®-Based Platforms ........................................................................ 2-11 2.3.3.1 Handoff State .................................................................................. 2-12 Protocols........................................................................................................... 2-12 EFI Driver Model............................................................................................... 2-15 Legacy Option ROM Issues...................................................................... 2-17 IA-32 16-Bit Real Mode Binaries...................................................... 2-17 2.5.1.1 2.5.1.2 Fixed Resources for Working with Option ROMs............................. 2-18 2.5.1.3 Matching Option ROMs to their Devices .......................................... 2-18 2.5.1.4 Ties to PC-AT System Design ......................................................... 2-19 2.5.1.5 Ambiguities in Specification and Workarounds Born of Experience.......................................................................... 2-19 2.5.1 Version 1.10 12/01/02 v
Extensible Firmware Interface Specification 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 Driver Initialization .................................................................................... 2-20 Host Bus Controllers ................................................................................ 2-21 Device Drivers.......................................................................................... 2-23 Bus Drivers............................................................................................... 2-24 Platform Components............................................................................... 2-26 Hot-Plug Events ....................................................................................... 2-27 Requirements ................................................................................................... 2-27 Required Elements................................................................................... 2-28 Platform-Specific Elements ...................................................................... 2-29 Driver-Specific Elements .......................................................................... 2-30 2.6.1 2.6.2 2.6.3 2.6 3 Boot Manager 5 Services — Boot Services Event, Timer, and Task Priority Services............................................................. 5-2 CreateEvent() ................................................................................................ 5-5 CloseEvent().................................................................................................. 5-9 SignalEvent() ............................................................................................... 5-10 WaitForEvent()............................................................................................. 5-11 vi 12/01/02 Version 1.10 4 EFI System Table Firmware Boot Manager...................................................................................... 3-1 Globally-Defined Variables.................................................................................. 3-5 Boot Option Variables Default Behavior .............................................................. 3-7 Boot Mechanisms ............................................................................................... 3-7 Boot via Simple File Protocol...................................................................... 3-7 3.4.1.1 Removable Media Boot Behavior ...................................................... 3-7 Boot via LOAD_FILE Protocol .................................................................... 3-8 3.4.2.1 Network Booting ................................................................................ 3-8 3.4.2.2 Future Boot Media............................................................................. 3-8 3.4.1 3.4.2 EFI Image Entry Point......................................................................................... 4-1 EFI_IMAGE_ENTRY_POINT ........................................................................... 4-1 EFI Table Header................................................................................................ 4-3 EFI_TABLE_HEADER ..................................................................................... 4-3 EFI System Table ............................................................................................... 4-4 EFI_SYSTEM_TABLE ..................................................................................... 4-4 EFI Boot Services Table ..................................................................................... 4-6 EFI_BOOT_SERVICES ................................................................................... 4-6 EFI Runtime Services Table.............................................................................. 4-11 EFI_RUNTIME_SERVICES ........................................................................... 4-11 EFI Configuration Table .................................................................................... 4-13 EFI_CONFIGURATION_TABLE .................................................................... 4-13 EFI Image Entry Point Examples ...................................................................... 4-14 EFI Image Entry Point Examples.............................................................. 4-14 EFI Driver Model Example........................................................................ 4-16 EFI Driver Model Example (Unloadable) .................................................. 4-17 EFI Driver Model Example (Multiple Instances) ........................................ 4-18 4.7.1 4.7.2 4.7.3 4.7.4 3.1 3.2 3.3 3.4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 5.1
Contents 5.2 5.3 5.4 5.5 5.3.1 CheckEvent()............................................................................................... 5-12 SetTimer().................................................................................................... 5-13 RaiseTPL() .................................................................................................. 5-15 RestoreTPL() ............................................................................................... 5-17 Memory Allocation Services.............................................................................. 5-18 AllocatePages() ........................................................................................... 5-21 FreePages()................................................................................................. 5-24 GetMemoryMap()......................................................................................... 5-25 AllocatePool() .............................................................................................. 5-29 FreePool().................................................................................................... 5-30 Protocol Handler Services................................................................................. 5-31 Driver Model Boot Services ...................................................................... 5-33 InstallProtocolInterface() .............................................................................. 5-36 UninstallProtocolInterface().......................................................................... 5-38 ReinstallProtocolInterface().......................................................................... 5-40 RegisterProtocolNotify()............................................................................... 5-42 LocateHandle() ............................................................................................ 5-43 HandleProtocol().......................................................................................... 5-45 LocateDevicePath() ..................................................................................... 5-47 OpenProtocol() ............................................................................................ 5-49 CloseProtocol()............................................................................................ 5-56 OpenProtocolInformation()........................................................................... 5-59 ConnectController() ..................................................................................... 5-61 DisconnectController() ................................................................................. 5-66 ProtocolsPerHandle()................................................................................... 5-68 LocateHandleBuffer()................................................................................... 5-70 LocateProtocol() .......................................................................................... 5-73 InstallMultipleProtocolInterfaces() ................................................................ 5-74 UninstallMultipleProtocolInterfaces()............................................................ 5-75 Image Services ................................................................................................. 5-76 LoadImage() ................................................................................................ 5-78 StartImage()................................................................................................. 5-80 UnloadImage()............................................................................................. 5-81 EFI_IMAGE_ENTRY_POINT....................................................................... 5-82 Exit() ............................................................................................................ 5-83 ExitBootServices() ....................................................................................... 5-85 Miscellaneous Boot Services ............................................................................ 5-86 SetWatchdogTimer().................................................................................... 5-87 Stall() ........................................................................................................... 5-88 CopyMem().................................................................................................. 5-89 SetMem()..................................................................................................... 5-90 GetNextMonotonicCount() ........................................................................... 5-91 InstallConfigurationTable()........................................................................... 5-92 CalculateCrc32().......................................................................................... 5-93 Version 1.10 12/01/02 vii
Extensible Firmware Interface Specification 6 Services — Runtime Services 6.1 6.2 6.3 6.4 8.1 8.2 8.3 Variable Services ................................................................................................ 6-2 GetVariable() ................................................................................................. 6-3 GetNextVariableName()................................................................................. 6-5 SetVariable().................................................................................................. 6-7 Time Services ..................................................................................................... 6-9 GetTime() .................................................................................................... 6-10 SetTime()..................................................................................................... 6-13 GetWakeupTime() ....................................................................................... 6-14 SetWakeupTime()........................................................................................ 6-15 Virtual Memory Services ................................................................................... 6-16 SetVirtualAddressMap()............................................................................... 6-17 ConvertPointer() .......................................................................................... 6-19 Miscellaneous Runtime Services ...................................................................... 6-20 ResetSystem()............................................................................................. 6-21 GetNextHighMonotonicCount() .................................................................... 6-23 7 Protocols — EFI Loaded Image EFI_LOADED_IMAGE Protocol ....................................................................... 7-1 LOADED_IMAGE.Unload()............................................................................ 7-3 8 Protocols — Device Path Protocol Device Path Overview......................................................................................... 8-1 EFI_DEVICE_PATH Protocol.............................................................................. 8-2 EFI_DEVICE_PATH Protocol........................................................................... 8-2 Device Path Nodes ............................................................................................. 8-3 8.3.1 Generic Device Path Structures ................................................................. 8-3 Hardware Device Path ............................................................................... 8-5 8.3.2 8.3.2.1 PCI Device Path ................................................................................ 8-5 8.3.2.2 PCCARD Device Path ....................................................................... 8-5 8.3.2.3 Memory Mapped Device Path ........................................................... 8-6 8.3.2.4 Vendor Device Path........................................................................... 8-6 8.3.2.5 Controller Device Path....................................................................... 8-6 8.3.3 ACPI Device Path....................................................................................... 8-7 8.3.4 Messaging Device Path.............................................................................. 8-9 8.3.4.1 ATAPI Device Path............................................................................ 8-9 8.3.4.2 SCSI Device Path............................................................................ 8-10 8.3.4.3 Fibre Channel Device Path.............................................................. 8-10 8.3.4.4 1394 Device Path ............................................................................ 8-10 8.3.4.5 USB Device Path............................................................................. 8-11 8.3.4.6 USB Class Device Path................................................................... 8-11 8.3.4.7 I2O Device Path............................................................................... 8-12 8.3.4.8 MAC Address Device Path .............................................................. 8-12 IPv4 Device Path............................................................................. 8-12 8.3.4.9 IPv6 Device Path........................................................................... 8-13 8.3.4.10 8.3.4.11 InfiniBand Device Path .................................................................. 8-13 8.3.4.12 UART Device Path ........................................................................ 8-14 viii 12/01/02 Version 1.10
分享到:
收藏