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
History
Revision Revision History Date
1.0 Official release of EFI 1.10 Specification, revision 1.0. 12/01/02
Version 1.10 12/01/02 iii
Extensible Firmware Interface Specification
iv 12/01/02 Version 1.10
Contents
1 Introduction
1.1 EFI Driver Model Extensions............................................................................... 1-2
1.2 Overview............................................................................................................. 1-3
1.3 Goals .................................................................................................................. 1-6
1.4 Target Audience.................................................................................................. 1-8
1.5 EFI Design Overview .......................................................................................... 1-8
1.6 EFI Driver Model ................................................................................................. 1-9
1.6.1 EFI Driver Model Goals............................................................................ 1-10
1.6.2 Legacy Option ROM Issues...................................................................... 1-11
1.7 Migration Requirements .................................................................................... 1-11
1.7.1 Legacy Operating System Support........................................................... 1-11
1.7.2 Supporting the EFI Specification on a Legacy Platform ............................ 1-11
1.8 Conventions Used in This Document ................................................................ 1-12
1.8.1 Data Structure Descriptions...................................................................... 1-12
1.8.2 Protocol Descriptions ............................................................................... 1-12
1.8.3 Procedure Descriptions ............................................................................ 1-13
1.8.4 Instruction Descriptions ............................................................................ 1-13
1.8.5 Pseudo-Code Conventions....................................................................... 1-14
1.8.6 Typographic Conventions......................................................................... 1-14
2 Overview
2.1 Boot Manager ..................................................................................................... 2-2
2.1.1 EFI Images................................................................................................. 2-2
2.1.2 EFI Applications ......................................................................................... 2-3
2.1.3 EFI OS Loaders ......................................................................................... 2-4
2.1.4 EFI Drivers................................................................................................. 2-4
2.2 Firmware Core .................................................................................................... 2-5
2.2.1 EFI Services............................................................................................... 2-5
2.2.2 Runtime Services ....................................................................................... 2-6
2.3 Calling Conventions ............................................................................................ 2-7
2.3.1 Data Types................................................................................................. 2-7
2.3.2 IA-32 Platforms .......................................................................................... 2-9
2.3.2.1 Handoff State .................................................................................. 2-10
2.3.3 Itanium®-Based Platforms ........................................................................ 2-11
2.3.3.1 Handoff State .................................................................................. 2-12
2.4 Protocols........................................................................................................... 2-12
2.5 EFI Driver Model ............................................................................................... 2-15
2.5.1 Legacy Option ROM Issues...................................................................... 2-17
2.5.1.1 IA-32 16-Bit Real Mode Binaries...................................................... 2-17
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
Version 1.10 12/01/02 v
Extensible Firmware Interface Specification
2.5.2 Driver Initialization.................................................................................... 2-20
2.5.3 Host Bus Controllers ................................................................................ 2-21
2.5.4 Device Drivers.......................................................................................... 2-23
2.5.5 Bus Drivers............................................................................................... 2-24
2.5.6 Platform Components............................................................................... 2-26
2.5.7 Hot-Plug Events ....................................................................................... 2-27
2.6 Requirements ................................................................................................... 2-27
2.6.1 Required Elements................................................................................... 2-28
2.6.2 Platform-Specific Elements ...................................................................... 2-29
2.6.3 Driver-Specific Elements .......................................................................... 2-30
3 Boot Manager
3.1 Firmware Boot Manager...................................................................................... 3-1
3.2 Globally-Defined Variables.................................................................................. 3-5
3.3 Boot Option Variables Default Behavior .............................................................. 3-7
3.4 Boot Mechanisms ............................................................................................... 3-7
3.4.1 Boot via Simple File Protocol...................................................................... 3-7
3.4.1.1 Removable Media Boot Behavior ...................................................... 3-7
3.4.2 Boot via LOAD_FILE Protocol.................................................................... 3-8
3.4.2.1 Network Booting ................................................................................ 3-8
3.4.2.2 Future Boot Media............................................................................. 3-8
4 EFI System Table
4.1 EFI Image Entry Point......................................................................................... 4-1
EFI_IMAGE_ENTRY_POINT........................................................................... 4-1
4.2 EFI Table Header................................................................................................ 4-3
EFI_TABLE_HEADER ..................................................................................... 4-3
4.3 EFI System Table ............................................................................................... 4-4
EFI_SYSTEM_TABLE ..................................................................................... 4-4
4.4 EFI Boot Services Table ..................................................................................... 4-6
EFI_BOOT_SERVICES ................................................................................... 4-6
4.5 EFI Runtime Services Table.............................................................................. 4-11
EFI_RUNTIME_SERVICES ........................................................................... 4-11
4.6 EFI Configuration Table .................................................................................... 4-13
EFI_CONFIGURATION_TABLE .................................................................... 4-13
4.7 EFI Image Entry Point Examples ...................................................................... 4-14
4.7.1 EFI Image Entry Point Examples.............................................................. 4-14
4.7.2 EFI Driver Model Example........................................................................ 4-16
4.7.3 EFI Driver Model Example (Unloadable) .................................................. 4-17
4.7.4 EFI Driver Model Example (Multiple Instances)........................................ 4-18
5 Services — Boot Services
5.1 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
Contents
CheckEvent() ............................................................................................... 5-12
SetTimer().................................................................................................... 5-13
RaiseTPL() .................................................................................................. 5-15
RestoreTPL() ............................................................................................... 5-17
5.2 Memory Allocation Services.............................................................................. 5-18
AllocatePages() ........................................................................................... 5-21
FreePages()................................................................................................. 5-24
GetMemoryMap()......................................................................................... 5-25
AllocatePool() .............................................................................................. 5-29
FreePool().................................................................................................... 5-30
5.3 Protocol Handler Services................................................................................. 5-31
5.3.1 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
5.4 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
5.5 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 Variable Services ................................................................................................ 6-2
GetVariable() ................................................................................................. 6-3
GetNextVariableName()................................................................................. 6-5
SetVariable().................................................................................................. 6-7
6.2 Time Services..................................................................................................... 6-9
GetTime() .................................................................................................... 6-10
SetTime()..................................................................................................... 6-13
GetWakeupTime() ....................................................................................... 6-14
SetWakeupTime()........................................................................................ 6-15
6.3 Virtual Memory Services ................................................................................... 6-16
SetVirtualAddressMap()............................................................................... 6-17
ConvertPointer() .......................................................................................... 6-19
6.4 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
8.1 Device Path Overview......................................................................................... 8-1
8.2 EFI_DEVICE_PATH Protocol.............................................................................. 8-2
EFI_DEVICE_PATH Protocol........................................................................... 8-2
8.3 Device Path Nodes ............................................................................................. 8-3
8.3.1 Generic Device Path Structures ................................................................. 8-3
8.3.2 Hardware Device Path ............................................................................... 8-5
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
8.3.4.9 IPv4 Device Path ............................................................................. 8-12
8.3.4.10 IPv6 Device Path ........................................................................... 8-13
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
Contents
8.3.4.13 Vendor-Defined Messaging Device Path ....................................... 8-14
8.3.4.14 UART Flow Control Messaging Path ............................................. 8-15
8.3.5 Media Device Path ................................................................................... 8-16
8.3.5.1 Hard Drive....................................................................................... 8-16
8.3.5.2 CD-ROM Media Device Path........................................................... 8-17
8.3.5.3 Vendor-Defined Media Device Path................................................. 8-18
8.3.5.4 File Path Media Device Path ........................................................... 8-18
8.3.5.5 Media Protocol Device Path ............................................................ 8-18
8.3.6 BIOS Boot Specification Device Path ....................................................... 8-19
8.4 Device Path Generation Rules.......................................................................... 8-20
8.4.1 Housekeeping Rules ................................................................................ 8-20
8.4.2 Rules with ACPI _HID and _UID .............................................................. 8-20
8.4.3 Rules with ACPI _ADR............................................................................. 8-21
8.4.4 Hardware vs. Messaging Device Path Rules............................................ 8-22
8.4.5 Media Device Path Rules ......................................................................... 8-22
8.4.6 Other Rules.............................................................................................. 8-22
9 Protocols — EFI Driver Model
9.1 EFI Driver Binding Protocol................................................................................. 9-1
EFI_DRIVER_BINDING_PROTOCOL ............................................................. 9-1
EFI_DRIVER_BINDING_PROTOCOL.Supported() ....................................... 9-4
EFI_DRIVER_BINDING_PROTOCOL.Start() .............................................. 9-10
EFI_DRIVER_BINDING_PROTOCOL.Stop() .............................................. 9-18
9.2 EFI Platform Driver Override Protocol ............................................................... 9-23
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL .................................. 9-23
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriver().............. 9-25
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriverPath() ...... 9-27
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.DriverLoaded()........ 9-29
9.3 EFI Bus Specific Driver Override Protocol......................................................... 9-31
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL ............................ 9-31
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL.GetDriver() ....... 9-32
9.4 EFI Driver Configuration Protocol...................................................................... 9-33
EFI_DRIVER_CONFIGURATION_PROTOCOL ............................................ 9-33
EFI_DRIVER_CONFIGURATION_PROTOCOL.SetOptions() ..................... 9-35
EFI_DRIVER_CONFIGURATION_PROTOCOL.OptionsValid()................... 9-38
EFI_DRIVER_CONFIGURATION_PROTOCOL.ForceDefaults()................. 9-40
9.5 EFI Driver Diagnostics Protocol ........................................................................ 9-43
EFI_DRIVER_DIAGNOSTICS_PROTOCOL.................................................. 9-43
EFI_DRIVER_DIAGNOSTICS_PROTOCOL.RunDiagnostics() ................... 9-44
9.6 EFI Component Name Protocol ........................................................................ 9-47
EFI_COMPONENT_NAME_PROTOCOL ...................................................... 9-47
EFI_COMPONENT_NAME_PROTOCOL.GetDriverName() ........................ 9-48
EFI_COMPONENT_NAME_PROTOCOL.GetControllerName() .................. 9-50
Version 1.10 12/01/02 ix
Extensible Firmware Interface Specification
10 Protocols — Console Support
10.1 Console I/O Protocol......................................................................................... 10-1
10.1.1 Overview.................................................................................................. 10-1
10.1.2 ConsoleIn Definition ................................................................................. 10-2
10.2 Simple Input Protocol........................................................................................ 10-4
SIMPLE_INPUT ............................................................................................. 10-4
SIMPLE_INPUT.Reset() .............................................................................. 10-5
SIMPLE_INPUT.ReadKeyStroke()............................................................... 10-6
10.2.1 ConsoleOut or StandardError................................................................... 10-8
10.3 Simple Text Output Protocol ............................................................................. 10-8
SIMPLE_TEXT_OUTPUT Protocol ................................................................ 10-8
SIMPLE_TEXT_OUTPUT.Reset() ............................................................. 10-11
SIMPLE_TEXT_OUTPUT.OutputString()................................................... 10-12
SIMPLE_TEXT_OUTPUT.TestString() ...................................................... 10-16
SIMPLE_TEXT_OUTPUT.QueryMode() .................................................... 10-17
SIMPLE_TEXT_OUTPUT.SetMode() ........................................................ 10-18
SIMPLE_TEXT_OUTPUT.SetAttribute() .................................................... 10-19
SIMPLE_TEXT_OUTPUT.ClearScreen()................................................... 10-21
SIMPLE_TEXT_OUTPUT.SetCursorPosition() .......................................... 10-22
SIMPLE_TEXT_OUTPUT.EnableCursor()................................................. 10-23
10.4 Universal Graphics Adapter Protocols............................................................. 10-24
10.4.1 UGA ROM.............................................................................................. 10-24
10.4.2 UGA Draw Protocol ................................................................................ 10-25
10.4.3 Blt Buffer ................................................................................................ 10-25
10.4.4 UGA I/O Protocol.................................................................................... 10-26
10.4.5 Fallback Mode Driver ............................................................................. 10-26
10.5 UGA Draw Protocol......................................................................................... 10-27
EFI_UGA_DRAW_PROTOCOL................................................................... 10-27
EFI_UGA_DRAW_PROTOCOL.GetMode()............................................... 10-28
EFI_UGA_DRAW_PROTOCOL.SetMode() ............................................... 10-29
EFI_UGA_DRAW_PROTOCOL.Blt() ......................................................... 10-31
10.6 Rules for PCI/AGP Devices ............................................................................ 10-34
10.7 UGA I/O Protocol ............................................................................................ 10-35
EFI_UGA_IO_PROTOCOL.......................................................................... 10-35
EFI_UGA_IO_PROTOCOL.CreateDevice() ............................................... 10-37
EFI_UGA_IO_PROTOCOL.DeleteDevice() ............................................... 10-38
PUGA_FW_SERVICE_DISPATCH.DispatchService()............................... 10-39
10.8 Implementation Rules for an EFI UGA Driver.................................................. 10-42
10.9 UGA Draw Protocol to UGA I/O Protocol Mapping .......................................... 10-43
10.9.1 UGA System Requirements ................................................................... 10-43
10.9.2 System Abstraction Requirements ......................................................... 10-44
10.9.3 Firmware to OS Hand-off........................................................................ 10-44
10.10 Simple Pointer Protocol................................................................................... 10-46
EFI_SIMPLE_POINTER_PROTOCOL......................................................... 10-46
EFI_SIMPLE_POINTER.Reset()................................................................ 10-48
EFI_SIMPLE_POINTER.GetState() ........................................................... 10-49
x 12/01/02 Version 1.10
Contents
10.11 EFI Simple Pointer Device Paths .................................................................... 10-51
10.12 Serial I/O Protocol........................................................................................... 10-55
SERIAL_IO_PROTOCOL............................................................................. 10-55
SERIAL_IO.Reset() ................................................................................... 10-58
SERIAL_IO.SetAttributes() ........................................................................ 10-59
SERIAL_IO.SetControl()............................................................................ 10-61
SERIAL_IO.GetControl()............................................................................ 10-63
SERIAL_IO.Write() .................................................................................... 10-64
SERIAL_IO.Read() .................................................................................... 10-65
11 Protocols — Bootable Image Support
11.1 LOAD_FILE Protocol ........................................................................................ 11-1
LOAD_FILE Protocol...................................................................................... 11-1
LOAD_FILE.LoadFile() ................................................................................ 11-2
11.2 File System Format........................................................................................... 11-4
11.2.1 System Partition ....................................................................................... 11-4
11.2.1.1 File System Format ....................................................................... 11-5
11.2.1.2 File Names.................................................................................... 11-5
11.2.1.3 Directory Structure......................................................................... 11-5
11.2.2 Partition Discovery ................................................................................... 11-7
11.2.2.1 EFI Partition Header ...................................................................... 11-8
11.2.2.2 ISO-9660 and El Torito................................................................ 11-12
11.2.2.3 Legacy Master Boot Record ........................................................ 11-13
11.2.2.4 Legacy Master Boot Record and GPT Partitions ......................... 11-14
11.2.3 Media Formats ....................................................................................... 11-15
11.2.3.1 Removable Media........................................................................ 11-15
11.2.3.2 Diskette ....................................................................................... 11-15
11.2.3.3 Hard Drive................................................................................... 11-16
11.2.3.4 CD-ROM and DVD-ROM............................................................. 11-16
11.2.3.5 Network....................................................................................... 11-16
11.3 File System Protocol ....................................................................................... 11-17
Simple File System Protocol ........................................................................ 11-17
EFI_FILE_IO_INTERFACE.OpenVolume()................................................ 11-19
11.4 EFI_FILE Protocol........................................................................................... 11-20
EFI_FILE Protocol........................................................................................ 11-20
EFI_FILE.Open() ....................................................................................... 11-22
EFI_FILE.Close() ....................................................................................... 11-24
EFI_FILE.Delete()...................................................................................... 11-25
EFI_FILE.Read()........................................................................................ 11-26
EFI_FILE.Write()........................................................................................ 11-27
EFI_FILE.SetPosition() .............................................................................. 11-28
EFI_FILE.GetPosition().............................................................................. 11-29
EFI_FILE.GetInfo() .................................................................................... 11-30
EFI_FILE.SetInfo()..................................................................................... 11-31
EFI_FILE.Flush() ....................................................................................... 11-32
EFI_FILE_INFO ......................................................................................... 11-33
EFI_FILE_SYSTEM_INFO ........................................................................ 11-35
Version 1.10 12/01/02 xi
Extensible Firmware Interface Specification
EFI_FILE_SYSTEM_VOLUME_LABEL ..................................................... 11-36
11.5 DISK_IO Protocol............................................................................................ 11-37
DISK_IO Protocol......................................................................................... 11-37
EFI_DISK_IO.ReadDisk() .......................................................................... 11-39
EFI_DISK_IO.WriteDisk() .......................................................................... 11-40
11.6 BLOCK_IO Protocol........................................................................................ 11-41
BLOCK_IO Protocol ..................................................................................... 11-41
EFI_BLOCK_IO.Reset()............................................................................. 11-44
EFI_BLOCK_IO.ReadBlocks() ................................................................... 11-45
EFI_BLOCK_IO.WriteBlocks() ................................................................... 11-47
EFI_BLOCK_IO.FlushBlocks()................................................................... 11-49
11.7 UNICODE_COLLATION Protocol ................................................................... 11-50
UNICODE_COLLATION Protocol ................................................................ 11-50
UNICODE_COLLATION.StriColl() ............................................................. 11-52
UNICODE_COLLATION.MetaiMatch() ...................................................... 11-53
UNICODE_COLLATION.StrLwr() .............................................................. 11-55
UNICODE_COLLATION.StrUpr() .............................................................. 11-56
UNICODE_COLLATION.FatToStr() ........................................................... 11-57
UNICODE_COLLATION.StrToFat() ........................................................... 11-58
12 Protocols — PCI Bus Support
12.1 PCI Root Bridge I/O Support............................................................................. 12-1
12.1.1 PCI Root Bridge I/O Overview.................................................................. 12-1
12.1.1.1 Sample PCI Architectures.............................................................. 12-4
12.2 PCI Root Bridge I/O Protocol ............................................................................ 12-8
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL .................................................. 12-8
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollMem()............................. 12-16
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollIo().................................. 12-18
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Read()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Write() ......................... 12-20
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Read()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Write() .............................. 12-22
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read()
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write() ............................ 12-24
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.CopyMem() .......................... 12-26
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Map().................................... 12-28
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Unmap() ............................... 12-30
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.AllocateBuffer()..................... 12-31
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.FreeBuffer().......................... 12-33
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Flush().................................. 12-34
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.GetAttributes() ...................... 12-35
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.SetAttributes() ...................... 12-37
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Configuration()...................... 12-40
12.2.1 PCI Root Bridge Device Paths................................................................ 12-42
xii 12/01/02 Version 1.10
Contents
12.3 PCI Driver Model............................................................................................. 12-46
12.3.1 PCI Driver Initialization ........................................................................... 12-46
12.3.1.1 Driver Configuration Protocol....................................................... 12-48
12.3.1.2 Driver Diagnostics Protocol ......................................................... 12-48
12.3.1.3 Component Name Protocol ......................................................... 12-48
12.3.2 PCI Bus Drivers...................................................................................... 12-49
12.3.2.1 Driver Binding Protocol for PCI Bus Drivers................................. 12-50
12.3.2.2 PCI Enumeration ......................................................................... 12-53
12.3.3 PCI Device Drivers ................................................................................. 12-53
12.3.3.1 Driver Binding Protocol for PCI Device Drivers............................ 12-53
12.4 EFI PCI I/O Protocol ....................................................................................... 12-55
EFI_PCI_IO_PROTOCOL............................................................................ 12-56
EFI_PCI_IO_PROTOCOL.PollMem() ........................................................ 12-65
EFI_PCI_IO_PROTOCOL.PollIo() ............................................................. 12-67
EFI_PCI_IO_PROTOCOL.Mem.Read() EFI_PCI_IO_PROTOCOL.
Mem.Write()............................................................................................... 12-69
EFI_PCI_IO_PROTOCOL.Io.Read() EFI_PCI_IO_PROTOCOL.
Io.Write().................................................................................................... 12-71
EFI_PCI_IO_PROTOCOL.Pci.Read() EFI_PCI_IO_PROTOCOL.
Pci.Write().................................................................................................. 12-73
EFI_PCI_IO_PROTOCOL.CopyMem() ...................................................... 12-75
EFI_PCI_IO_PROTOCOL.Map() ............................................................... 12-78
EFI_PCI_IO_PROTOCOL.Unmap()........................................................... 12-80
EFI_PCI_IO_PROTOCOL.AllocateBuffer() ................................................ 12-81
EFI_PCI_IO_PROTOCOL.FreeBuffer() ..................................................... 12-83
EFI_PCI_IO_PROTOCOL.Flush() ............................................................. 12-84
EFI_PCI_IO_PROTOCOL.GetLocation() ................................................... 12-85
EFI_PCI_IO_PROTOCOL.Attributes() ....................................................... 12-86
EFI_PCI_IO_PROTOCOL.GetBarAttributes() ............................................ 12-89
EFI_PCI_IO_PROTOCOL.SetBarAttributes() ............................................ 12-92
12.4.1 PCI Device Paths ................................................................................... 12-94
12.4.2 PCI Option ROMs................................................................................... 12-96
12.4.2.1 PCI Bus Driver Responsibilities ................................................... 12-98
12.4.2.2 PCI Device Driver Responsibilities .............................................. 12-99
12.4.3 Nonvolatile Storage .............................................................................. 12-101
12.4.4 PCI Hot-Plug Events ............................................................................ 12-102
13 Protocols — SCSI Bus Support
13.1 SCSI Pass Thru Protocol .................................................................................. 13-1
EFI_SCSI_PASS_THRU Protocol.................................................................. 13-1
EFI_SCSI_PASS_THRU_PROTOCOL.PassThru() ..................................... 13-5
EFI_SCSI_PASS_THRU_PROTOCOL.GetNextDevice()........................... 13-10
EFI_SCSI_PASS_THRU_PROTOCOL.BuildDevicePath() ........................ 13-12
EFI_SCSI_PASS_THRU_PROTOCOL.GetTargetLun()............................. 13-14
EFI_SCSI_PASS_THRU_PROTOCOL.ResetChannel()............................ 13-16
EFI_SCSI_PASS_THRU_PROTOCOL.ResetTarget()............................... 13-17
13.2 SCSI Pass Thru Device Paths ........................................................................ 13-18
Version 1.10 12/01/02 xiii
Extensible Firmware Interface Specification
14 Protocols — USB Support
14.1 USB Host Controller Protocol............................................................................ 14-1
14.1.1 USB Host Controller Protocol Overview ................................................... 14-1
EFI_USB_HC_PROTOCOL ........................................................................... 14-2
EFI_USB_HC_PROTOCOL.Reset()............................................................ 14-4
EFI_USB_HC_PROTOCOL.GetState() ....................................................... 14-6
EFI_USB_HC_PROTOCOL.SetState()........................................................ 14-8
EFI_USB_HC_PROTOCOL.ControlTransfer()........................................... 14-10
EFI_USB_HC_PROTOCOL.BulkTransfer() ............................................... 14-13
EFI_USB_HC_PROTOCOL.AsyncInterruptTransfer() ............................... 14-16
EFI_USB_HC_PROTOCOL.SyncInterruptTransfer() ................................. 14-19
EFI_USB_HC_PROTOCOL.IsochronousTransfer()................................... 14-21
EFI_USB_HC_PROTOCOL.AsyncIsochronousTransfer() ......................... 14-23
EFI_USB_HC_PROTOCOL.GetRootHubPortNumber()............................. 14-25
EFI_USB_HC_PROTOCOL.GetRootHubPortStatus() ............................... 14-26
EFI_USB_HC_PROTOCOL.SetRootHubPortFeature().............................. 14-30
EFI_USB_HC_PROTOCOL.ClearRootHubPortFeature() .......................... 14-32
14.2 USB Driver Model ........................................................................................... 14-34
14.2.1 Scope..................................................................................................... 14-34
14.2.2 USB Driver Model Overview ................................................................... 14-34
14.2.3 USB Bus Driver ...................................................................................... 14-35
14.2.3.1 USB Bus Driver Entry Point......................................................... 14-35
14.2.3.2 Driver Binding Protocol for USB Bus Drivers ............................... 14-35
14.2.3.3 USB Hot-Plug Event .................................................................... 14-36
14.2.3.4 USB Bus Enumeration................................................................. 14-36
14.2.4 USB Device Driver ................................................................................. 14-37
14.2.4.1 USB Device Driver Entry Point .................................................... 14-37
14.2.4.2 Driver Binding Protocol for USB Device Drivers........................... 14-37
14.2.5 EFI USB I/O Protocol Overview.............................................................. 14-37
EFI_USB_IO Protocol .................................................................................. 14-38
EFI_USB_IO_PROTOCOL.UsbControlTransfer()...................................... 14-40
EFI_USB_IO_PROTOCOL.UsbBulkTransfer()........................................... 14-43
EFI_USB_IO_PROTOCOL.UsbAsyncInterruptTransfer()........................... 14-45
EFI_USB_IO_PROTOCOL.UsbSyncInterruptTransfer() ............................ 14-48
EFI_USB_IO_PROTOCOL.UsbIsochronousTransfer() .............................. 14-50
EFI_USB_IO_PROTOCOL.UsbAsyncIsochronousTransfer()..................... 14-52
EFI_USB_IO_PROTOCOL.UsbGetDeviceDescriptor().............................. 14-54
EFI_USB_IO_PROTOCOL.UsbGetConfigDescriptor()............................... 14-56
EFI_USB_IO_PROTOCOL.UsbGetInterfaceDescriptor()........................... 14-57
EFI_USB_IO_PROTOCOL.UsbGetEndpointDescriptor()........................... 14-59
EFI_USB_IO_PROTOCOL.UsbGetStringDescriptor()................................ 14-61
EFI_USB_IO_PROTOCOL.UsbGetSupportedLanguages()....................... 14-62
EFI_USB_IO_PROTOCOL.UsbPortReset()............................................... 14-63
14.2.6 USB Device Paths.................................................................................. 14-64
14.2.6.1 USB Device Path Node ............................................................... 14-64
14.2.6.2 USB Device Path Example.......................................................... 14-65
xiv 12/01/02 Version 1.10
Contents
15 Protocols — Network Support
15.1 EFI_SIMPLE_NETWORK Protocol ................................................................... 15-1
EFI_SIMPLE_NETWORK Protocol ................................................................ 15-1
EFI_SIMPLE_NETWORK.Start()................................................................. 15-6
EFI_SIMPLE_NETWORK.Stop() ................................................................. 15-7
EFI_SIMPLE_NETWORK.Initialize()............................................................ 15-8
EFI_SIMPLE_NETWORK.Reset() ............................................................... 15-9
EFI_SIMPLE_NETWORK.Shutdown()....................................................... 15-10
EFI_SIMPLE_NETWORK.ReceiveFilters() ................................................ 15-11
EFI_SIMPLE_NETWORK.StationAddress()............................................... 15-13
EFI_SIMPLE_NETWORK.Statistics() ........................................................ 15-14
EFI_SIMPLE_NETWORK.MCastIPtoMAC() .............................................. 15-17
EFI_SIMPLE_NETWORK.NvData()........................................................... 15-18
EFI_SIMPLE_NETWORK.GetStatus()....................................................... 15-20
EFI_SIMPLE_NETWORK.Transmit()......................................................... 15-22
EFI_SIMPLE_NETWORK.Receive().......................................................... 15-24
15.2 NETWORK_INTERFACE_IDENTIFIER Protocol............................................ 15-26
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL.......................... 15-26
15.3 PXE Base Code Protocol................................................................................ 15-29
EFI_PXE_BASE_CODE Protocol................................................................. 15-29
EFI_PXE_BASE_CODE.Start() ................................................................. 15-41
EFI_PXE_BASE_CODE.Stop().................................................................. 15-44
EFI_PXE_BASE_CODE.Dhcp()................................................................. 15-45
EFI_PXE_BASE_CODE.Discover() ........................................................... 15-47
EFI_PXE_BASE_CODE.Mtftp()................................................................. 15-50
EFI_PXE_BASE_CODE.UdpWrite() .......................................................... 15-54
EFI_PXE_BASE_CODE.UdpRead().......................................................... 15-56
EFI_PXE_BASE_CODE.SetIpFilter()......................................................... 15-59
EFI_PXE_BASE_CODE.Arp() ................................................................... 15-60
EFI_PXE_BASE_CODE.SetParameters() ................................................. 15-61
EFI_PXE_BASE_CODE.SetStationIp()...................................................... 15-63
EFI_PXE_BASE_CODE.SetPackets()....................................................... 15-64
15.4 PXE Base Code Callback Protocol ................................................................. 15-66
EFI_PXE_BASE_CODE_CALLBACK Protocol ............................................ 15-66
EFI_PXE_BASE_CODE_CALLBACK.Callback() ....................................... 15-67
15.5 Boot Integrity Services Protocol ...................................................................... 15-69
EFI_BIS_PROTOCOL.................................................................................. 15-69
EFI_BIS.Initialize() ..................................................................................... 15-72
EFI_BIS.Shutdown() .................................................................................. 15-76
EFI_BIS.Free()........................................................................................... 15-78
EFI_BIS.GetBootObjectAuthorizationCertificate() ...................................... 15-79
EFI_BIS.GetBootObjectAuthorizationCheckFlag() ..................................... 15-80
EFI_BIS.GetBootObjectAuthorizationUpdateToken()................................. 15-81
EFI_BIS.GetSignatureInfo()....................................................................... 15-82
Version 1.10 12/01/02 xv
Extensible Firmware Interface Specification
EFI_BIS.UpdateBootObjectAuthorization() ................................................ 15-87
EFI_BIS.VerifyBootObject() ....................................................................... 15-95
EFI_BIS.VerifyObjectWithCredential() ..................................................... 15-102
16 Protocols — Debugger Support
16.1 Overview........................................................................................................... 16-1
16.2 EFI Debug Support Protocol ............................................................................. 16-2
16.2.1 EFI Debug Support Protocol Overview..................................................... 16-2
EFI_DEBUG_SUPPORT_PROTOCOL.......................................................... 16-3
EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex()....... 16-5
EFI_DEBUG_SUPPORT_PROTOCOL.RegisterPeriodicCallback()............. 16-6
EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() ........ 16-10
EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache()......... 16-13
16.3 EFI Debugport Protocol................................................................................... 16-14
16.3.1 EFI Debugport Overview ........................................................................ 16-14
EFI_DEBUGPORT_PROTOCOL................................................................. 16-15
EFI_DEBUGPORT_PROTOCOL.Reset() .................................................. 16-16
EFI_DEBUGPORT_PROTOCOL.Write() ................................................... 16-17
EFI_DEBUGPORT_PROTOCOL.Read() ................................................... 16-18
EFI_DEBUGPORT_PROTOCOL.Poll() ..................................................... 16-19
16.3.2 Debugport Device Path .......................................................................... 16-20
16.3.3 EFI Debugport Variable .......................................................................... 16-21
16.4 EFI Debug Support Table ............................................................................... 16-22
16.4.1 Overview................................................................................................ 16-22
16.4.2 EFI System Table Location .................................................................... 16-24
16.4.3 EFI Image Info........................................................................................ 16-24
17 Protocols — Compression Algorithm Specification
17.1 Algorithm Overview........................................................................................... 17-1
17.2 Data Format...................................................................................................... 17-3
17.2.1 Bit Order................................................................................................... 17-3
17.2.2 Overall Structure ...................................................................................... 17-3
17.2.3 Block Structure......................................................................................... 17-4
17.2.3.1 Block Header................................................................................. 17-4
17.2.3.2 Block Body .................................................................................... 17-7
17.3 Compressor Design .......................................................................................... 17-8
17.3.1 Overall Process........................................................................................ 17-8
17.3.2 String Info Log.......................................................................................... 17-9
17.3.2.1 Data Structures ........................................................................... 17-10
17.3.2.2 Searching the Tree ...................................................................... 17-11
17.3.2.3 Adding String Info........................................................................ 17-11
17.3.2.4 Deleting String Info...................................................................... 17-12
17.3.3 Huffman Code Generation...................................................................... 17-13
17.3.3.1 Huffman Tree Generation ............................................................ 17-13
17.3.3.2 Code Length Adjustment ............................................................. 17-13
17.3.3.3 Code Generation ......................................................................... 17-14
xvi 12/01/02 Version 1.10
Contents
17.4 Decompressor Design..................................................................................... 17-15
17.5 Decompress Protocol...................................................................................... 17-16
EFI_DECOMPRESS_PROTOCOL .............................................................. 17-16
EFI_DECOMPRESS_PROTOCOL.GetInfo() ............................................. 17-17
EFI_DECOMPRESS_PROTOCOL.Decompress()..................................... 17-19
18 Protocols — Device I/O Protocol
18.1 Device I/O Overview ......................................................................................... 18-1
18.2 DEVICE_IO Protocol......................................................................................... 18-2
DEVICE_IO Protocol...................................................................................... 18-2
DEVICE_IO.Mem(), .Io(), and .Pci() ............................................................. 18-5
DEVICE_IO.PciDevicePath() ....................................................................... 18-7
DEVICE_IO.Map() ....................................................................................... 18-8
DEVICE_IO.Unmap()................................................................................. 18-10
DEVICE_IO.AllocateBuffer() ...................................................................... 18-11
DEVICE_IO.Flush() ................................................................................... 18-13
DEVICE_IO.FreeBuffer() ........................................................................... 18-14
19 EFI Byte Code Virtual Machine
19.1 Overview........................................................................................................... 19-1
19.1.1 Processor Architecture Independence...................................................... 19-1
19.1.2 OS Independent ....................................................................................... 19-2
19.1.3 EFI Compliant .......................................................................................... 19-2
19.1.4 Coexistence of Legacy Option ROMs....................................................... 19-2
19.1.5 Relocatable Image ................................................................................... 19-2
19.1.6 Size Restrictions Based on Memory Available.......................................... 19-3
19.2 Memory Ordering .............................................................................................. 19-3
19.3 Virtual Machine Registers ................................................................................. 19-3
19.4 Natural Indexing................................................................................................ 19-5
19.4.1 Sign Bit..................................................................................................... 19-5
19.4.2 Bits Assigned to Natural Units .................................................................. 19-6
19.4.3 Constant................................................................................................... 19-6
19.4.4 Natural Units ............................................................................................ 19-6
19.5 EBC Instruction Operands ................................................................................ 19-7
19.5.1 Direct Operands ....................................................................................... 19-7
19.5.2 Indirect Operands..................................................................................... 19-7
19.5.3 Indirect with Index Operands.................................................................... 19-8
19.5.4 Immediate Operands................................................................................ 19-8
19.6 EBC Instruction Syntax ..................................................................................... 19-9
19.7 Instruction Encoding ......................................................................................... 19-9
19.7.1 Instruction Opcode Byte Encoding ......................................................... 19-10
19.7.2 Instruction Operands Byte Encoding ...................................................... 19-10
19.7.3 Index/Immediate Data Encoding............................................................. 19-11
19.8 EBC Instruction Set......................................................................................... 19-11
ADD........................................................................................................... 19-12
AND........................................................................................................... 19-13
ASHR ........................................................................................................ 19-14
BREAK ...................................................................................................... 19-15
Version 1.10 12/01/02 xvii
Extensible Firmware Interface Specification
CALL ......................................................................................................... 19-17
CMP .......................................................................................................... 19-20
CMPI ......................................................................................................... 19-22
DIV ............................................................................................................ 19-24
DIVU.......................................................................................................... 19-25
EXTNDB.................................................................................................... 19-26
EXTNDD.................................................................................................... 19-27
EXTNDW................................................................................................... 19-28
JMP ........................................................................................................... 19-29
JMP8 ......................................................................................................... 19-31
LOADSP.................................................................................................... 19-32
MOD.......................................................................................................... 19-33
MODU ....................................................................................................... 19-34
MOV .......................................................................................................... 19-35
MOVI ......................................................................................................... 19-37
MOVIn ....................................................................................................... 19-39
MOVn ........................................................................................................ 19-41
MOVREL ................................................................................................... 19-43
MOVsn ...................................................................................................... 19-44
MUL........................................................................................................... 19-46
MULU ........................................................................................................ 19-47
NEG........................................................................................................... 19-48
NOT........................................................................................................... 19-49
OR............................................................................................................. 19-50
POP........................................................................................................... 19-51
POPn......................................................................................................... 19-52
PUSH ........................................................................................................ 19-53
PUSHn ...................................................................................................... 19-54
RET ........................................................................................................... 19-55
SHL ........................................................................................................... 19-56
SHR........................................................................................................... 19-57
STORESP ................................................................................................. 19-58
SUB........................................................................................................... 19-59
XOR........................................................................................................... 19-60
19.9 Runtime and Software Conventions ................................................................ 19-61
19.9.1 Calling Outside VM................................................................................. 19-61
19.9.2 Calling Inside VM ................................................................................... 19-61
19.9.3 Parameter Passing................................................................................. 19-61
19.9.4 Return Values ........................................................................................ 19-61
19.9.5 Binary Format......................................................................................... 19-61
19.10 Architectural Requirements............................................................................. 19-61
19.10.1 EBC Image Requirements...................................................................... 19-62
19.10.2 EBC Execution Interfacing Requirements............................................... 19-62
19.10.3 Interfacing Function Parameters Requirements...................................... 19-62
19.10.4 Function Return Requirements............................................................... 19-62
19.10.5 Function Return Values Requirements................................................... 19-62
xviii 12/01/02 Version 1.10
Contents
19.11 EBC Interpreter Protocol................................................................................. 19-63
EFI_EBC_PROTOCOL ................................................................................ 19-63
EFI_EBC_PROTOCOL.CreateThunk() ...................................................... 19-65
EFI_EBC_PROTOCOL.UnloadImage() ..................................................... 19-66
EFI_EBC_PROTOCOL.RegisterICacheFlush().......................................... 19-67
EFI_EBC_PROTOCOL.GetVersion()......................................................... 19-69
19.12 EBC Tools....................................................................................................... 19-70
19.12.1 EBC C Compiler..................................................................................... 19-70
19.12.2 C Coding Convention ............................................................................. 19-70
19.12.3 EBC Interface Assembly Instructions...................................................... 19-70
19.12.4 Stack Maintenance and Argument Passing ............................................ 19-70
19.12.5 Native to EBC Arguments Calling Convention ........................................ 19-71
19.12.6 EBC to Native Arguments Calling Convention ........................................ 19-71
19.12.7 EBC to EBC Arguments Calling Convention........................................... 19-71
19.12.8 Function Returns.................................................................................... 19-71
19.12.9 Function Return Values .......................................................................... 19-71
19.12.10 Thunking ................................................................................................ 19-72
19.12.10.1 Thunking EBC to Native Code .................................................... 19-72
19.12.10.2 Thunking Native Code to EBC .................................................... 19-73
19.12.10.3 Thunking EBC to EBC ................................................................ 19-73
19.12.11 EBC Linker............................................................................................. 19-74
19.12.12 Image Loader......................................................................................... 19-74
19.12.13 Debug Support....................................................................................... 19-74
19.13 VM Exception Handling................................................................................... 19-75
19.13.1 Divide By 0 Exception ............................................................................ 19-75
19.13.2 Debug Break Exception.......................................................................... 19-75
19.13.3 Invalid Opcode Exception....................................................................... 19-75
19.13.4 Stack Fault Exception............................................................................. 19-75
19.13.5 Alignment Exception............................................................................... 19-75
19.13.6 Instruction Encoding Exception .............................................................. 19-75
19.13.7 Bad Break Exception.............................................................................. 19-76
19.13.8 Undefined Exception .............................................................................. 19-76
19.14 Option ROM Formats...................................................................................... 19-76
19.14.1 EFI Drivers for PCI Add-in Cards............................................................ 19-76
19.14.2 Non-PCI Bus Support ............................................................................. 19-76
Appendix A GUID and Time Formats ............................................................................. A-1
Appendix B Console
B.1 SIMPLE_INPUT .................................................................................................. B-1
B.2 SIMPLE_TEXT_OUTPUT ................................................................................... B-2
Appendix C Device Path Examples
C.1 Example Computer System.................................................................................C-1
C.2 Legacy Floppy ....................................................................................................C-2
C.3 IDE Disk.............................................................................................................. C-3
C.4 Secondary Root PCI Bus with PCI to PCI Bridge ................................................C-5
C.5 ACPI Terms ........................................................................................................ C-6
C.6 EFI Device Path as a Name Space.....................................................................C-7
Version 1.10 12/01/02 xix
Extensible Firmware Interface Specification
Appendix D Status Codes.................................................................................................D-1
Appendix E 32/64-Bit UNDI Specification
E.1 Introduction......................................................................................................... E-1
E.1.1 Definitions .................................................................................................. E-1
E.1.2 Referenced Specifications.......................................................................... E-3
E.1.3 OS Network Stacks .................................................................................... E-5
E.2 Overview............................................................................................................. E-7
E.2.1 32/64-bit UNDI Interface.............................................................................E-7
E.2.2 UNDI Command Format........................................................................... E-13
E.3 UNDI C Definitions............................................................................................ E-15
E.3.1 Portability Macros..................................................................................... E-15
E.3.2 Miscellaneous Macros.............................................................................. E-18
E.3.3 Portability Types....................................................................................... E-18
E.3.4 Simple Types ........................................................................................... E-20
E.3.5 Compound Types..................................................................................... E-33
E.4 UNDI Commands.............................................................................................. E-38
E.4.1 Command Linking and Queuing ............................................................... E-39
E.4.2 Get State.................................................................................................. E-41
E.4.3 Start ......................................................................................................... E-43
E.4.4 Stop .........................................................................................................E-48
E.4.5 Get Init Info............................................................................................... E-49
E.4.6 Get Config Info ......................................................................................... E-53
E.4.7 Initialize.................................................................................................... E-56
E.4.8 Reset........................................................................................................E-60
E.4.9 Shutdown................................................................................................. E-62
E.4.10 Interrupt Enables...................................................................................... E-64
E.4.11 Receive Filters ......................................................................................... E-66
E.4.12 Station Address........................................................................................ E-69
E.4.13 Statistics...................................................................................................E-71
E.4.14 MCast IP To MAC ....................................................................................E-74
E.4.15 NvData..................................................................................................... E-76
E.4.16 Get Status................................................................................................ E-80
E.4.17 Fill Header................................................................................................ E-83
E.4.18 Transmit................................................................................................... E-86
E.4.19 Receive.................................................................................................... E-90
E.5 UNDI as an EFI Runtime Driver ........................................................................ E-93
Appendix F Using the Simple Pointer Protocol ........................................................... F-1
Appendix G Using the EFI SCSI Pass Thru Protocol..................................................G-1
Appendix H Compression Source Code........................................................................H-1
Appendix I Decompression Source Code ...................................................................... I-1
Appendix J EFI Byte Code Virtual Machine Opcode Summary................................J-1
Appendix K Alphabetic Function Lists.....................................................................................K-1
xx 12/01/02 Version 1.10
Contents
References
Related Information.......................................................................................... References-1
Prerequisite Specifications ............................................................................... References-5
ACPI Specification.................................................................................... References-5
WfM Specification..................................................................................... References-5
Additional Considerations for Itanium-Based Platforms ............................ References-6
Glossary
................................................................................................................... Glossary-1
Index................................................................................................................................Index-1
Figures
1-1. EFI Conceptual Overview ...................................................................................... 9
2-1. Booting Sequence.................................................................................................. 1
2-2. Stack after AddressOfEntryPoint Called, IA-32 ..............................................10
2-3. Stack after AddressOfEntryPoint Called, Itanium-based Systems..................12
2-4. Construction of a Protocol.....................................................................................13
2-5. Desktop System....................................................................................................16
2-6. Server System ......................................................................................................16
2-7. Image Handle .......................................................................................................20
2-8. Driver Image Handle .............................................................................................21
2-9. Host Bus Controllers .............................................................................................22
2-10. PCI Root Bridge Device Handle............................................................................22
2-11. Connecting Device Drivers....................................................................................23
2-12. Connecting Bus Drivers ........................................................................................25
2-13. Child Device Handle with a Bus Specific Override ................................................26
5-1. Device Handle to Protocol Handler Mapping.........................................................32
5-2. Handle Database ..................................................................................................34
10-1. Software BLT Buffer..............................................................................................25
10-2. Fallback Mode Driver ............................................................................................26
11-1. Nesting of Legacy MBR Partition Records ............................................................. 7
11-2. GUID Partition Table (GPT) Scheme ..................................................................... 9
12-1. Host Bus Controllers.............................................................................................. 2
12-2. Device Handle for a PCI Root Bridge Controller..................................................... 3
12-3. Desktop System with One PCI Root Bridge ........................................................... 4
12-4. Server System with Four PCI Root Bridges............................................................ 5
12-5. Server System with Two PCI Segments................................................................. 6
12-6. Server System with Two PCI Host Buses............................................................... 7
12-7. Image Handle .......................................................................................................46
12-8. PCI Driver Image Handle ......................................................................................47
12-9. PCI Host Bus Controller ........................................................................................49
12-10. Device Handle for a PCI Host Bus Controller ........................................................49
12-11. Physical PCI Bus Structure ...................................................................................50
Version 1.10 12/01/02 xxi
Extensible Firmware Interface Specification
12-12. Connecting a PCI Bus Driver ................................................................................51
12-13. Child Handle Created by a PCI Bus Driver............................................................51
12-14. Connecting a PCI Device Driver............................................................................54
12-15. Recommended PCI Driver Image Layout ..............................................................99
14-1. Software Triggered State Transitions of a USB Host Controller ............................. 8
14-2. USB Bus Controller Handle...................................................................................34
16-1. Debug Support Table Indirection and Pointer Usage ............................................23
17-1. Bit Sequence of Compressed Data ........................................................................ 3
17-2. Compressed Data Structure................................................................................... 4
17-3. Block Structure ...................................................................................................... 4
17-4. Block Body............................................................................................................. 7
17-5. String Info Log Search Tree ..................................................................................10
17-6. Node Split .............................................................................................................12
C-1. Example Computer System.................................................................................... 1
C-2. Partial ACPI Name Space for Example System ..................................................... 2
C-3. EFI Device Path Displayed As a Name Space ....................................................... 7
E-1. Network Stacks with Three Classes of Drivers....................................................... 5
E-2. !PXE Structures for H/W and S/W UNDI ................................................................ 7
E-3. Issuing UNDI Commands......................................................................................12
E-4. UNDI Command Descriptor Block (CDB) ..............................................................13
E-5. Storage Types ......................................................................................................18
E-6. UNDI States, Transitions & Valid Commands .......................................................38
E-7. Linked CDBs.........................................................................................................39
E-8. Queued CDBs.......................................................................................................40
Tables
1-1. Organization of the EFI Specification ..................................................................... 3
EFI Runtime Services ............................................................................................ 6
2-1.
2-2. Common EFI Data Types....................................................................................... 7
2-3. Modifiers for Common EFI Data Types .................................................................. 8
2-4. EFI Protocols ........................................................................................................14
2-5. Required EFI Implementation Elements................................................................28
Global Variables..................................................................................................... 5
3-1
3-2 EFI Image Types.................................................................................................... 8
Event, Timer, and Task Priority Functions.............................................................. 2
5-1.
5-2. TPL Usage............................................................................................................. 3
5-3. TPL Restrictions..................................................................................................... 4
5-4. Memory Allocation Functions ................................................................................18
5-5. Memory Type Usage before ExitBootServices() ...........................................19
xxii 12/01/02 Version 1.10
Contents
5-6. Memory Type Usage after ExitBootServices() ..............................................20
5-7. Protocol Interface Functions .................................................................................31
5-8. Image Type Differences Summary........................................................................76
5-9. Image Functions ...................................................................................................77
5-10. Miscellaneous Boot Services Functions ................................................................86
Variable Services Functions................................................................................... 2
6-1.
6-2. Time Services Functions........................................................................................ 9
6-3. Virtual Memory Functions .....................................................................................16
6-4. Miscellaneous Runtime Services ..........................................................................20
Generic Device Path Node Structure ..................................................................... 3
8-1.
8-2. Device Path End Structure..................................................................................... 4
8-3. PCI Device Path..................................................................................................... 5
8-4. PCCARD Device Path............................................................................................ 5
8-5. Memory Mapped Device Path ................................................................................ 6
8-6. Vendor-Defined Device Path.................................................................................. 6
8-7. Controller Device Path ........................................................................................... 6
8-8. ACPI Device Path .................................................................................................. 8
8-9. Expanded ACPI Device Path ................................................................................. 8
8-10. ATAPI Device Path ................................................................................................ 9
8-11. SCSI Device Path .................................................................................................10
8-12. Fibre Channel Device Path ...................................................................................10
8-13. 1394 Device Path..................................................................................................10
8-14. USB Device Path ..................................................................................................11
8-15. USB Class Device Path ........................................................................................11
8-16. I2O Device Path.....................................................................................................12
8-17. MAC Address Device Path....................................................................................12
8-18. IPv4 Device Path ..................................................................................................12
8-19. IPv6 Device Path ..................................................................................................13
8-20. InfiniBand Device Path..........................................................................................13
8-21. UART Device Path................................................................................................14
8-22. Vendor-Defined Messaging Device Path...............................................................14
8-23. UART Flow Control Messaging Device Path.........................................................15
8-24. Hard Drive Media Device Path..............................................................................16
8-25. CD-ROM Media Device Path ................................................................................17
8-26. Vendor-Defined Media Device Path ......................................................................18
8-27. File Path Media Device Path.................................................................................18
8-28. Media Protocol Media Device Path .......................................................................18
8-29. BIOS Boot Specification Device Path....................................................................19
8-30. ACPI _CRS to EFI Device Path Mapping..............................................................20
8-31. ACPI _ADR to EFI Device Path Mapping..............................................................21
9-1.
EFI Driver Configuration Default Type...................................................................41
Supported Unicode Control Characters.................................................................. 2
10-1.
10-2. EFI Scan Codes for SIMPLE_INPUT_INTERFACE ................................................ 3
Version 1.10 12/01/02 xxiii
Extensible Firmware Interface Specification
10-3. EFI Cursor Location/Advance Rules .....................................................................14
10-4. Blt Operation Table ...............................................................................................33
10-5. PS/2 Mouse Device Path ......................................................................................51
10-6. Serial Mouse Device Path.....................................................................................52
10-7. USB Mouse Device Path.......................................................................................54
GUID Partition Table Header ................................................................................. 9
11-1.
11-2. GUID Partition Entry .............................................................................................11
11-3. Defined GUID Partition Entry - Partition Type GUIDs............................................12
11-4. Defined GUID Partition Entry - Attributes ..............................................................12
11-5. Legacy Master Boot Record..................................................................................13
11-6. Legacy Master Boot Record Partition Record .......................................................14
11-7. PMBR Entry to Precede a GUID Partition Table Header.......................................15
PCI Configuration Address....................................................................................25
12-1.
12-2. ACPI 2.0 QWORD Address Space Descriptor ......................................................41
12-3. ACPI 2.0 End Tag .................................................................................................41
12-4. PCI Root Bridge Device Path for a Desktop System .............................................42
12-5. PCI Root Bridge Device Path for Bridge #0 in a Server System ............................43
12-6. PCI Root Bridge Device Path for Bridge #1 in a Server System ............................43
12-7. PCI Root Bridge Device Path for Bridge #2 in a Server System ............................44
12-8. PCI Root Bridge Device Path for Bridge #3 in a Server System ............................44
12-9. PCI Root Bridge Device Path Using Expanded ACPI Device Path........................45
12-10. ACPI 2.0 QWORD Address Space Descriptor ......................................................90
12-11. ACPI 2.0 End Tag.................................................................................................90
12-12. PCI Device 7, Function 0 on PCI Root Bridge 0 ....................................................94
12-13. PCI Device 7, Function 0 behind PCI to PCI bridge ..............................................95
12-14. Standard PCI Expansion ROM Header .................................................................97
12-15. PCIR Data Structure .............................................................................................97
12-16. PCI Expansion ROM Code Types.........................................................................97
12-17. EFI PCI Expansion ROM Header ..........................................................................98
12-18. Recommended PCI Device Driver Layout ...........................................................100
Single Channel PCI SCSI Controller .....................................................................18
13-1.
13-2. Single Channel PCI SCSI Controller behind a PCI Bridge.....................................19
13-3. Channel #3 of a PCI SCSI Controller behind a PCI Bridge....................................20
USB Hub Port Status Bitmap ................................................................................27
14-1.
14-2. Hub Port Change Status Bitmap ...........................................................................28
14-3. USB Port Feature..................................................................................................31
14-4. USB Device Path Examples..................................................................................65
14-5. Another USB Device Path Example ......................................................................66
PXE Tag Definitions for EFI ..................................................................................39
15-1.
15-2. Destination IP Filter Operation ..............................................................................57
15-3. Destination UDP Port Filter Operation...................................................................57
15-4. Source IP Filter Operation.....................................................................................58
15-5. Source UDP Port Filter Operation .........................................................................58
xxiv 12/01/02 Version 1.10
Contents
16-1. Debugport Messaging Device Path ..........................................................................20
Block Header Fields............................................................................................... 5
17-1.
PCI Address........................................................................................................... 6
18-1.
General Purpose VM Registers.............................................................................. 3
19-1.
19-2. Dedicated VM Registers ........................................................................................ 4
19-3. VM Flags Register ................................................................................................. 4
19-4. Index Encoding...................................................................................................... 5
19-5. Index Size in Index Encoding................................................................................. 6
19-6. Opcode Byte Encoding .........................................................................................10
19-7. Operand Byte Encoding........................................................................................10
19-8. ADD Instruction Encoding .....................................................................................12
19-9. AND Instruction Encoding .....................................................................................13
19-10. ASHR Instruction Encoding...................................................................................14
19-11. VM Version format ................................................................................................15
19-12. BREAK Instruction Encoding.................................................................................16
19-13. CALL Instruction Encoding....................................................................................18
19-14. CMP Instruction Encoding.....................................................................................21
19-15. CMPI Instruction Encoding....................................................................................23
19-16. DIV Instruction Encoding.......................................................................................24
19-17. DIVU Instruction Encoding....................................................................................25
19-19. EXTNDD Instruction Encoding ..............................................................................27
19-20. EXTNDW Instruction Encoding .............................................................................28
19-21. JMP Instruction Encoding .....................................................................................30
19-22. JMP8 Instruction Encoding ...................................................................................31
19-23. LOADSP Instruction Encoding ..............................................................................32
19-24. MOD Instruction Encoding ....................................................................................33
19-25. MODU Instruction Encoding..................................................................................34
19-26. MOV Instruction Encoding ....................................................................................36
19-27. MOVI Instruction Encoding ...................................................................................37
19-28. MOVIn Instruction Encoding..................................................................................39
19-29. MOVn Instruction Encoding ..................................................................................41
19-30. MOVREL Instruction Encoding..............................................................................43
19-31. MOVsn Instruction Encoding.................................................................................44
19-32. MUL Instruction Encoding.....................................................................................46
19-33. MULU Instruction Encoding ..................................................................................47
19-34. NEG Instruction Encoding.....................................................................................48
19-35. NOT Instruction Encoding.....................................................................................49
19-36. OR Instruction Encoding.........................................................................................50
19-37. POP Instruction Encoding ......................................................................................51
19-38. POPn Instruction Encoding ....................................................................................52
19-39. PUSH Instruction Encoding ....................................................................................53
19-40. PUSHn Instruction Encoding ..................................................................................54
19-41. RET Instruction Encoding.......................................................................................55
19-42. SHL Instruction Encoding .......................................................................................56
Version 1.10 12/01/02 xxv
Extensible Firmware Interface Specification
19-43. SHR Instruction Encoding ......................................................................................57
19-44. STORESP Instruction Encoding.............................................................................58
19-45. SUB Instruction Encoding.......................................................................................59
19-46. XOR Instruction Encoding ......................................................................................60
EFI GUID Format................................................................................................... 1
A-1.
B-1.
EFI Scan Codes for SIMPLE_INPUT ..................................................................... 1
B-2. Control Sequences That Can Be Used to Implement SIMPLE_TEXT_OUTPUT ...... 2
C-1.
Legacy Floppy Device Path.................................................................................... 3
C-2. IDE Disk Device Path............................................................................................. 4
C-3. Secondary Root PCI Bus with PCI to PCI Bridge Device Path ............................... 5
EFI_STATUS Codes Ranges................................................................................. 1
D-1.
D-2. EFI_STATUS Success Codes (High Bit Clear) ...................................................... 1
D-3. EFI_STATUS Error Codes (High Bit Set)............................................................... 1
D-4. EFI_STATUS Warning Codes (High Bit Clear)....................................................... 2
E-1. Definitions................................................................................................................... 1
E-2. Referenced Specifications .......................................................................................... 3
E-3. Driver Types: Pros and Cons ..................................................................................... 6
E-4. !PXE Structure Field Definitions.................................................................................. 8
E-5. UNDI CDB Field Definitions .......................................................................................13
EBC Virtual Machine Opcode Summary................................................................. 1
J-1.
K-1. Functions Listed in Alphabetic Order .......................................................................... 1
K-2. Functions Listed Alphabetically within a Service or Protocol ......................................19
xxvi 12/01/02 Version 1.10
1
Introduction
This Extensible Firmware Interface (hereafter known as EFI) Specification describes an interface
between the operating system (OS) and the platform firmware. The interface is in the form of
data tables that contain platform-related information, and boot and runtime service calls that are
available to the OS loader and the OS. Together, these provide a standard environment for
bootinganOS.
The EFI specification is designed as a pure interface specification. As such, the specification
defines the set of interfaces and structures that platform firmware must implement. Similarly, the
specification defines the set of interfaces and structures that the OS may use in booting. How either
the firmware developer chooses to implement the required elements or the OS developer chooses to
make use of those interfaces and structures is an implementation decision left for the developer.
The intent of this specification is to define a way for the OS and platform firmware to communicate
only information necessary to support the OS boot process. This is accomplished through a formal
and complete abstract specification of the software-visible interface presented to the OS by the
platform and firmware.
®
Using this formal definition, a shrink-wrap OS intended to run on Intel
platforms will be able to boot on a variety of system designs without further platform or OS
customization. The definition will also allow for platform innovation to introduce new features and
functionality that enhance platform capability without requiring new code to be written in the OS
boot sequence.
architecture-based
Furthermore, an abstract specification opens a route to replace legacy devices and firmware code
over time. New device types and associated code can provide equivalent functionality through the
same defined abstract interface, again without impact on the OS boot support code.
The EFI specification is primarily intended for the next generation of 32-bit Intel architecture
(IA-32) and Itanium
hardware platforms from mobile systems to servers. The specification provides a core set of
services along with a selection of protocol interfaces. The selection of protocol interfaces can
evolve over time to be optimized for various platform market segments. At the same time the
specification allows maximum extensibility and customization abilities for OEMs to allow
differentiation. In this, the purpose of EFI is to define an evolutionary path from the traditional
“PC-AT”-style boot world into a legacy-API free environment.
®
-based computers. Thus, the specification is applicable to a full range of
Version 1.10 12/01/02 1-1
Extensible Firmware Interface Specification
1.1 EFI Driver Model Extensions
Access to boot devices is provided through a set of protocol interfaces. The EFI 1.02 Specification
describes these protocol interfaces in detail. However, it does not describe how these protocol
interfaces are produced by the system firmware. The EFI 1.10 Specification includes extensions to
the EFI 1.02 Specification that describe the EFI Driver Model along with additional protocol
interfaces that provide access to a richer set of boot devices. One purpose of the EFI Driver Model
is to provide a replacement for “PC-AT”-style option ROMs. It is important to point out that
drivers written to the EFI Driver Model are designed to access boot devices in the preboot
environment. They are not designed to replace the high performance OS specific drivers. The
EFI 1.10 Specification is designed to be backward compatible with the EFI 1.02 Specification .
This means that any EFI applications or drivers written to the EFI 1.02 Specification will continue
to function on system firmware that complies with the EFI 1.10 Specification.
The EFI Driver Model is designed to support the execution of modular pieces of code, also known
as drivers that run in the preboot environment. These drivers may manage or control hardware
buses and devices on the platform or they may provide some software derived platform specific
service.
The EFI Driver Model is designed to extend the EFI Specification in a way that supports device
drivers and bus drivers. These extensions are provided in the form of new protocols, new boot
services, and updated EFI boot services that are backward compatible with their original versions.
The EFI Driver Model also contains information required by EFI driver writers to design and
implement any combination of bus drivers and device drivers that a platform may need to boot an
EFI compliant OS.
The EFI Driver Model is designed to be generic and can be adapted to any type of bus or device.
The EFI 1.10 Specification describes how to write PCI bus drivers, PCI device drivers, USB bus
drivers, USB device drivers, and SCSI drivers. Additions details are provided that allow EFI
drivers to be stored in PCI option ROMs while maintaining compatibility with legacy option
ROM images.
One of the design goals in the EFI 1.10 Specification is to keep the driver images as small as
possible. However, if a driver is required to support multiple processor architectures, a driver
object file would have to be shipped for each supported processor architecture. To address this
space issue, the EFI 1.10 Specification also defines the EFI Byte Code Virtual Machine.AnEFI
driver can be compiled into a single EFI Byte Code Virtual Machine object file. EFI 1.10
complaint firmware must contain an EFI Byte Code interpreter. This allows a single EFI Byte
Code object file to be shipped that supports multiple processor architectures. Another space saving
technique is the use of compression. The EFI 1.10 Specification defines compression and
decompression algorithms that may be used to reduce the size of EFI drivers, and thus reduce the
overhead when EFI drivers are stored in ROM devices.
The information contained in the EFI 1.10 Specification can be used by OSVs, IHVs, OEMs, and
firmware vendors to design and implement EFI firmware, EFI drivers that produce standard
protocol interfaces, and EFI operating system loaders that can be used to boot EFI compliant
operating systems.
1-2 12/01/02 Version 1.10
1.2 Overview
This EFI 1.10 Specification is organized as listed in Table 1-1.
Table 1-1. Organization of the EFI Specification
Chapter/Appendix Description
1. Introduction Introduces the EFI Specification and topics related to using the
specification.
2. Overview Describes the major components of EFI, including the boot
manager, firmware core, calling conventions, protocols, and
requirements.
3. Boot Manager Describes the boot manager, which is used to load EFI drivers
and EFI applications.
4. EFI System Table Describes the EFI System Table that is passed to every EFI
driver and EFI application.
5. Services — Boot Services Contains the definitions of the fundamental services that are
present in an EFI-compliant system before an OS is booted.
6. Services — Runtime Services Contains definitions for the fundamental services that are
present in an EFI-compliant system before and after an OS is
booted.
7. Protocols — EFI Loaded Image Defines the EFI Loaded Image Protocol that describes an EFI
Image that has been loaded into memory.
8. Protocols — Device Path Protocol Defines the device path protocol and provides the information
needed to construct and manage device paths in the EFI
environment.
9. Protocols — EFI Driver Model Describes a generic driver model for EFI. This includes the set
of services and protocols that apply to every bus and device
type. These protocols include the Driver Binding Protocol, the
Platform Driver Override Protocol, the Bus Specific Driver
Override Protocol, the Driver Diagnostics Protocol, the Driver
Configuration Protocol, and the Component Name Protocol.
10. Protocols — Console Support Defines the Console I/O protocols, which handle input and output
of text-based information intended for the system user while
executing in the EFI boot services environment. These protocols
include the Simple Input Protocol, the Simple Text Output
Protocol, the Universal Graphics Adapter (UGA) Protocol, the
Simple Pointer Protocol, and the Serial I/O Protocol.
Introduction
continued
Version 1.10 12/01/02 1-3
Extensible Firmware Interface Specification
Table 1-1. Organization of the EFI Specification (continued)
Chapter/Appendix Description
11. Protocols — Bootable Image
Support
12. Protocols — PCI Bus Support Defines PCI Bus Drivers, PCI Device Drivers, and PCI Option
13. Protocols — SCSI Bus Support Defines the SCSI Pass Thru Protocol that is used to abstract
14. Protocols — USB Support Defines USB Bus Drivers and USB Device Drivers. The
15. Protocols — Network Support Defines the protocols that provide access to network devices
16. Protocols — Debugger Support An optional set of protocols that provide the services required to
17. Protocols — Compression
Algorithm Specification
18. Protocols — Device I/O Protocol Defines the Device I/O protocol, which is used by code running
Defines the protocols that provide access to bootable images
while executing in the EFI boot services environment. It also
describes the supported disk layouts including MBR, El Torito,
and the Guided Partition Table (GPT). These protocols include
the Load File Protocol, the Simple File System Protocol, the Disk
I/O Protocol, the Block I/O Protocol, and the Unicode Collation
Protocol.
ROM layouts. The protocols described include the PCI Root
Bridge I/O Protocol and the PCI I/O Protocol.
access to a SCSI channel that is produced by a SCSI host
controller.
protocols described include the USB Host Controller Protocol
and the USB I/O Protocol.
while executing in the EFI boot services environment. These
protocols include the Simple Network Protocol, the PXE Base
Code Protocol, and the Boot Integrity services (BIS) Protocol.
implement a source level debugger for the EFI environment.
The EFI DebugPort Protocol provides services to communicate
with a remote debug host. The Debug Support Protocol provides
services to hook processor exceptions, save the processor
context, and restore the processor context. These protocols can
be used in the implementation of a debug agent on the target
system that interacts with the remote debug host.
Describes in detail the EFI compression/decompression
algorithm, as well as the EFI Decompress Protocol. The EFI
Decompress Protocol provides a standard decompression
interface for use at boot time. The EFI Decompress Protocol is
used by a PCI Bus Driver to decompress EFI drivers stored in
PCI Option ROMs.
in the EFI boot services environment to access memory and I/O.
continued
1-4 12/01/02 Version 1.10