1084
Extensible Firmware Interface Specification Version 1.10 December 1, 2002

Extensible Firmware Interface Specification€¦ · Version 1.10 12/01/02 iii History Revision Revision History Date 1.0 Official release of EFI 1.10 Specification, revision 1.0

  • Upload
    others

  • View
    21

  • Download
    0

Embed Size (px)

Citation preview

  • Extensible Firmware Interface

    Specification

    Version 1.10

    December 1, 2002

  • Extensible Firmware Interface Specification

    ii 12/01/02 Version 1.10

    Acknowledgements

    The UGA Protocol sections of this specification were developed in close consultation withMicrosoft as part of the Universal Graphics Adapter (UGA) initiative. Microsoft has madesignificant contributions to the interface definitions presented here to ensure that they will workwell with video adapters supporting the Microsoft UGA specification. These efforts are gratefullyacknowledged.

    The EFI Byte Code Virtual Machine sections (Chapter 19) of this specification were developed inclose consultation with Microsoft, LSI, Hewlett Packard, Compaq, and Phoenix Technologies. Theefforts of all contributors to these sections are gratefully acknowledged.

    THIS SPECIFICATION IS PROVIDED "AS IS" WITH NOWARRANTIES WHATSOEVER, INCLUDING ANYWARRANTYOF MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR ANY PARTICULAR PURPOSE, OR ANYWARRANTYOTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. Intel disclaims all liability, includingliability for infringement of any proprietary rights, relating to use of information in this specification. No license, express orimplied, by estoppel or otherwise, to any intellectual property rights is granted herein, except that a license is hereby grantedto 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 arisingfrom future changes to them.

    This document contains information on products in the design phase of development. Do not finalize a design with thisinformation. Revised information will be published when the product is available. Verify with your local sales office that youhave 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 itssubsidiaries 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.

  • Version 1.10 12/01/02 iii

    History

    Revision Revision History Date

    1.0 Official release of EFI 1.10 Specification, revision 1.0. 12/01/02

  • Extensible Firmware Interface Specification

    iv 12/01/02 Version 1.10

  • Version 1.10 12/01/02 v

    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

  • Extensible Firmware Interface Specification

    vi 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 vii

    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

  • Extensible Firmware Interface Specification

    viii 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 ix

    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

  • Extensible Firmware Interface Specification

    x 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xi

    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

  • Extensible Firmware Interface Specification

    xii 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xiii

    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

  • Extensible Firmware Interface Specification

    xiv 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xv

    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

  • Extensible Firmware Interface Specification

    xvi 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xvii

    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

  • Extensible Firmware Interface Specification

    xviii 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xix

    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

  • Extensible Firmware Interface Specification

    xx 12/01/02 Version 1.10

    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

  • Contents

    Version 1.10 12/01/02 xxi

    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

  • Extensible Firmware Interface Specification

    xxii 12/01/02 Version 1.10

    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 2-1. EFI Runtime Services ............................................................................................ 6 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 3-1 Global Variables..................................................................................................... 5 3-2 EFI Image Types.................................................................................................... 8 5-1. Event, Timer, and Task Priority Functions.............................................................. 2 5-2. TPL Usage............................................................................................................. 3 5-3. TPL Restrictions..................................................................................................... 4 5-4. Memory Allocation Functions ................................................................................18 5-5. Memory Type Usage before ExitBootServices()...........................................19

  • Contents

    Version 1.10 12/01/02 xxiii

    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 6-1. Variable Services Functions................................................................................... 2 6-2. Time Services Functions........................................................................................ 9 6-3. Virtual Memory Functions .....................................................................................16 6-4. Miscellaneous Runtime Services ..........................................................................20 8-1. Generic Device Path Node Structure ..................................................................... 3 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..........................................................