Unified Extensible Firmware Interface Specification 2...January 31, 2006 Version 2.0 Unified...

1476
January 31, 2006 Version 2.0 Unified Extensible Firmware Interface Specification Version 2.0 January 31, 2006

Transcript of Unified Extensible Firmware Interface Specification 2...January 31, 2006 Version 2.0 Unified...

  • January 31, 2006 Version 2.0

    Unified Extensible Firmware

    Interface Specification

    Version 2.0

    January 31, 2006

  • January 31, 2006 ii Version 2.0

    Acknowledgements

    The material contained herein is not a license, either expressly or impliedly, to any intellectual property owned or controlled by any of the authors or developers of this material or to any contribution thereto. The material contained herein is provided on an "AS IS" basis and, to the maximum extent permitted by applicable law, this information is provided AS IS AND WITH ALL FAULTS, and the authors and developers of this material hereby disclaim all other warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties, duties or conditions of merchantability, of fitness for a particular purpose, of accuracy or completeness of responses, of results, of workmanlike effort, of lack of viruses and of lack of negligence, all with regard to this material and any contribution thereto. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." The Unified EFI Forum, Inc. reserves any features or instructions so marked for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SPECIFICATION AND ANY CONTRIBUTION THERETO.

    IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.

    Copyright 2006 Unified EFI, Inc. All Rights Reserved.

  • January 31, 2006 Version 2.0 iii

    History

    Revision Revision History Date

    2.0 First release of UEFI Specification January 31, 2006

  • January 31, 2006 iv Version 2.0

  • January 31, 2006 Version 2.0 v

    Table of Contents

    Acknowledgements..............................................................................................ii

    History ..................................................................................................................iii

    Table of Contents ................................................................................................ v

    1 Introduction ...................................................................................................... 1 1.1 UEFI Driver Model Extensions ..................................................................................................... 2 1.2 Overview....................................................................................................................................... 3 1.3 Goals............................................................................................................................................. 6 1.4 Target Audience ........................................................................................................................... 8 1.5 UEFI Design Overview ................................................................................................................. 9 1.6 UEFI Driver Model ...................................................................................................................... 10

    1.6.1 UEFI Driver Model Goals............................................................................................... 10 1.6.2 Legacy Option ROM Issues........................................................................................... 11

    1.7 Migration Requirements.............................................................................................................. 11 1.7.1 Legacy Operating System Support................................................................................ 12 1.7.2 Supporting the UEFI Specification on a Legacy Platform ............................................. 12

    1.8 Conventions Used in This Document ......................................................................................... 12 1.8.1 Data Structure Descriptions........................................................................................... 12 1.8.2 Protocol Descriptions..................................................................................................... 13 1.8.3 Procedure Descriptions ................................................................................................. 14 1.8.4 Instruction Descriptions ................................................................................................. 14 1.8.5 Pseudo-Code Conventions............................................................................................ 15 1.8.6 Typographic Conventions .............................................................................................. 15

    2 Overview ......................................................................................................... 17 2.1 Boot Manager ............................................................................................................................. 18

    2.1.1 UEFI Images.................................................................................................................. 18 2.1.2 Applications.................................................................................................................... 19 2.1.3 UEFI OS Loaders .......................................................................................................... 20 2.1.4 UEFI Drivers .................................................................................................................. 20

    2.2 Firmware Core ............................................................................................................................ 21 2.2.1 UEFI Services................................................................................................................ 21 2.2.2 Runtime Services........................................................................................................... 22

    2.3 Calling Conventions.................................................................................................................... 23 2.3.1 Data Types..................................................................................................................... 24 2.3.2 IA-32 Platforms .............................................................................................................. 25

    2.3.2.1 Handoff State................................................................................................. 27 2.3.3 Itanium®-based Platforms ............................................................................................. 27

    2.3.3.1 Handoff State................................................................................................. 29 2.3.4 x64 Platforms................................................................................................................. 29

    2.3.4.1 Handoff State................................................................................................. 31 2.3.4.2 Detailed Calling Conventions ........................................................................ 31 2.3.4.3 Enabling Paging or Alternate Translations in an Application ........................ 31

    2.4 Protocols..................................................................................................................................... 32 2.5 UEFI Driver Model ...................................................................................................................... 36

  • January 31, 2006 vi Version 2.0

    2.5.1 Legacy Option ROM Issues........................................................................................... 38 2.5.1.1 32-bit/16-Bit Real Mode Binaries................................................................... 39 2.5.1.2 Fixed Resources for Working with Option ROMs.......................................... 39 2.5.1.3 Matching Option ROMs to their Devices ....................................................... 39 2.5.1.4 Ties to PC-AT System Design....................................................................... 40 2.5.1.5 Ambiguities in Specification and Workarounds Born of Experience ............. 41

    2.5.2 Driver Initialization ......................................................................................................... 41 2.5.3 Host Bus Controllers...................................................................................................... 42 2.5.4 Device Drivers................................................................................................................ 44 2.5.5 Bus Drivers .................................................................................................................... 45 2.5.6 Platform Components .................................................................................................... 47 2.5.7 Hot-Plug Events............................................................................................................. 48 2.5.8 EFI Services Binding ..................................................................................................... 48

    2.6 Requirements ............................................................................................................................. 50 2.6.1 Required Elements ........................................................................................................ 50 2.6.2 Platform-Specific Elements............................................................................................ 51 2.6.3 Driver-Specific Elements ............................................................................................... 52

    3 Boot Manager ................................................................................................. 55 3.1 Firmware Boot Manager ............................................................................................................. 55 3.2 Globally Defined Variables ......................................................................................................... 59 3.3 Boot Option Variables Default Behavior ..................................................................................... 61 3.4 Boot Mechanisms ....................................................................................................................... 62

    3.4.1 Boot via the Simple File Protocol................................................................................... 62 3.4.1.1 Removable Media Boot Behavior.................................................................. 63

    3.4.2 Boot via LOAD_FILE PROTOCOL ................................................................................ 63 3.4.2.1 Network Booting ............................................................................................ 64 3.4.2.2 Future Boot Media ......................................................................................... 64

    4 EFI System Table............................................................................................ 65 4.1 UEFI Image Entry Point .............................................................................................................. 65

    EFI_IMAGE_ENTRY_POINT ........................................................................................ 65 4.2 EFI Table Header ....................................................................................................................... 67

    EFI_TABLE_HEADER................................................................................................... 67 4.3 EFI System Table ....................................................................................................................... 68

    EFI_SYSTEM_TABLE................................................................................................... 69 4.4 EFI Boot Services Table............................................................................................................. 71

    EFI_BOOT_SERVICES................................................................................................. 71 4.5 EFI Runtime Services Table....................................................................................................... 76

    EFI_RUNTIME_SERVICES .......................................................................................... 76 4.6 EFI Configuration Table.............................................................................................................. 79

    EFI_CONFIGURATION_TABLE ................................................................................... 79 4.7 Image Entry Point Examples ...................................................................................................... 80

    4.7.1 Image Entry Point Examples ......................................................................................... 80 4.7.2 UEFI Driver Model Example .......................................................................................... 82 4.7.3 UEFI Driver Model Example (Unloadable) .................................................................... 83 4.7.4 EFI Driver Model Example (Multiple Instances) ............................................................ 84

    5 GUID Partition Table (GPT) Format .............................................................. 87 5.1 EFI Partition Formats.................................................................................................................. 87 5.2 LBA 0 Format.............................................................................................................................. 87

  • January 31, 2006 Version 2.0 vii

    5.2.1 Legacy Master Boot Record (MBR)............................................................................... 87 5.2.2 Protective Master Boot Record...................................................................................... 90

    5.3 GUID Partition Table (GPT) Format ........................................................................................... 90 5.3.1 GUID Format overview .................................................................................................. 90 5.3.2 GPT Partition Table Header .......................................................................................... 93 5.3.3 GUID Partition Entry Array............................................................................................. 95

    6 Services — Boot Services............................................................................. 97 6.1 Event, Timer, and Task Priority Services ................................................................................... 98

    CreateEvent() ........................................................................................................ 103 CreateEventEx().................................................................................................... 107 CloseEvent().......................................................................................................... 110 SignalEvent()......................................................................................................... 111 WaitForEvent() ...................................................................................................... 112 CheckEvent()......................................................................................................... 114 SetTimer() ............................................................................................................. 115 RaiseTPL() ............................................................................................................ 117 RestoreTPL()......................................................................................................... 119

    6.2 Memory Allocation Services ..................................................................................................... 120 AllocatePages() ..................................................................................................... 123 FreePages() .......................................................................................................... 126 GetMemoryMap() .................................................................................................. 127 AllocatePool() ........................................................................................................ 131 FreePool() ............................................................................................................. 132

    6.3 Protocol Handler Services ........................................................................................................ 133 6.3.1 Driver Model Boot Services ......................................................................................... 135

    InstallProtocolInterface() ....................................................................................... 138 UninstallProtocolInterface()................................................................................... 141 ReinstallProtocolInterface()................................................................................... 143 RegisterProtocolNotify() ........................................................................................ 145 LocateHandle()...................................................................................................... 147 HandleProtocol() ................................................................................................... 149 LocateDevicePath()............................................................................................... 151 OpenProtocol() ...................................................................................................... 153 CloseProtocol()...................................................................................................... 160 OpenProtocolInformation().................................................................................... 163 ConnectController() ............................................................................................... 165 DisconnectController()........................................................................................... 170 ProtocolsPerHandle() ............................................................................................ 173 LocateHandleBuffer() ............................................................................................ 175 LocateProtocol() .................................................................................................... 178 InstallMultipleProtocolInterfaces() ......................................................................... 179 UninstallMultipleProtocolInterfaces()..................................................................... 181

    6.4 Image Services ......................................................................................................................... 182 LoadImage() .......................................................................................................... 184 StartImage() .......................................................................................................... 186 UnloadImage()....................................................................................................... 188 EFI_IMAGE_ENTRY_POINT................................................................................ 189 Exit() ...................................................................................................................... 190 ExitBootServices()................................................................................................. 192

    6.5 Miscellaneous Boot Services.................................................................................................... 193 SetWatchdogTimer() ............................................................................................. 194

  • January 31, 2006 viii Version 2.0

    Stall() ..................................................................................................................... 196 CopyMem()............................................................................................................ 197 SetMem()............................................................................................................... 199 GetNextMonotonicCount() .................................................................................... 200 InstallConfigurationTable() .................................................................................... 201 CalculateCrc32() ................................................................................................... 203

    7 Services — Runtime Services..................................................................... 205 7.1 Variable Services...................................................................................................................... 206

    GetVariable() ......................................................................................................... 207 GetNextVariableName() ........................................................................................ 209 SetVariable() ......................................................................................................... 211 QueryVariableInfo() ............................................................................................... 213

    7.2 Time Services ........................................................................................................................... 214 GetTime() .............................................................................................................. 215 SetTime()............................................................................................................... 218 GetWakeupTime() ................................................................................................. 219 SetWakeupTime() ................................................................................................. 220

    7.3 Virtual Memory Services........................................................................................................... 221 SetVirtualAddressMap() ........................................................................................ 222 ConvertPointer() .................................................................................................... 224

    7.4 Miscellaneous Runtime Services.............................................................................................. 225 7.4.1 Reset System............................................................................................................... 225

    ResetSystem()....................................................................................................... 226 7.4.2 GetNextHighMotonic Count ......................................................................................... 227

    GetNextHighMonotonicCount() ............................................................................. 228 7.4.3 Update Capsule ........................................................................................................... 229

    UpdateCapsule() ................................................................................................... 230 7.4.3.1 Capsule Definition ....................................................................................... 233

    QueryCapsuleCapabilities() .................................................................................. 235

    8 Protocols — EFI Loaded Image .................................................................. 237 EFI_LOADED_IMAGE_PROTOCOL .......................................................................... 237

    EFI_LOADED_IMAGE.Unload() ........................................................................... 240

    9 Protocols — Device Path Protocol ............................................................. 241 9.1 Device Path Overview .............................................................................................................. 241 9.2 EFI Device Path Protocol.......................................................................................................... 242

    EFI_DEVICE_PATH_PROTOCOL.............................................................................. 242 9.3 Device Path Nodes ................................................................................................................... 243

    9.3.1 Generic Device Path Structures .................................................................................. 243 9.3.2 Hardware Device Path................................................................................................. 245

    9.3.2.1 PCI Device Path .......................................................................................... 245 9.3.2.2 PCCARD Device Path ................................................................................. 245 9.3.2.3 Memory Mapped Device Path ..................................................................... 246 9.3.2.4 Vendor Device Path..................................................................................... 246 9.3.2.5 Controller Device Path................................................................................. 246

    9.3.3 ACPI Device Path ........................................................................................................ 247 9.3.4 ACPI _ADR Device Path ............................................................................................. 249 9.3.5 Messaging Device Path ............................................................................................... 250

    9.3.5.1 ATAPI Device Path...................................................................................... 250 9.3.5.2 SCSI Device Path........................................................................................ 250

  • January 31, 2006 Version 2.0 ix

    9.3.5.3 Fibre Channel Device Path ......................................................................... 250 9.3.5.4 1394 Device Path ........................................................................................ 251 9.3.5.5 USB Device Paths ....................................................................................... 251

    9.3.5.5.1 USB Device Path Example................................................... 252 9.3.5.6 USB Device Paths (WWID) ......................................................................... 254 9.3.5.7 Device Logical Unit...................................................................................... 254 9.3.5.8 USB Device Path (Class) ............................................................................ 255 9.3.5.9 I2O Device Path .......................................................................................... 255 9.3.5.10 MAC Address Device Path.......................................................................... 255 9.3.5.11 IPv4 Device Path ......................................................................................... 256 9.3.5.12 IPv6 Device Path ......................................................................................... 256 9.3.5.13 InfiniBand Device Path ................................................................................ 257 9.3.5.14 UART Device Path ...................................................................................... 258 9.3.5.15 Vendor-Defined Messaging Device Path .................................................... 258 9.3.5.16 UART Flow Control Messaging Path........................................................... 259 9.3.5.17 Serial Attached SCSI (SAS) Device Path.................................................... 260

    9.3.5.17.1 Device and Topology Information......................................... 260 9.3.5.17.2 Device and Topology Information......................................... 261 9.3.5.17.3 Relative Target Port.............................................................. 261 9.3.5.17.4 Examples Of Correct Device Path Display Format .............. 262

    9.3.5.18 iSCSI Device Path ....................................................................................... 263 9.3.5.18.1 iSCSI Login Options ............................................................. 263 9.3.5.18.2 Device Path Examples ......................................................... 264

    9.3.6 Media Device Path....................................................................................................... 264 9.3.6.1 Hard Drive ................................................................................................... 265 9.3.6.2 CD-ROM Media Device Path ...................................................................... 266 9.3.6.3 Vendor-Defined Media Device Path ............................................................ 266 9.3.6.4 File Path Media Device Path ....................................................................... 267 9.3.6.5 Media Protocol Device Path ........................................................................ 267

    9.3.7 BIOS Boot Specification Device Path.......................................................................... 268 9.4 Device Path Generation Rules ................................................................................................. 269

    9.4.1 Housekeeping Rules.................................................................................................... 269 9.4.2 Rules with ACPI _HID and _UID ................................................................................. 269 9.4.3 Rules with ACPI _ADR ................................................................................................ 270 9.4.4 Hardware vs. Messaging Device Path Rules .............................................................. 271 9.4.5 Media Device Path Rules ............................................................................................ 271 9.4.6 Other Rules.................................................................................................................. 271

    9.5 EFI Device Path Display Format Overview .............................................................................. 272 9.5.1 Design Discussion ....................................................................................................... 272

    9.5.1.1 Standardized Display Format ...................................................................... 272 9.5.1.2 Readability................................................................................................... 272 9.5.1.3 Round-Trip Conversion ............................................................................... 273 9.5.1.4 Command-Line Parsing............................................................................... 273 9.5.1.5 Text Representation Basics ........................................................................ 274 9.5.1.6 Text Device Node Reference ...................................................................... 276

    9.5.2 Code Definitions .......................................................................................................... 288 EFI_DEVICE_PATH_UTILITIES_PROTOCOL........................................................... 289

    EFI_DEVICE_PATH_UTILITIES_PROTOCOL.GetDevicePathSize .................... 291 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.DuplicateDevicePath.................. 292 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.AppendDevicePath() .................. 293 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.AppendDeviceNode()................. 294 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.AppendDevicePathInstance() .... 295

  • January 31, 2006 x Version 2.0

    EFI_DEVICE_PATH_UTILITIES_PROTOCOL.GetNextDevicePathInstance().... 296 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.CreateDeviceNode() .................. 297 EFI_DEVICE_PATH_UTILITIES_PROTOCOL.IsDevicePathMultiInstance() ...... 298

    EFI_DEVICE_PATH_TO_TEXT_PROTOCOL ........................................................... 299 EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDeviceNodeToText() ...... 300 EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() ....... 302

    EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL...................................................... 304 EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL.ConvertTextToDeviceNode

    ()......................................................................................................................... 305 EFI_DEVICE_PATH_FROM_PATH_PROTOCOL.ConvertTextToDevicePath

    () ......................................................................................................................... 306

    10 Protocols — UEFI Driver Model ................................................................ 307 10.1 EFI Driver Binding Protocol ...................................................................................................... 307

    EFI_DRIVER_BINDING_PROTOCOL ........................................................................ 307 EFI_DRIVER_BINDING_PROTOCOL.Supported().............................................. 310 EFI_DRIVER_BINDING_PROTOCOL.Start()....................................................... 316 EFI_DRIVER_BINDING_PROTOCOL.Stop()....................................................... 324

    10.2 EFI Platform Driver Override Protocol ...................................................................................... 329 EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL............................................... 329

    EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriver() ..................... 331 EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.GetDriverPath().............. 333 EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.DriverLoaded() ............... 335

    10.3 EFI Bus Specific Driver Override Protocol................................................................................ 337 EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL ........................................ 337

    EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL.GetDriver()............... 338 10.4 EFI Driver Configuration Protocol............................................................................................. 339

    EFI_DRIVER_CONFIGURATION_PROTOCOL......................................................... 339 EFI_DRIVER_CONFIGURATION_PROTOCOL.SetOptions() ............................. 341 EFI_DRIVER_CONFIGURATION_PROTOCOL.OptionsValid()........................... 344 EFI_DRIVER_CONFIGURATION_PROTOCOL.ForceDefaults() ........................ 346

    10.5 EFI Driver Diagnostics Protocol................................................................................................ 349 EFI_DRIVER_DIAGNOSTICS_PROTOCOL .............................................................. 349

    EFI_DRIVER_DIAGNOSTICS_PROTOCOL.RunDiagnostics() ........................... 350 10.6 EFI Component Name Protocol................................................................................................ 353

    EFI_COMPONENT_NAME_PROTOCOL................................................................... 353 EFI_COMPONENT_NAME_PROTOCOL.GetDriverName() ................................ 354 EFI_COMPONENT_NAME_PROTOCOL.GetControllerName().......................... 356

    10.7 EFI Service Binding Protocol.................................................................................................... 357 EFI_SERVICE_BINDING_PROTOCOL...................................................................... 358

    EFI_SERVICE_BINDING_PROTOCOL.CreateChild() ......................................... 359 EFI_SERVICE_BINDING_PROTOCOL.DestroyChild() ....................................... 363

    11 Protocols — Console Support .................................................................. 367 11.1 Console I/O Protocol................................................................................................................. 367

    11.1.1 Overview...................................................................................................................... 367 11.1.2 ConsoleIn Definition..................................................................................................... 368

    11.2 Simple Text Input Protocol........................................................................................................ 370 EFI_SIMPLE_TEXT_INPUT_PROTOCOL.................................................................. 370

    EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset() .............................................. 371

  • January 31, 2006 Version 2.0 xi

    EFI_SIMPLE_TEXT_INPUT.ReadKeyStroke()..................................................... 372 11.2.1 ConsoleOut or StandardError ...................................................................................... 374

    11.3 Simple Text Output Protocol..................................................................................................... 374 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL ............................................................. 374

    EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset() .......................................... 377 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString() ............................... 378 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString() ................................... 382 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode()................................. 383 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetMode() ..................................... 384 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute()................................. 385 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen()................................ 387 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition() ...................... 388 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.EnableCursor().............................. 389

    11.4 Simple Pointer Protocol ............................................................................................................ 390 EFI_SIMPLE_POINTER_PROTOCOL........................................................................ 390

    EFI_SIMPLE_POINTER_PROTOCOL.Reset() .................................................... 392 EFI_SIMPLE_POINTER_PROTOCOL.GetState() ............................................... 393

    11.5 EFI Simple Pointer Device Paths ............................................................................................. 395 11.6 Serial I/O Protocol..................................................................................................................... 399

    EFI_SERIAL_IO_PROTOCOL .................................................................................... 399 EFI_SERIAL_IO_PROTOCOL.Reset() ................................................................. 402 EFI_SERIAL_IO_PROTOCOL.SetAttributes()...................................................... 403 EFI_SERIAL_IO_PROTOCOL.SetControl() ......................................................... 405 EFI_SERIAL_IO_PROTOCOL.GetControl() ......................................................... 407 EFI_SERIAL_IO_PROTOCOL.Write() .................................................................. 409 EFI_SERIAL_IO_PROTOCOL.Read().................................................................. 410

    11.7 Graphics Output Protocol ......................................................................................................... 411 11.7.1 Blt Buffer ...................................................................................................................... 411

    EFI_GRAPHICS_OUTPUT_PROTOCOL ................................................................... 413 EFI_GRAPHICS_OUTPUT_PROTOCOL.QueryMode() ...................................... 417 EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode()........................................... 419 EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() ..................................................... 421 EFI_EDID_DISCOVERED_PROTOCOL.............................................................. 424 EFI_EDID_ACTIVE_PROTOCOL......................................................................... 425

    Graphics Output EDID Override Protocol.................................................................... 426 EFI_EDID_OVERRIDE_PROTOCOL.GetEdid() .................................................. 427

    11.8 Rules for PCI/AGP Devices...................................................................................................... 428

    12 Protocols — Media Access ....................................................................... 433 12.1 Load File Protocol..................................................................................................................... 433

    EFI_LOAD_FILE_PROTOCOL ................................................................................... 433 EFI_LOAD_FILE_PROTOCOL.LoadFile()............................................................ 434

    12.2 File System Format................................................................................................................... 436 12.2.1 System Partition........................................................................................................... 436

    12.2.1.1 File System Format ..................................................................................... 437 12.2.1.2 File Names .................................................................................................. 437 12.2.1.3 Directory Structure....................................................................................... 437

    12.2.2 Partition Discovery....................................................................................................... 439 12.2.2.1 ISO-9660 and El Torito................................................................................ 440

    12.2.3 Media Formats............................................................................................................. 440 12.2.3.1 Removable Media........................................................................................ 440

  • January 31, 2006 xii Version 2.0

    12.2.3.2 Diskette........................................................................................................ 440 12.2.3.3 Hard Drive ................................................................................................... 441 12.2.3.4 CD-ROM and DVD-ROM............................................................................. 441 12.2.3.5 Network ....................................................................................................... 441

    12.3 Simple File System Protocol..................................................................................................... 442 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL ............................................................... 442

    EFI_SIMPLE_FILE SYSTEM_PROTOCOL.OpenVolume() ................................. 444 12.4 EFI File Protocol ....................................................................................................................... 445

    EFI_FILE_PROTOCOL ............................................................................................... 445 EFI_FILE_PROTOCOL.Open()............................................................................. 447 EFI_FILE_PROTOCOL.Close() ............................................................................ 450 EFI_FILE_PROTOCOL.Delete() ........................................................................... 451 EFI_FILE_PROTOCOL.Read()............................................................................. 452 EFI_FILE_PROTOCOL.Write() ............................................................................. 454 EFI_FILE_PROTOCOL.SetPosition() ................................................................... 455 EFI_FILE_PROTOCOL.GetPosition()................................................................... 456 EFI_FILE_PROTOCOL.GetInfo().......................................................................... 457 EFI_FILE_PROTOCOL.SetInfo() .......................................................................... 459 EFI_FILE_PROTOCOL.Flush()............................................................................. 461 EFI_FILE_INFO..................................................................................................... 462 EFI_FILE_SYSTEM_INFO.................................................................................... 464 EFI_FILE_SYSTEM_VOLUME_LABEL................................................................ 465

    12.5 Tape Boot Support.................................................................................................................... 465 12.5.1 Tape I/O Support ......................................................................................................... 465 12.5.2 Tape I/O Protocol......................................................................................................... 466

    EFI_TAPE_IO_PROTOCOL ................................................................................. 467 EFI_TAPE_IO_PROTOCOL.TapeRead() ............................................................. 468 EFI_TAPE_IO_PROTOCOL.TapeWrite() ............................................................. 470 EFI_TAPE_IO_PROTOCOL.TapeRewind().......................................................... 472 EFI_TAPE_IO_PROTOCOL.TapeSpace() ........................................................... 473 EFI_TAPE_IO_PROTOCOL.TapeWriteFM()........................................................ 475 EFI_TAPE_IO_PROTOCOL.TapeReset() ............................................................ 476

    12.5.3 Tape Header Format ................................................................................................... 477 12.6 Disk I/O Protocol....................................................................................................................... 478

    EFI_DISK_IO_PROTOCOL......................................................................................... 478 EFI_DISK_IO_PROTOCOL.ReadDisk() ............................................................... 481 EFI_DISK_IO_PROTOCOL.WriteDisk() ............................................................... 482

    12.7 Block I/O Protocol ..................................................................................................................... 483 EFI_BLOCK_IO_PROTOCOL..................................................................................... 483

    EFI_BLOCK_IO_PROTOCOL.Reset().................................................................. 486 EFI_BLOCK_IO_PROTOCOL.ReadBlocks()........................................................ 487 EFI_BLOCK_IO_PROTOCOL.WriteBlocks()........................................................ 489 EFI_BLOCK_IO_PROTOCOL.FlushBlocks() ....................................................... 491

    12.8 Unicode Collation Protocol ....................................................................................................... 492 EFI_UNICODE_COLLATION_ PROTOCOL............................................................... 492

    EFI_UNICODE_COLLATION_PROTOCOL.StriColl() .......................................... 494 EFI_UNICODE_COLLATION_PROTOCOL.MetaiMatch() ................................... 495 EFI_UNICODE_COLLATION_PROTOCOL.StrLwr() ........................................... 497 EFI_UNICODE_COLLATION_PROTOCOL.StrUpr() ........................................... 498 EFI_UNICODE_COLLATION_PROTOCOL.FatToStr()........................................ 499 EFI_UNICODE_COLLATION_PROTOCOL.StrToFat()........................................ 500

  • January 31, 2006 Version 2.0 xiii

    13 Protocols — PCI Bus Support................................................................... 501 13.1 PCI Root Bridge I/O Support .................................................................................................... 501

    13.1.1 PCI Root Bridge I/O Overview..................................................................................... 501 13.1.1.1 Sample PCI Architectures ........................................................................... 504

    13.2 PCI Root Bridge I/O Protocol.................................................................................................... 508 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL ........................................................ 508 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollMem()....................................... 517 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.PollIo()............................................ 519 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Read()

    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Mem.Write() ................................ 521 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Read()

    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Io.Write() ..................................... 523 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read()

    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write() ................................... 525 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.CopyMem() .................................... 527 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Map().............................................. 529 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Unmap() ......................................... 531 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.AllocateBuffer() .............................. 532 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.FreeBuffer().................................... 534 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Flush() ............................................ 535 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.GetAttributes()................................ 536 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.SetAttributes() ................................ 538 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Configuration() ............................... 540

    13.2.1 PCI Root Bridge Device Paths..................................................................................... 542 13.3 PCI Driver Model ...................................................................................................................... 546

    13.3.1 PCI Driver Initialization ................................................................................................ 546 13.3.1.1 Driver Configuration Protocol ...................................................................... 548 13.3.1.2 Driver Diagnostics Protocol ......................................................................... 548 13.3.1.3 Component Name Protocol ......................................................................... 548

    13.3.2 PCI Bus Drivers ........................................................................................................... 549 13.3.2.1 Driver Binding Protocol for PCI Bus Drivers................................................ 550 13.3.2.2 PCI Enumeration ......................................................................................... 553

    13.3.3 PCI Device Drivers ...................................................................................................... 553 13.3.3.1 Driver Binding Protocol for PCI Device Drivers........................................... 553

    13.4 EFI PCI I/O Protocol ................................................................................................................. 555 EFI_PCI_IO_PROTOCOL..................................................................................... 556 EFI_PCI_IO_PROTOCOL.PollMem() ................................................................... 566 EFI_PCI_IO_PROTOCOL.PollIo() ........................................................................ 568 EFI_PCI_IO_PROTOCOL.Mem.Read()

    EFI_PCI_IO_PROTOCOL.Mem.Write() ............................................................ 570 EFI_PCI_IO_PROTOCOL.Io.Read() EFI_PCI_IO_PROTOCOL.Io.Write()......... 572 EFI_PCI_IO_PROTOCOL.Pci.Read() EFI_PCI_IO_PROTOCOL.Pci.Write()...... 574 EFI_PCI_IO_PROTOCOL.CopyMem()................................................................. 576 EFI_PCI_IO_PROTOCOL.Map() .......................................................................... 579 EFI_PCI_IO_PROTOCOL.Unmap()...................................................................... 581 EFI_PCI_IO_PROTOCOL.AllocateBuffer()........................................................... 582 EFI_PCI_IO_PROTOCOL.FreeBuffer() ................................................................ 584 EFI_PCI_IO_PROTOCOL.Flush() ........................................................................ 585 EFI_PCI_IO_PROTOCOL.GetLocation().............................................................. 586 EFI_PCI_IO_PROTOCOL.Attributes() .................................................................. 587 EFI_PCI_IO_PROTOCOL.GetBarAttributes() ...................................................... 590 EFI_PCI_IO_PROTOCOL.SetBarAttributes() ....................................................... 593

  • January 31, 2006 xiv Version 2.0

    13.4.1 PCI Device Paths......................................................................................................... 595 13.4.2 PCI Option ROMs ........................................................................................................ 597

    13.4.2.1 PCI Bus Driver Responsibilities................................................................... 600 13.4.2.2 PCI Device Driver Responsibilities.............................................................. 600

    13.4.3 Nonvolatile Storage ..................................................................................................... 603 13.4.4 PCI Hot-Plug Events.................................................................................................... 604

    14 Protocols — SCSI Driver Models and Bus Support................................ 605 14.1 SCSI Driver Model Overview.................................................................................................... 605 14.2 SCSI Bus Drivers...................................................................................................................... 606

    14.2.1 Driver Binding Protocol for SCSI Bus Drivers.............................................................. 606 14.2.2 SCSI Enumeration ....................................................................................................... 607

    14.3 SCSI Device Drivers ................................................................................................................. 608 14.3.1 Driver Binding Protocol for SCSI Device Drivers......................................................... 608

    14.4 EFI SCSI I/O Protocol Overview............................................................................................... 608 14.5 EFI_SCSI_IO_PROTOCOL...................................................................................................... 609

    14.5.1 EFI_SCSI_IO_PROTOCOL.GetDeviceType() ............................................................ 611 14.5.2 EFI_SCSI_IO_PROTOCOL. GetDeviceLocation()...................................................... 613 14.5.3 EFI_SCSI_IO_PROTOCOL. ResetBus()..................................................................... 614 14.5.4 EFI_SCSI_IO_PROTOCOL.ResetDevice()................................................................. 615 14.5.5 EFI_SCSI_IO_PROTOCOL. ExecuteScsiCommand()................................................ 616

    14.6 SCSI Device Paths ................................................................................................................... 621 14.6.1 SCSI Device Path Example ......................................................................................... 621 14.6.2 ATAPI Device Path Example ....................................................................................... 622 14.6.3 Fibre Channel Device Path Example........................................................................... 623 14.6.4 InfiniBand Device Path Example ................................................................................. 624

    14.7 SCSI Pass Thru Device Paths.................................................................................................. 625 14.8 Extended SCSI Pass Thru Protocol ......................................................................................... 628

    EFI_EXT_SCSI_PASS_THRU_PROTOCOL ....................................................... 628 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.PassThru() .................................... 632 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.GetNextTargetLun() ...................... 638 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.BuildDevicePath() ......................... 640 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.GetTargetLun().............................. 642 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.ResetChannel() ............................. 644 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.ResetTargetLun().......................... 645 EFI_EXT_SCSI_PASS_THRU_PROTOCOL.GetNextTarget() ............................ 647

    15 Protocols — iSCSI Boot............................................................................. 649 15.1 Overview................................................................................................................................... 649

    15.1.1 iSCSI UEFI Driver Layering ......................................................................................... 649 15.2 EFI iSCSI Initiator Name Protocol ............................................................................................ 649

    EFI_ISCSI_INITIATOR_NAME_PROTOCOL....................................................... 650 EFI_ISCSI_INITIATOR_NAME_PROTOCOL. Get() ............................................ 651 EFI_ISCSI_INITIATOR_NAME_PROTOCOL.Set().............................................. 652

    16 Protocols — USB Support......................................................................... 653 16.1 USB2 Host Controller Protocol ................................................................................................. 653

    16.1.1 USB Host Controller Protocol Overview ...................................................................... 653 EFI_USB2_HC_PROTOCOL................................................................................ 654 EFI_USB2_HC_PROTOCOL.GetCapability()....................................................... 656 EFI_USB2_HC_PROTOCOL.Reset() ................................................................... 658 EFI_USB2_HC_PROTOCOL.GetState() .............................................................. 661

  • January 31, 2006 Version 2.0 xv

    EFI_USB2_HC_PROTOCOL.SetState()............................................................... 663 EFI_USB2_HC_PROTOCOL.ControlTransfer() ................................................... 665 EFI_USB2_HC_PROTOCOL.BulkTransfer() ........................................................ 668 EFI_USB2_HC_PROTOCOL.AsyncInterruptTransfer()........................................ 671 EFI_USB2_HC_PROTOCOL.SyncInterruptTransfer() ......................................... 674 EFI_USB2_HC_PROTOCOL.IsochronousTransfer() ........................................... 676 EFI_USB2_HC_PROTOCOL.AsyncIsochronousTransfer() ................................. 679 EFI_USB2_HC_PROTOCOL.GetRootHubPortStatus() ....................................... 682 EFI_USB2_HC_PROTOCOL.SetRootHubPortFeature()...................................... 686 EFI_USB2_HC_PROTOCOL.ClearRootHubPortFeature() .................................. 688

    16.2 USB Driver Model ..................................................................................................................... 690 16.2.1 Scope........................................................................................................................... 690 16.2.2 USB Bus Driver............................................................................................................ 691

    16.2.2.1 USB Bus Driver Entry Point......................................................................... 691 16.2.2.2 Driver Binding Protocol for USB Bus Drivers .............................................. 691 16.2.2.3 USB Hot-Plug Event .................................................................................... 692 16.2.2.4 USB Bus Enumeration................................................................................. 692

    16.2.3 USB Device Driver....................................................................................................... 693 16.2.3.1 USB Device Driver Entry Point.................................................................... 693 16.2.3.2 Driver Binding Protocol for USB Device Drivers ......................................... 693

    16.2.4 EFI USB I/O Protocol Overview................................................................................... 693 EFI_USB_IO Protocol ........................................................................................... 694 EFI_USB_IO_PROTOCOL.UsbControlTransfer() ................................................ 696 EFI_USB_IO_PROTOCOL.UsbBulkTransfer() ..................................................... 699 EFI_USB_IO_PROTOCOL.UsbAsyncInterruptTransfer()..................................... 701 EFI_USB_IO_PROTOCOL.UsbSyncInterruptTransfer() ...................................... 705 EFI_USB_IO_PROTOCOL.UsbIsochronousTransfer() ........................................ 707 EFI_USB_IO_PROTOCOL.UsbAsyncIsochronousTransfer() .............................. 709 EFI_USB_IO_PROTOCOL.UsbGetDeviceDescriptor() ........................................ 711 EFI_USB_IO_PROTOCOL.UsbGetConfigDescriptor()......................................... 713 EFI_USB_IO_PROTOCOL.UsbGetInterfaceDescriptor() ..................................... 715 EFI_USB_IO_PROTOCOL.UsbGetEndpointDescriptor()..................................... 717 EFI_USB_IO_PROTOCOL.UsbGetStringDescriptor().......................................... 719 EFI_USB_IO_PROTOCOL.UsbGetSupportedLanguages() ................................. 720 EFI_USB_IO_PROTOCOL.UsbPortReset() ......................................................... 721

    17 Protocols — Debugger Support................................................................ 723 17.1 Overview................................................................................................................................... 723 17.2 EFI Debug Support Protocol..................................................................................................... 724

    17.2.1 EFI Debug Support Protocol Overview........................................................................ 724 EFI_DEBUG_SUPPORT_PROTOCOL ................................................................ 725 EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex() .............. 727 EFI_DEBUG_SUPPORT_PROTOCOL.RegisterPeriodicCallback() .................... 728 EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() ................. 733 EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache() .................. 737

    17.3 EFI Debugport Protocol ............................................................................................................ 738 EFI Debugport Overview .......................................................................................................... 738

    EFI_DEBUGPORT_PROTOCOL.......................................................................... 739 EFI_DEBUGPORT_PROTOCOL.Reset()............................................................. 740 EFI_DEBUGPORT_PROTOCOL.Write().............................................................. 741 EFI_DEBUGPORT_PROTOCOL.Read().............................................................. 742 EFI_DEBUGPORT_PROTOCOL.Poll() ................................................................ 743

  • January 31, 2006 xvi Version 2.0

    17.3.1 Debugport Device Path................................................................................................ 744 EFI Debugport Variable ............................................................................................................ 745

    17.4 EFI Debug Support Table......................................................................................................... 746 Overview ................................................................................................................................... 746 EFI System Table Location....................................................................................................... 747 EFI Image Info .......................................................................................................................... 748

    18 Protocols — Compression Algorithm Specification............................... 751 18.1 Algorithm Overview................................................................................................................... 751 18.2 Data Format.............................................................................................................................. 753

    18.2.1 Bit Order....................................................................................................................... 753 18.2.2 Overall Structure.......................................................................................................... 753 18.2.3 Block Structure............................................................................................................. 754

    18.2.3.1 Block Header ............................................................................................... 754 18.2.3.2 Block Body................................................................................................... 757

    18.3 Compressor Design .................................................................................................................. 758 18.3.1 Overall Process............................................................................................................ 758 18.3.2 String Info Log.............................................................................................................. 759

    18.3.2.1 Data Structures............................................................................................ 760 18.3.2.2 Searching the Tree...................................................................................... 761 18.3.2.3 Adding String Info ........................................................................................ 761 18.3.2.4 Deleting String Info ...................................................................................... 762

    18.3.3 Huffman Code Generation........................................................................................... 763 18.3.3.1 Huffman Tree Generation............................................................................ 763 18.3.3.2 Code Length Adjustment............................................................................. 763 18.3.3.3 Code Generation ......................................................................................... 764

    18.4 Decompressor Design .............................................................................................................. 765 18.5 Decompress Protocol ............................................................................................................... 765

    EFI_DECOMPRESS_PROTOCOL....................................................................... 766 EFI_DECOMPRESS_PROTOCOL.GetInfo() ....................................................... 767 EFI_DECOMPRESS_PROTOCOL.Decompress() ............................................... 769

    19 EFI Byte Code Virtual Machine ................................................................. 771 19.1 Overview................................................................................................................................... 771

    19.1.1 Processor Architecture Independence ........................................................................ 771 19.1.2 OS Independent........................................................................................................... 771 19.1.3 EFI Compliant .............................................................................................................. 772 19.1.4 Coexistence of Legacy Option ROMs ......................................................................... 772 19.1.5 Relocatable Image....................................................................................................... 772 19.1.6 Size Restrictions Based on Memory Available ............................................................ 772

    19.2 Memory Ordering...................................................................................................................... 773 19.3 Virtual Machine Registers......................................................................................................... 773 19.4 Natural Indexing........................................................................................................................ 775

    19.4.1 Sign Bit......................................................................................................................... 775 19.4.2 Bits Assigned to Natural Units ..................................................................................... 776 19.4.3 Constant....................................................................................................................... 776 19.4.4 Natural Units ................................................................................................................ 776

    19.5 EBC Instruction Operands........................................................................................................ 777 19.5.1 Direct Operands........................................................................................................... 777 19.5.2 Indirect Operands ........................................................................................................ 777 19.5.3 Indirect with Index Operands ....................................................................................... 778 19.5.4 Immediate Operands ................................................................................................... 778

  • January 31, 2006 Version 2.0 xvii

    19.6 EBC Instruction Syntax............................................................................................................. 778 19.7 Instruction Encoding ................................................................................................................. 779

    19.7.1 Instruction Opcode Byte Encoding .............................................................................. 779 19.7.2 Instruction Operands Byte Encoding ........................................................................... 780 19.7.3 Index/Immediate Data Encoding.................................................................................. 780

    19.8 EBC Instruction Set .................................................................................................................. 780 ADD....................................................................................................................... 781 AND....................................................................................................................... 782 ASHR .................................................................................................................... 783 BREAK .................................................................................................................. 784 CALL ..................................................................................................................... 786 CMP....................................................................................................................... 789 CMPI ..................................................................................................................... 791 DIV......................................................................................................................... 793 DIVU...................................................................................................................... 794 EXTNDB................................................................................................................ 795 EXTNDD................................................................................................................ 796 EXTNDW............................................................................................................... 797 JMP ....................................................................................................................... 798 JMP8 ..................................................................................................................... 800 LOADSP................................................................................................................ 801 MOD ...................................................................................................................... 802 MODU ................................................................................................................... 803 MOV ...................................................................................................................... 804 MOVI ..................................................................................................................... 806 MOVIn ................................................................................................................... 808 MOVn .................................................................................................................... 810 MOVREL ............................................................................................................... 812 MOVsn .................................................................................................................. 813 MUL....................................................................................................................... 815 MULU .................................................................................................................... 816 NEG....................................................................................................................... 817 NOT....................................................................................................................... 818 OR ......................................................................................................................... 819 POP....................................................................................................................... 820 POPn..................................................................................................................... 821 PUSH .................................................................................................................... 822 PUSHn .................................................................................................................. 823 RET ....................................................................................................................... 824 SHL........................................................................................................................ 825 SHR....................................................................................................................... 826 STORESP ............................................................................................................. 827 SUB ....................................................................................................................... 828 XOR....................................................................................................................... 829

    19.9 Runtime and Software Conventions ......................................................................................... 830 19.9.1 Calling Outside VM ...................................................................................................... 830 19.9.2 Calling Inside VM......................................................................................................... 830 19.9.3 Parameter Passing ...................................................................................................... 830 19.9.4 Return Values .............................................................................................................. 830 19.9.5 Binary Format .............................................................................................................. 830

    19.10 Architectural Requirements ...................................................................................................... 830 19.10.1 EBC Image Requirements ........................................................................................... 831

  • January 31, 2006 xviii Version 2.0

    19.10.2 EBC Execution Interfacing Requirements ................................................................... 831 19.10.3 Interfacing Function Parameters Requirements .......................................................... 831 19.10.4 Function Return Requirements.................................................................................... 831 19.10.5 Function Return Values Requirements........................................................................ 832

    19.11 EBC Interpreter Protocol........................................................................................................... 832 EFI_EBC_PROTOCOL ......................................................................................... 833 EFI_EBC_PROTOCOL.CreateThunk()................................................................. 834 EFI_EBC_PROTOCOL.UnloadImage() ................................................................ 835 EFI_EBC_PROTOCOL.RegisterICacheFlush().................................................... 836 EFI_EBC_PROTOCOL.GetVersion().................................................................... 838

    19.12 EBC Tools................................................................................................................................. 839 19.12.1 EBC C Compiler........................................................................................................... 839 19.12.2 C Coding Convention................................................................................................... 839 19.12.3 EBC Interface Assembly Instructions .......................................................................... 839 19.12.4 Stack Maintenance and Argument Passing................................................................. 839 19.12.5 Native to EBC Arguments Calling Convention ............................................................ 840 19.12.6 EBC to Native Arguments Calling Convention ............................................................ 840 19.12.7 EBC to EBC Arguments Calling Convention ............................................................... 840 19.12.8 Function Returns ......................................................................................................... 840 19.12.9 Function Return Values ............................................................................................... 840 19.12.10 Thunking...................................................................................................... 841

    19.12.10.1 Thunking EBC to Native Code........................................................... 841 19.12.10.2 Thunking Native Code to EBC........................................................... 842 19.12.10.3 Thunking EBC to EBC ....................................................................... 842

    19.12.11 EBC Linker .................................................................................................. 843 19.12.12 Image Loader .............................................................................................. 843 19.12.13 Debug Support ............................................................................................ 843

    19.13 VM Exception Handling ............................................................................................................ 844 19.13.1 Divide By 0 Exception.................................................................................................. 844 19.13.2 Debug Break Exception ............................................................................................... 844 19.13.3 Invalid Opcode Exception ............................................................................................ 844 19.13.4 Stack Fault Exception .................................................................................................. 844 19.13.5 Alignment Exception .................................................................................................... 844 19.13.6 Instruction Encoding Exception ................................................................................... 844 19.13.7 Bad Break Exception ................................................................................................... 845 19.13.8 Undefined Exception.................................................................................................... 845

    19.14 Option ROM Formats................................................................................................................ 845 19.14.1 EFI Drivers for PCI Add-in Cards................................................................................. 845 19.14.2 Non-PCI Bus Support .................................................................................................. 845

    20 Network Protocols — SNP, PXE and BIS................................................. 847 20.1 EFI_SIMPLE_NETWORK_PROTOCOL .................................................................................. 847

    EFI_SIMPLE_NETWORK_PROTOCOL ..................................................................... 847 EFI_SIMPLE_NETWORK.Start() .......................................................................... 852 EFI_SIMPLE_NETWORK.Stop() .......................................................................... 853 EFI_SIMPLE_NETWORK.Initialize()..................................................................... 854 EFI_SIMPLE_NETWORK.Reset() ........................................................................ 855 EFI_SIMPLE_NETWORK.Shutdown().................................................................. 856 EFI_SIMPLE_NETWORK.ReceiveFilters()........................................................... 857 EFI_SIMPLE_NETWORK.StationAddress() ......................................................... 860 EFI_SIMPLE_NETWORK.Statistics() ................................................................... 861 EFI_SIMPLE_NETWORK.MCastIPtoMAC()......................................................... 864

  • January 31, 2006 Version 2.0 xix

    EFI_SIMPLE_NETWORK.NvData()...................................................................... 865 EFI_SIMPLE_NETWORK.GetStatus().................................................................. 867 EFI_SIMPLE_NETWORK.Transmit().................................................................... 869 EFI_SIMPLE_NETWORK.Receive()..................................................................... 871

    20.2 Network Interface Identifier Protocol ........................................................................................ 873 EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL........................................ 873

    20.3 PXE Base Code Protocol.......................................................................................................... 876 EFI_PXE_BASE_CODE_PROTOCOL........................................................................ 876

    EFI_PXE_BASE_CODE_PROTOCOL.Start() ...................................................... 888 EFI_PXE_BASE_CODE_PROTOCOL.Stop() ...................................................... 891 EFI_PXE_BASE_CODE_PROTOCOL.Dhcp() ..................................................... 892 EFI_PXE_BASE_CODE_PROTOCOL.Discover()................................................ 894 EFI_PXE_BASE_CODE_PROTOCOL.Mtftp()...................................................... 898 EFI_PXE_BASE_CODE_PROTOCOL.UdpWrite()............................................... 902 EFI_PXE_BASE_CODE_PROTOCOL.UdpRead() .............................................. 905 EFI_PXE_BASE_CODE_PROTOCOL.SetIpFilter() ............................................. 908 EFI_PXE_BASE_CODE_PROTOCOL.Arp() ........................................................ 910 EFI_PXE_BASE_CODE_PROTOCOL.SetParameters()...................................... 912 EFI_PXE_BASE_CODE_PROTOCOL.SetStationIp() .......................................... 914 EFI_PXE_BASE_CODE_PROTOCOL.SetPackets() ........................................... 916

    20.4 PXE Base Code Callback Protocol........................................................................................... 918 EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL................................................... 918

    EFI_PXE_BASE_CODE_CALLBACK.Callback() ................................................. 919 20.5 Boot Integrity Services Protocol ............................................................................................... 921

    EFI_BIS_PROTOCOL ................................................................................................. 921 EFI_BIS_PROTOCOL.Initialize() .......................................................................... 924 EFI_BIS_PROTOCOL.Shutdown() ....................................................................... 928 EFI_BIS_PROTOCOL.Free()................................................................................ 930 EFI_BIS_PROTOCOL.GetBootObjectAuthorizationCertificate() .......................... 931 EFI_BIS_PROTOCOL.GetBootObjectAuthorizationCheckFlag() ......................... 932 EFI_BIS_PROTOCOL.GetBootObjectAuthorizationUpdateToken()..................... 933 EFI_BIS_PROTOCOL.GetSignatureInfo() ............................................................ 934 EFI_BIS_PROTOCOL.UpdateBootObjectAuthorization()..................................... 939 EFI_BIS_PROTOCOL.VerifyBootObject() ............................................................ 948 EFI_BIS_PROTOCOL.VerifyObjectWithCredential()............................................ 955

    21 Network Protocols — Managed Network ................................................. 963 21.1 EFI Managed Network Protocol................................................................................................ 963

    EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL ............................. 963 EFI_MANAGED_NETWORK_PROTOCOL ................................................................ 964

    EFI_MANAGED_NETWORK_PROTOCOL.GetModeData()................................ 966 EFI_MANAGED_NETWORK_PROTOCOL.Configure()....................................... 969 EFI_MANAGED_NETWORK_PROTOCOL.McastIpToMac()............................... 971 EFI_MANAGED_NETWORK_PROTOCOL.Groups() .......................................... 973 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() ........................................ 975 EFI_MANAGED_NETWORK_PROTOCOL.Receive() ......................................... 981 EFI_MANAGED_NETWORK_PROTOCOL.Cancel() ........................................... 982 EFI_MANAGED_NETWORK_PROTOCOL.Poll() ................................................ 983

    22 Network Protocols — ARP and DHCPv4.................................................. 985 22.1 ARP Protocol ............................................................................................................................ 985

  • January 31, 2006 xx Version 2.0

    EFI_ARP_SERVICE_BINDING_PROTOCOL ............................................................ 985 EFI_A