Intel Extensible Firmware Interface Specification

Intel extensible firmware interface specification
Table of Contents

Advertisement

Quick Links

Extensible Firmware Interface
Specification
Version 1.02
December 12, 2000

Advertisement

Table of Contents
loading

Summary of Contents for Intel Extensible Firmware Interface

  • Page 1 Extensible Firmware Interface Specification Version 1.02 December 12, 2000...
  • Page 2 No other license, express or implied, by estoppel or otherwise, to any other intellectual property rights is granted herein. Intel disclaims all liability, including liability for infringement of any proprietary rights, relating to implementation of information in this specification. Intel does not warrant or represent that such implementation(s) will not infringe such rights.
  • Page 3: Revision History

    Revision Revision History 1.01 Original Issue. 1.02 Update for legal and trademarking requirements. Version 1.02 Revision History Date 12/01/00 12/12/00 12/12/00...
  • Page 4 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 5: Table Of Contents

    Conventions Used in This Document... 12 1.8.1 Data Structure Descriptions... 12 1.8.2 Typographic Conventions ... 12 Guidelines for Use of the Term “Extensible Firmware Interface” ... 12 2 Overview Boot Manager ... 14 Firmware Core ... 14 2.2.1 EFI Services ... 14 2.2.2...
  • Page 6 Extensible Firmware Interface Specification 3 Services Event, Timer, and Task Priority Services... 26 3.1.1 CreateEvent() ... 29 3.1.2 CloseEvent()... 33 3.1.3 SignalEvent() ... 34 3.1.4 WaitForEvent() ... 35 3.1.5 CheckEvent()... 36 3.1.6 SetTimer()... 37 3.1.7 RaiseTPL() ... 39 3.1.8 RestoreTPL() ... 41 Memory Allocation Services ...
  • Page 7 Variable Services... 77 3.5.1 GetVariable() ... 78 3.5.2 GetNextVariableName() ... 80 3.5.3 SetVariable()... 82 Time Services... 84 3.6.1 GetTime() ... 85 3.6.2 SetTime()... 88 3.6.3 GetWakeupTime() ... 89 3.6.4 SetWakeupTime()... 90 Virtual Memory Services... 91 3.7.1 SetVirtualAddressMap()... 92 3.7.2 ConvertPointer() ... 94 Miscellaneous Services ...
  • Page 8 Extensible Firmware Interface Specification Device Path Nodes ... 119 5.3.1 Generic Device Path Structures ... 119 5.3.2 Hardware Device Path... 120 5.3.2.1 PCI Device Path ... 121 5.3.2.2 PCCARD Device Path ... 121 5.3.2.3 Memory Mapped Device Path ... 122 5.3.2.4 Vendor Device Path ...
  • Page 9 5.4.4 Hardware vs. Messaging Device Path Rules... 135 5.4.5 Media Device Path Rules ... 136 5.4.6 Other Rules ... 136 6 Device I/O Protocol Device I/O Overview ... 137 DEVICE_IO Protocol ... 138 6.2.1 DEVICE_IO.Mem(), .Io(), and .Pci()... 141 6.2.2 DEVICE_IO.PciDevicePath()...
  • Page 10 Extensible Firmware Interface Specification 8 Block I/O Protocol BLOCK_IO Protocol... 173 8.1.1 EFI_BLOCK_IO.Reset() ... 176 8.1.2 EFI_BLOCK_IO.ReadBlocks()... 177 8.1.3 EFI_BLOCK_IO.WriteBlocks()... 179 8.1.4 BLOCK_IO.FlushBlocks() ... 181 9 Disk I/O Protocol DISK_IO Protocol ... 183 9.1.1 EFI_DISK_IO.ReadDisk() ... 185 9.1.2 EFI_DISK_IO.WriteDisk() ... 186 10 File System Protocol 10.1 Simple File System Protocol...
  • Page 11 12 Serial I/O Protocol 12.1 SERIAL_IO Protocol ... 213 12.1.1 SERIAL_IO.Reset() ... 217 12.1.2 SERIAL_IO.SetAttributes() ... 218 12.1.3 SERIAL_IO.SetControl()... 220 12.1.4 SERIAL_IO.GetControl() ... 222 12.1.5 SERIAL_IO.Write() ... 223 12.1.6 SERIAL_IO.Read() ... 224 13 Unicode Collation Protocol 13.1 UNICODE_COLLATION Protocol... 225 13.1.1 UNICODE_COLLATION.StriColl() ...
  • Page 12 Extensible Firmware Interface Specification 15 Simple Network Protocol 15.1 EFI_SIMPLE_NETWORK Protocol... 277 15.1.1 EFI_SIMPLE_NETWORK.Start() ... 282 15.1.2 EFI_SIMPLE_NETWORK.Stop() ... 283 15.1.3 EFI_SIMPLE_NETWORK.Initialize()... 284 15.1.4 EFI_SIMPLE_NETWORK.Reset() ... 285 15.1.5 EFI_SIMPLE_NETWORK.Shutdown()... 286 15.1.6 EFI_SIMPLE_NETWORK.ReceiveFilters() ... 287 15.1.7 EFI_SIMPLE_NETWORK.StationAddress() ... 289 15.1.8 EFI_SIMPLE_NETWORK.Statistics() ... 290 15.1.9 EFI_SIMPLE_NETWORK.MCastIPtoMAC() ...
  • Page 13 17 Boot Manager 17.1 Firmware Boot Manager ... 319 17.2 Globally-Defined Variables ... 323 17.3 Boot Option Variables Default Behavior ... 325 17.4 Boot Mechanisms ... 325 17.4.1 Boot via Simple File Protocol... 325 17.4.1.1 Removable Media Boot Behavior ... 325 17.4.2 Boot via LOAD_FILE Protocol ...
  • Page 14 Extensible Firmware Interface Specification G 32/64-Bit UNDI Specification Introduction... 373 G.1.1 Definitions... 373 G.1.2 Referenced Specifications ... 374 G.1.3 OS Network Stacks ... 376 Overview... 378 G.2.1 32/64-bit UNDI Interface ... 378 G.2.2 UNDI Command Format ... 384 UNDI C Definitions... 386 G.3.1...
  • Page 15 G.4.18 Transmit... 460 G.4.19 Receive... 464 UNDI as an EFI Runtime Driver... 466 Index ... 469 Figures 1-1. EFI Conceptual Overview ... 10 2-1. Booting Sequence ... 13 2-2. Construction of a Protocol ... 19 3-1. Device Handle to Protocol Handler Mapping ... 56 4-1.
  • Page 16 Extensible Firmware Interface Specification 3-3. TPL Usage... 27 3-5. TPL Restrictions ... 28 3-7. Memory Allocation Functions... 42 3-9. Memory Type Usage Before ExitBootServices() ... 43 3-11. Memory Type Usage After ExitBootServices() ... 44 3-13. Protocol Interface Functions ... 55 3-15.
  • Page 17 5-25. CD-ROM Media Device Path... 131 5-26. Vendor-Defined Media Device Path... 131 5-27. File Path Media Device Path ... 132 5-28. Media Protocol Media Device Path... 132 5-29. BIOS Boot Specification Device Path ... 133 5-30. ACPI _CRS to EFI Device Path Mapping ... 134 5-31.
  • Page 18 Extensible Firmware Interface Specification D-1. EFI_STATUS Codes Ranges ... 345 D-2. EFI_STATUS Success Codes (High bit clear)... 345 D-3. EFI_STATUS Error Codes (High bit set) ... 345 D-4. EFI_STATUS Warning Codes (High bit clear) ... 346 E-1. Functions Listed in Alphabetic Order ... 347 E-2.
  • Page 19 Introduction This Extensible Firmware Interface (hereafter known as EFI) Specification describes an interface between the operating system (OS) and the platform firmware. The interface is in the form of data tables that contain platform-related information, and boot and runtime service calls that are available to the OS and its loader.
  • Page 20: Overview

    Extensible Firmware Interface Specification Overview This specification is organized as follows: Table 1-1. Organization of EFI Specification Chapter/Appendix Introduction Overview Services EFI Image Device Path Protocol Device I/O Protocol Console I/O Protocol Block I/O Protocol Disk I/O Protocol 10. File System Protocol 11.
  • Page 21: Goals

    Coherent, scalable platform environment. The specification defines a complete solution for the firmware to completely describe platform features and surface platform capabilities to the OS during the boot process. The definitions are rich enough to cover the full range of ® contemporary Intel architecture-based system designs. Version 1.02 Description Defines the Simple Network Protocol, which provides a packet level interface to a network device.
  • Page 22 Indeed several alternatives, perhaps viable from an academic point of view, already existed at the time this specification was written. These alternatives, however, typically presented high barriers to entry given the current infrastructure capabilities surrounding Intel architecture platforms. This specification is intended to deliver the attributes listed above while also recognizing the unique needs of an industry that has considerable investment in compatibility and a large installed base of systems that cannot be abandoned summarily.
  • Page 23: Target Audience

    Target Audience This document is intended for the following readers: • OEMs who will be creating Intel architecture-based platforms intended to boot shrink-wrap operating systems. • BIOS developers, either those who create general-purpose BIOS and other firmware products or those who modify these products for use in Intel architecture-based products.
  • Page 24: Related Information

    Rev. 1.0, Order number 245319, Intel Corporation, January, 2000. Also available at http://developer.intel.com/design/ia-64 • IA-64 Architecture Software Developer’s Manual, Volume 4: Itanium Processor Programmer’s Guide, Rev. 1.0, Order number 245320, Intel Corporation, January, 2000. Also available at http://developer.intel.com/design/ia-64 • IA-64 Software Conventions and Runtime Architecture Guide, Order number 245358, Intel Corporation, January, 2000.
  • Page 25 ISO 639-2:1998. Codes for the Representation of Names of Languages – Part2: Alpha-3 code, http://www.iso.ch/ • Universal Serial Bus PC Legacy Compatibility Specification, Version 0.9, http://www.usb.org/developers/index.html • Wired for Management Baseline, Version 2.0 Release Candidate. Intel Corporation, 1998, http://developer.intel.com/ial/WfM Version 1.02 ftp://download.intel.com/ial/wfm/bio10a.pdf http://www.unicode.org/ 12/12/00...
  • Page 26: Prerequisite Specifications

    CIM (Common Information Model) and DMI (Desktop Management Interface). For more information on WfM or to obtain a copy of the WfM Specification, visit http://developer.intel.com/ial/WfM. To obtain the System Management BIOS Reference Specification, visit http://developer.intel.com/ial/WfM/design/BIBLIOG.HTM. 12/12/00...
  • Page 27: Efi Design Overview

    Itanium-based systems to implement based on the more generalized Itanium-based firmware architecture specifications. The following specifications are the required Intel Itanium architecture specifications for all Itanium-based platforms: •...
  • Page 28: Efi Conceptual Overview

    Extensible Firmware Interface Specification Figure 1-1 shows the principal components of EFI and their relationship to platform hardware and OS software. [OTHER] SMBIOS ACPI INTERFACES FROM OTHER REQUIRED SPECS This diagram illustrates the interactions of the various components of an EFI specification- compliant system that are used to accomplish platform and OS boot.
  • Page 29: Migration Requirements

    The EFI specification represents the preferred means for a shrink-wrap OS and firmware to communicate during the Intel architecture platform boot process. However, choosing to make a platform that complies with this specification in no way precludes a platform from also supporting existing legacy OS binaries that have no knowledge of the EFI specification.
  • Page 30: Conventions Used In This Document

    Firmware Interface (hereafter “EFI”) is an architecture specification.” • After the first use where “Extensible Firmware Interface” is fully spelled out, “EFI” may be used standalone. As indicated above, the abbreviation should only be used where necessary, e.g. where space constrained or to avoid excessive repetition in text and the abbreviation should not be used in any prominent places, such as in titles or paragraph headings.
  • Page 31: Booting Sequence

    An EFI-defined System Partition is required by EFI to boot from a block device. EFI does not require any change to the first sector of a partition, so it is possible to build media that will boot on both legacy Intel architecture and EFI platforms. Version 1.02...
  • Page 32: Boot Manager

    The PC industry has a huge investment in Intel Architecture Option ROM technology, and the obsolescence of this installed base of technology is not practical in the first generation of EFI-compliant systems. The interfaces have been designed in such as way as to map back into legacy interfaces.
  • Page 33: Efi Runtime Services

    Interfaces added by this specification are divided into the following categories and are detailed later in this document: • Runtime services • Boot services interfaces, with the following sub-categories:  Global boot service interfaces  Device handle-based boot service interfaces ...
  • Page 34: Calling Conventions

    Extensible Firmware Interface Specification Calling Conventions Unless otherwise stated, all functions defined in the EFI specification are called through pointers in common, architecturally defined, calling conventions found in C compilers. Pointers to the various global EFI functions are found in the tables that are located via the EFI system table.
  • Page 35: Modifiers For Common Efi Data Types

    Table 2-2. Common EFI Data Types (continued) Mnemonic Description UINT64 8 byte unsigned value. CHAR8 1 byte Character. CHAR16 2 byte Character. Unless otherwise specified all strings are stored in the UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards. VOID Undeclared type.
  • Page 36: Ia-32 Platforms

    Extensible Firmware Interface Specification 2.3.2 IA-32 Platforms All functions are called with the C language calling convention. The general-purpose registers that are volatile across function calls are eax, ecx, and edx. All other general-purpose registers are non- volatile and are preserved by the target function. In addition, unless otherwise specified by the function definition, all other registers are preserved.
  • Page 37: Protocols

    The EFI Image may invoke both SAL and EFI procedures. Once in virtual mode, the EFI OS must switch back to physical mode to call any boot services. If been used, then runtime service calls are made in virtual mode. Refer to the IA-64 System Abstraction Layer Specification for details.
  • Page 38: Efi Protocols

    Extensible Firmware Interface Specification The following C code fragment illustrates the use of protocols: // There is a global “EffectsDevice” structure. // structure contains information pertinent to the device. // Connect to the ILLUSTRATION_PROTOCOL on the EffectsDevice, // by calling HandleProtocol with the device’s EFI device handle // and the ILLUSTRATION_PROTOCOL GUID.
  • Page 39: Requirements

    Requirements This document is an architectural specification. As such, care has been taken to specify architecture in ways that allow maximum flexibility in implementation. However, there are certain requirements on which elements of this specification must be implemented to ensure that operating system loaders and other code designed to run with EFI boot services can rely upon a consistent environment.
  • Page 40: Optional Elements

    Extensible Firmware Interface Specification Table 2-5. Required EFI Implementation Elements (continued) Element SIMPLE_INPUT protocol SIMPLE_TEXT_OUTPUT protocol UNICODE_COLLATION protocol These protocols are not required if the implementation can operate using on the LOAD_FILE protocol. 2.5.2 Optional Elements Table 2-6 lists the optional elements. Any system that is designed to conform to the EFI specification may choose whether or not to provide a complete implementation of all these elements.
  • Page 41: Appendixes

    Overview 2.5.3 Appendixes The content of Appendixes B, C, D, E of this specification is largely intended as informational. In other words, semantic information contained in these sections need not be considered part of the formal definition of either required or optional elements of the specification. The content of Appendix A is a set of definitions that are used extensively by other interfaces in the specification.
  • Page 42 Extensible Firmware Interface Specification 12/01/00 Version 1.02...
  • Page 43 This chapter discusses the fundamental services that are present in an EFI-compliant system. The services are defined by interface functions that may be used by code running in the EFI environment. Such code may include protocols that manage device access or extend platform capability, as well as EFI applications running in the pre-boot environment and EFI OS loaders.
  • Page 44: Event, Timer, And Task Priority Services

    Extensible Firmware Interface Specification The rest of this chapter discusses individual functions. Global boot services functions fall into these categories: • Event, Timer, and Task Priority Services (Section 3.1) • Memory Allocation Services (Section 3.2) • Protocol Handler Services (Section 3.3) •...
  • Page 45: Tpl Usage

    Execution in the boot services environment occurs at different task priority levels, or TPLs. The boot services environment exposes only three of these levels to EFI applications and drivers: • TPL_APPLICATION, the lowest priority level • TPL_CALLBACK, an intermediate priority level •...
  • Page 46: Tpl Restrictions

    Extensible Firmware Interface Specification Table 3-2. TPL Usage (continued) Task Priority Level Usage (Firmware Interrupts) This level is internal to the firmware. It is the level at which internal interrupts occur. Code running at this level interrupts code running at the...
  • Page 47: Createevent()

    3.1.1 CreateEvent() Summary Creates an event. Prototype EFI_STATUS CreateEvent ( IN UINT32 IN EFI_TPL IN EFI_EVENT_NOTIFY IN VOID OUT EFI_EVENT Parameters Type NotifyTpl NotifyFunction NotifyContext Event Version 1.02 Type, NotifyTpl, NotifyFunction, *NotifyContext, *Event The type of event to create and its mode and attributes. The “#define”...
  • Page 48 Extensible Firmware Interface Specification Related Definitions //******************************************************* // EFI_EVENT //******************************************************* typedef VOID *EFI_EVENT //******************************************************* // Event Types //******************************************************* // These types can be “ORed” together as needed – for example, // EVT_TIMER might be “Ored” with EVT_NOTIFY_WAIT or // EVT_NOTIFY_SIGNAL.
  • Page 49 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE The event is to be notified by the system when SetVirtualAddressMap() used with any other EVT bit type. See the discussion of EVT_RUNTIME. //******************************************************* // EFI_EVENT_NOTIFY //******************************************************* typedef VOID (EFIAPI *EFI_EVENT_NOTIFY) ( IN EFI_EVENT IN VOID Event whose notification function is being invoked. Event Pointer to the notification function’s context, which is Context...
  • Page 50 Extensible Firmware Interface Specification can’t clean up on behalf of drivers that have been loaded into the system. The drivers have to do that themselves by creating an event whose type is whose notification function is a function within the driver itself. Then, when...
  • Page 51: Closeevent()

    3.1.2 CloseEvent() Summary Closes an event. Prototype EFI_STATUS CloseEvent ( IN EFI_EVENT Parameters The event to close. Type Event Description function removes the caller’s reference to the event and closes it. Once the CloseEvent() event is closed, the event is no longer valid and may not be used on any subsequent function calls. Status Codes Returned EFI_SUCCESS Version 1.02...
  • Page 52: Signalevent()

    Extensible Firmware Interface Specification 3.1.3 SignalEvent() Summary Signals an event. Prototype EFI_STATUS SignalEvent ( IN EFI_EVENT Parameters The event to signal. Type Event Description The supplied is signaled and, if the event has a signal notification function, it is scheduled Event to be invoked at the event’s notificiation task priority level.
  • Page 53: Waitforevent()

    3.1.4 WaitForEvent() Summary Stops execution until an event is signaled. Prototype EFI_STATUS WaitForEvent ( IN UINTN IN EFI_EVENT OUT UINTN Parameters The number of events in the NumberOfEvents An array of EFI_EVENT. Type Event Section 3.1.1. Pointer to the index of the event which satisfied the wait condition. Index Description The WaitForEvent()function waits for any event in the...
  • Page 54: Checkevent()

    Extensible Firmware Interface Specification 3.1.5 CheckEvent() Summary Checks whether an event is in the signaled state. Prototype EFI_STATUS CheckEvent ( IN EFI_EVENT Parameters The event to check. Type Event Description function checks to see whether CheckEvent() of type EVT_NOTIFY_SIGNAL, then type EFI_NOTIFY_WAIT, there are three possibilities: •...
  • Page 55: Settimer()

    3.1.6 SetTimer() Summary Sets the type of timer and the trigger time for a timer event. Prototype EFI_STATUS SetTimer ( IN EFI_EVENT IN EFI_TIMER_DELAY IN UINT64 Parameters The timer event that is to be signaled at the specified time. Type Event EFI_EVENT The type of time that is specified in TriggerTime.
  • Page 56 Extensible Firmware Interface Specification Description function cancels any previous time trigger setting for the event, and sets the SetTimer() new trigger time for the event. This function can only be used on events of type EVT_TIMER. Status Codes Returned EFI_SUCCESS EFI_INVALID_PARAMETER The event has been set to be signaled at the requested time.
  • Page 57: Raisetpl()

    3.1.7 RaiseTPL() Summary Raises a task’s priority level and returns its previous level. Prototype EFI_TPL RaiseTPL ( IN EFI_TPL NewTpl Parameters The new task priority level. It must be greater than or equal to the NewTpl current task priority level. See “Related Definitions”. Related Definitions //******************************************************* // EFI_TPL...
  • Page 58 Extensible Firmware Interface Specification Description function raises the priority of the currently executing task and returns its RaiseTPL() previous priority level. Only three task priority levels are exposed outside of the firmware during EFI boot services execution. The first is...
  • Page 59: Restoretpl()

    3.1.8 RestoreTPL() Summary Restores a task’s priority level to its previous value. Prototype VOID RestoreTPL ( IN EFI_TPL OldTpl Parameters The previous task priority level to restore (the value from a previous, OldTpl matching call to RaiseTPL()). Type Section 3.1.7. Description function restores a task’s priority level to its previous value.
  • Page 60: Memory Allocation Services

    Extensible Firmware Interface Specification Memory Allocation Services The functions that make up Memory Allocation Services are used during pre-boot to allocate and free memory, and to obtain the system’s memory map. See Table 3-4. Table 3-4. Memory Allocation Functions Name...
  • Page 61: Memory Type Usage Before Exitbootservices()

    Table 3-5. Memory Type Usage Before ExitBootServices() Mnemonic Description EfiReservedMemoryType Not used. EfiLoaderCode The code portions of a loaded EFI application. (Note that EFI OS loaders are EFI applications.) EfiLoaderData The data portions of a loaded EFI application and the default data allocation type used by an EFI application to allocate pool memory.
  • Page 62: Memory Type Usage After Exitbootservices()

    Extensible Firmware Interface Specification Table 3-6. Memory Type Usage After ExitBootServices() Mnemonic EfiReservedMemoryType EfiLoaderCode EfiLoaderData EfiBootServicesCode EfiBootServicesData EfiRuntimeServicesCode EfiRuntimeServicesData EfiConventionalMemory EfiUnusableMemory EfiACPIReclaimMemory EfiACPIMemoryNVS EfiMemoryMappedIO EfiMemoryMappedIOPortSpace EfiPalCode EfiFirmwareReserved NOTE An image that calls ExitBootServices()first calls GetMemoryMap()to obtain the current memory map. Following the memory in the map.
  • Page 63: Allocatepages()

    3.2.1 AllocatePages() Summary Allocates memory pages from the system. Prototype EFI_STATUS AllocatePages( IN EFI_ALLOCATE_TYPE IN EFI_MEMORY_TYPE IN UINTN IN OUT EFI_PHYSICAL_ADDRESS *Memory Parameters The type of allocation to perform. See “Related Definitions”. Type The type of memory to allocate. The only types allowed are MemoryType EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode, EfiRuntimeServicesData,...
  • Page 64 Extensible Firmware Interface Specification Related Definitions //******************************************************* //EFI_ALLOCATE_TYPE //******************************************************* // These types are discussed in the “Description” section below. typedef enum { AllocateAnyPages, AllocateMaxAddress, AllocateAddress, MaxAllocateType } EFI_ALLOCATE_TYPE; //******************************************************* //EFI_MEMORY_TYPE //******************************************************* // These type values are discussed in Table 3-5 and Table 3-6.
  • Page 65 Description function allocates the requested number of pages and returns a pointer AllocatePages() to the base address of the page range in the location referenced by Memory. The function scans the memory map to locate free pages. When it finds a physically contiguous block of pages that is large enough and also satisfies the value of Type, it changes the memory map to indicate that the pages are now of type MemoryType.
  • Page 66: Freepages()

    Extensible Firmware Interface Specification 3.2.2 FreePages() Summary Frees memory pages. Prototype EFI_STATUS FreePages ( IN EFI_PHYSICAL_ADDRESS IN UINTN Parameters The base physical address of the pages to be freed. Type Memory EFI_PHYSICAL_ADDRESS The number of contiguous 4KB pages to free.
  • Page 67: Getmemorymap()

    3.2.3 GetMemoryMap() Summary Returns the current memory map. Prototype EFI_STATUS GetMemoryMap ( IN OUT UINTN IN OUT EFI_MEMORY_DESCRIPTOR OUT UINTN OUT UINTN OUT UINT32 Parameters A pointer to the size, in bytes, of the MemoryMapSize is the size of the buffer allocated by the caller. On output, it is the size of the buffer returned by the firmware if the buffer was large enough, or the size of the buffer needed to contain the map if the buffer was too small.
  • Page 68 Extensible Firmware Interface Specification Related Definitions //******************************************************* //EFI_MEMORY_DESCRIPTOR //******************************************************* typedef struct { UINT32 EFI_PHYSICAL_ADDRESS EFI_VIRTUAL_ADDRESS UINT64 UINT64 } EFI_MEMORY_DESCRIPTOR; Type of the memory region (EFI_MEMORY_TYPE, see Section 3.2.1). Type Physical address of the first byte in the memory region. Type...
  • Page 69 Memory cacheability attribute: Memory region is cacheable with EFI_MEMORY_WB “write back” policy. Reads and writes that hit in the cache do not propagate to main memory. Dirty data is written back to main memory when a new cache line is allocated. Memory cacheability attribute: Memory region is EFI_MEMORY_UCE uncacheable,exported, and supports the "fetch and add"...
  • Page 70 Extensible Firmware Interface Specification function also returns the size and revision number of the GetMemoryMap() EFI_MEMORY_DESCRIPTOR. The EFI_MEMORY_DESCRIPTOR allow for future expansion of the innovation. The structure of the it will remain backwards compatible with the current definition. Thus OS software must use the...
  • Page 71: Allocatepool()

    3.2.4 AllocatePool() Summary Allocates pool memory. Prototype EFI_STATUS AllocatePool ( IN EFI_MEMORY_TYPE IN UINTN OUT VOID Parameters The type of pool to allocate. The only supported types are PoolType EfiLoaderData, EfiBootServicesData, EfiRuntimeServicesData, EfiACPIReclaimMemory, EfiACPIMemoryNVS. Type Section 3.2.1. The number of bytes to allocate from the pool. Size A pointer to a pointer to the allocated buffer if the call succeeds;...
  • Page 72: Freepool()

    Extensible Firmware Interface Specification 3.2.5 FreePool() Summary Returns pool memory to the system. Prototype EFI_STATUS FreePool ( IN VOID *Buffer Parameters Pointer to the buffer to free. Buffer Description function returns the memory specified by FreePool() the memory’s type is EfiConventionalMemory. The allocated by AllocatePool().
  • Page 73: Protocol Handler Services

    Protocol Handler Services In the abstract, a protocol consists of a 128-bit guaranteed unique identifier (GUID) and a Protocol Interface structure. The structure contains the functions and instance data that are used to access a device. The functions that make up Protocol Handler Services allow applications to install a protocol on a handle, identify the handles that support a given protocol, determine whether a handle supports a given protocol, and so forth.
  • Page 74: Device Handle To Protocol Handler Mapping

    Extensible Firmware Interface Specification First Handle Device Handle Device Handle Figure 3-1. Device Handle to Protocol Handler Mapping The ability to add new protocol interfaces as new handles or to layer them on existing interfaces provides great flexibility. Layering makes it possible to add a new protocol that builds on a device’s basic protocols.
  • Page 75: Installprotocolinterface()

    3.3.1 InstallProtocolInterface() Summary Installs a protocol interface on a device handle. If the handle does not exist, it is created and added to the list of handles in the system. Prototype EFI_STATUS InstallProtocolInterface ( IN OUT EFI_HANDLE IN EFI_GUID IN EFI_INTERFACE_TYPE IN VOID Parameters A pointer to the...
  • Page 76 Extensible Firmware Interface Specification Related Definitions //******************************************************* //EFI_HANDLE //******************************************************* typedef VOID //******************************************************* //EFI_GUID //******************************************************* typedef struct { UINT32 Data1; UINT16 Data2; UINT16 Data3; UINT8 Data4[8]; } EFI_GUID; //******************************************************* //EFI_INTERFACE_TYPE //******************************************************* typedef enum { EFI_NATIVE_INTERFACE, EFI_PCODE_INTERFACE } EFI INTERFACE_TYPE; Description InstallProtocolInterface() Interface structure pair) on a device handle.
  • Page 77: Uninstallprotocolinterface()

    3.3.2 UninstallProtocolInterface() Summary Removes a protocol interface from a device handle. Prototype EFI_STATUS UninstallProtocolInterface ( IN EFI_HANDLE IN EFI_GUID IN VOID Parameters The handle on which the interface was installed. Type Handle defined in Section 3.3.1. If EFI_INVALID_PARAMETER The numeric ID of the interface. Type Protocol Section 3.3.1.
  • Page 78: Reinstallprotocolinterface()

    Extensible Firmware Interface Specification 3.3.3 ReinstallProtocolInterface() Summary Reinstalls a protocol interface on a device handle. Prototype EFI_STATUS ReinstallProtocolInterface ( IN EFI_HANDLE IN EFI_GUID IN VOID IN VOID Parameters Handle on which the interface is to be reinstalled. Type Handle is defined in Section 3.3.1. If EFI_INVALID_PARAMETER is returned.
  • Page 79: Registerprotocolnotify()

    3.3.4 RegisterProtocolNotify() Summary Creates an event that is to be signaled whenever an interface is installed for a specified protocol. Prototype EFI_STATUS RegisterProtocolNotify ( IN EFI_GUID IN EFI_EVENT OUT VOID Parameters The numeric ID of the protocol for which the event is to be registered. Protocol Type Event that is to be signaled whenever a protocol interface is registered...
  • Page 80: Locatehandle()

    Extensible Firmware Interface Specification 3.3.5 LocateHandle() Summary Returns an array of handles that support a specified protocol. Prototype EFI_STATUS LocateHandle ( IN EFI_LOCATE_SEARCH_TYPE IN EFI_GUID IN VOID IN OUT UINTN OUT EFI_HANDLE Parameters Specifies which handle(s) are to be returned. Type...
  • Page 81 Related Definitions //******************************************************* // EFI_LOCATE_SEARCH_TYPE //******************************************************* typedef enum { AllHandles, ByRegisterNotify, ByProtocol } EFI_LOCATE_SEARCH_TYPE; AllHandles Protocol returns an array of every handle in the system. ByRegisterNotify SearchKey RegisterProtocolNotify(). The function returns the next handle that is new for the registration. Only one handle is returned at a time, and the caller must loop until no more handles are returned.
  • Page 82: Handleprotocol()

    Extensible Firmware Interface Specification 3.3.6 HandleProtocol() Summary Queries a handle to determine if it supports a specified protocol. Prototype EFI_STATUS HandleProtocol ( IN EFI_HANDLE IN EFI_GUID OUT VOID Parameters The handle being queried. Type Handle Section 3.3.1. If EFI_INVALID_PARAMETER The published unique identifier of the protocol. Type Protocol defined in Section 3.3.1.
  • Page 83: Locatedevicepath()

    3.3.7 LocateDevicePath() Summary Locates the handle to a device on the device path that supports the specified protocol. Prototype EFI_STATUS LocateDevicePath ( IN EFI_GUID IN OUT EFI_DEVICE_PATH OUT EFI_HANDLE Parameters The protocol to search for. Type Protocol On input, a pointer to a pointer to the device path. On output, the device DevicePath path pointer is modified to point to the remaining part of the device path —...
  • Page 84 Extensible Firmware Interface Specification Description LocateDevicePath() and returns the handle to the device that is closest to DevicePath. Protocol advanced over the device path nodes that were matched. This function is useful for locating the proper instance of a protocol interface to use from a logical parent device driver.
  • Page 85: Image Services

    Image Services Three types of images can be loaded: EFI Applications, EFI Boot Services Drivers, and EFI Runtime Services Drivers. An EFI OS Loader is a type of EFI Application. The most significant difference between these image types is the type of memory into which they are loaded by the firmware’s loader.
  • Page 86: Image Functions

    Extensible Firmware Interface Specification Most images are loaded by the boot manager. When an EFI application or driver is installed, the installation procedure registers itself with the boot manager for loading. However, in some cases an application or driver may want to programmatically load and start another EFI image. This can...
  • Page 87: Loadimage()

    3.4.1 LoadImage() Summary Loads an EFI image into memory. Prototype EFI_STATUS LoadImage ( IN BOOLEAN IN EFI_HANDLE IN EFI_DEVICE_PATH IN VOID IN UINTN OUT EFI_HANDLE Parameters BootPolicy ParentImageHandle FilePath SourceBuffer SourceSize ImageHandle Version 1.02 BootPolicy, ParentImageHandle, *FilePath, *SourceBuffer OPTIONAL, SourceSize, *ImageHandle If TRUE, indicates that the request originates from the boot manager, and that the boot manager is attempting to load...
  • Page 88 Extensible Firmware Interface Specification Description function loads an EFI image into memory and returns a handle to the image. LoadImage() The image is loaded in one of two ways. If memory-to-memory load in which indicates the image’s size in bytes. In this case, the caller has copied the image into SourceSize and can free the buffer once loading is complete.
  • Page 89: Startimage()

    3.4.2 StartImage() Summary Transfers control to a loaded image’s entry point. Prototype EFI_STATUS StartImage ( IN EFI_HANDLE OUT UINTN OUT CHAR16 Parameters Handle of image to be started. Type ImageHandle Section 3.3.1. Pointer to the size, in bytes, of ExitData. ExitDataSize Pointer to a pointer to a data buffer that includes a Null-terminated ExitData...
  • Page 90: Unloadimage()

    Extensible Firmware Interface Specification 3.4.3 UnloadImage() Summary Unloads an image. Prototype EFI_STATUS UnloadImage ( IN EFI_HANDLE Parameters Handle that identifies the image to be unloaded. Type ImageHandle defined in Description function unloads a previously loaded image. UnloadImage() There are three possible scenarios. If the image has not been started, the function unloads the image and returns EFI_SUCCESS.
  • Page 91: Efi_Image_Entry_Point

    3.4.4 EFI_IMAGE_ENTRY_POINT Summary This is the declaration of an EFI image entry point. This can be the entry point to an EFI application, an EFI boot service driver, or an EFI runtime driver. Prototype typedef EFI_STATUS (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( IN EFI_HANDLE IN EFI_SYSTEM_TABLE Parameters Handle that identifies the loaded image.
  • Page 92: Exit()

    Extensible Firmware Interface Specification 3.4.5 Exit() Summary Terminates the currently loaded EFI image and returns control to boot services. Prototype EFI_STATUS Exit ( IN EFI_HANDLE IN EFI_STATUS IN UINTN IN CHAR16 Parameters Handle that identifies the image. This parameter is passed to the image ImageHandle on entry.
  • Page 93 When an EFI application exits, firmware frees the memory used to hold the image. The firmware also frees its references to the ImageHandle is responsible for freeing any resources it allocated. This includes memory (pages and/or pool), open file system handles, and so forth. The only exception to this rule is the which must be freed by the caller of StartImage().
  • Page 94: Exitbootservices()

    Extensible Firmware Interface Specification 3.4.6 ExitBootServices() Summary Terminates all boot services. Prototype EFI_STATUS ExitBootServices ( IN EFI_HANDLE IN UINTN Parameters Handle that identifies the exiting image. Type ImageHandle in Section 3.3.1. Key to the latest memory map. MapKey Description ExitBootServices() to terminate all boot services.
  • Page 95: Variable Services Functions

    Variable Services Variables are defined as key/value pairs that consist of identifying information plus attributes (the key) and arbitrary data (the value). Variables are intended for use as a means to store data that is passed between the EFI environment implemented in the platform and EFI OS loaders and other applications that run in the EFI environment.
  • Page 96: Getvariable()

    Extensible Firmware Interface Specification 3.5.1 GetVariable() Summary Returns the value of a variable. Prototype EFI_STATUS GetVariable ( IN CHAR16 IN EFI_GUID OUT UINT32 IN OUT UINTN OUT VOID Parameters VariableName VendorGuid Attributes DataSize Data Related Definitions //******************************************************* // Variable Attributes...
  • Page 97 Description Each vendor may create and manage its own variables without the risk of name conflicts by using a unique VendorGuid. When a variable is set its data variable should be stored and maintained by the system. The attributes affect when the variable may be accessed and volatility of the data.
  • Page 98: Getnextvariablename()

    Extensible Firmware Interface Specification 3.5.2 GetNextVariableName() Summary Enumerates the current variable names. Prototype EFI_STATUS GetNextVariableName ( IN OUT UINTN IN OUT CHAR16 IN OUT EFI_GUID Parameters VariableNameSize VariableName VendorGuid Description GetNextVariableName() of all variables currently available in the system. On each call to...
  • Page 99 Once is performed, variables that are only visible during boot services ExitBootServices() will no longer be returned. To obtain the data contents or attribute for a variable returned by GetNextVariableName(), Status Codes Returned EFI_SUCCESS The function completed successfully. EFI_NOT_FOUND The next variable was not found. EFI_BUFFER_TOO_SMALL VariableNameSize to complete the request.
  • Page 100: Setvariable()

    Extensible Firmware Interface Specification 3.5.3 SetVariable() Summary Sets the value of a variable. Prototype EFI_STATUS SetVariable ( IN CHAR16 IN EFI_GUID IN UINT32 IN UINTN IN VOID Parameters VariableName VendorGuid Attributes DataSize Data Description Variables are stored by the firmware and may maintain their values across power cycles. Each vendor may create and manage its own variables without the risk of name conflicts by using a unique VendorGuid.
  • Page 101 EFI_VARIABLE_NON_VOLATILE storage capacity; sometimes a severely limited capacity. Software should only use a non-volatile variable when absolutely necessary. In addition, if software uses a non-volatile variable it should use a variable that is only accessible at boot services time if possible. A variable must contain one or more bytes of Data.
  • Page 102: Time Services Functions

    Extensible Firmware Interface Specification Time Services This section contains function definitions for time-related functions that are typically needed by operating systems at runtime to access underlying hardware that manages time information and services. The purpose of these interfaces is to provide operating system writers with an abstraction for hardware time devices, thereby relieving the need to access legacy hardware devices directly.
  • Page 103: Gettime()

    3.6.1 GetTime() Summary Returns the current time and date information, and the time-keeping capabilities of the hardware platform. Prototype EFI_STATUS GetTime ( OUT EFI_TIME OUT EFI_TIME_CAPABILITIES Parameters A pointer to storage to receive a snapshot of the current time. Type Time EFI_TIME An optional pointer to a buffer to receive the real time clock device’s...
  • Page 104 Extensible Firmware Interface Specification //******************************************************* // Bit Definitions for EFI_TIME.Daylight. //******************************************************* #define EFI_TIME_ADJUST_DAYLIGHT #define EFI_TIME_IN_DAYLIGHT //******************************************************* // Value Definition for EFI_TIME.TimeZone. //******************************************************* #define EFI_UNSPECIFIED_TIMEZONE Year, Month, Day Hour, Minute, Second, Nanosecond TimeZone Daylight See below. 0x01 0x02 See below. 0x07FF The current local date.
  • Page 105 //******************************************************* // EFI_TIME_CAPABILITIES //******************************************************* // This provides the capabilities of the // real time clock device as exposed through the EFI interfaces. typedef struct { UINT32 Resolution; UINT32 Accuracy; BOOLEAN SetsToZero; } EFI_TIME_CAPABILITIES; Provides the reporting resolution of the real-time clock device in counts Resolution per second.
  • Page 106: Settime()

    Extensible Firmware Interface Specification 3.6.2 SetTime() Summary Sets the current local time and date information. Prototype EFI_STATUS SetTime ( IN EFI_TIME Parameters A pointer to the current time. Type Time Section 3.6.1. Full error checking is performed on the different fields of for full details), and field is out of range.
  • Page 107: Getwakeuptime()

    3.6.3 GetWakeupTime() Summary Returns the current wakeup alarm clock setting. Prototype EFI_STATUS GetWakeupTime ( OUT BOOLEAN OUT BOOLEAN OUT EFI_TIME Parameters Indicates if the alarm is currently enabled or disabled. Enabled Indicates if the alarm signal is pending and requires acknowledgement. Pending The current alarm setting.
  • Page 108: Setwakeuptime()

    Extensible Firmware Interface Specification 3.6.4 SetWakeupTime() Summary Sets the system wakeup alarm clock time. Prototype EFI_STATUS SetWakeupTime ( IN BOOLEAN IN EFI_TIME Parameters Enable or disable the wakeup alarm. Enable Time Enable EFI_TIME parameter is optional, and may be NULL.
  • Page 109: Virtual Memory Services

    Virtual Memory Services This section contains function definitions for the virtual memory support that may be optionally used by an operating system at runtime. If an operating system chooses to make EFI runtime service calls in a virtual addressing mode instead of the flat physical mode, then the operating system must use the services in this section to switch the EFI runtime services from flat physical addressing to virtual addressing.
  • Page 110: Setvirtualaddressmap()

    Extensible Firmware Interface Specification 3.7.1 SetVirtualAddressMap() Summary Changes the runtime addressing mode of EFI firmware from physical to virtual. Prototype EFI_STATUS SetVirtualAddressMap ( IN UINTN IN UINTN IN UINT32 IN EFI_MEMORY_DESCRIPTOR Parameters MemoryMapSize DescriptorSize DescriptorVersion VirtualMap Description SetVirtualAddressMap() called at runtime, and is called by the owner of the system’s memory map. I.e., the component which called ExitBootServices().
  • Page 111 A virtual address map may only be applied one time. Once the runtime system is in virtual mode, calls to this function return EFI_UNSUPPORTED. Status Codes Returned EFI_SUCCESS The virtual address map has been applied. EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in virtual address mapped mode.
  • Page 112: Convertpointer()

    Extensible Firmware Interface Specification 3.7.2 ConvertPointer() Summary Determines the new virtual address that is to be used on subsequent memory accesses. Prototype EFI_STATUS ConvertPointer ( IN UINTN IN VOID Parameters DebugDisposition Address Related Definitions //******************************************************* // EFI_OPTIONAL_PTR //******************************************************* #define EFI_OPTIONAL_PTR...
  • Page 113: Miscellaneous Services Functions

    Miscellaneous Services This section contains the remaining function definitions for services not defined elsewhere but which are required to complete the definition of the EFI environment. Table 3-13 lists the Miscellaneous Services Functions. Table 3-13. Miscellaneous Services Functions Name ResetSystem SetWatchDogTimer Stall GetNextMonotonicCount...
  • Page 114: Resetsystem()

    Extensible Firmware Interface Specification 3.8.1 ResetSystem() Summary Resets the entire platform. Prototype VOID ResetSystem ( IN EFI_RESET_TYPE IN EFI_STATUS IN UINTN IN CHAR16 Parameters The type of reset to perform. Type ResetType “Related Definitions”. The status code for the reset. If the system reset is part of a normal ResetStatus operation, the status code would be EFI_SUCCESS.
  • Page 115 Description The ResetSystem()function resets the entire platform, including all processors and devices, and reboots the system. Calling this interface with ResetType all circuitry within the system to its initial state. This type of reset is asynchronous to system operation and operates without regard to cycle boundaries. system power cycle.
  • Page 116: Setwatchdogtimer()

    Extensible Firmware Interface Specification 3.8.2 SetWatchdogTimer() Summary Sets the system’s watchdog timer. Prototype EFI_STATUS SetWatchdogTimer ( IN UINTN IN UINT64 IN UINTN IN CHAR16 Parameters The number of seconds to set the watchdog timer to. A value of zero Timeout disables the timer.
  • Page 117 Status Codes Returned EFI_SUCCESS The timeout has been set. The supplied EFI_INVALID_PARAMETER EFI_UNSUPPORTED The system does not have a watchdog timer. EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware error. Version 1.02 WatchdogCode is invalid. 12/12/00 Services...
  • Page 118: Stall()

    Extensible Firmware Interface Specification 3.8.3 Stall() Summary Induces a fine-grained stall. Prototype EFI_STATUS Stall ( IN UINTN Parameters The number of microseconds to stall execution. Microseconds Description function stalls execution on the processor for at least the requested number of Stall() microseconds.
  • Page 119: Getnextmonotoniccount()

    3.8.4 GetNextMonotonicCount() Summary Returns a monotonically increasing count for the platform. Prototype EFI_STATUS GetNextMonotonicCount ( OUT UINT64 Parameters Pointer to returned value. Count Description GetNextMonotonicCount() then the last time the function was called. The platform’s monotonic counter is comprised of two parts: the high 32 bits and the low 32 bits. The low 32 bit value is volatile and is reset to zero on every system reset.
  • Page 120: Getnexthighmonotoniccount()

    Extensible Firmware Interface Specification 3.8.5 GetNextHighMonotonicCount() Summary Returns the next high 32 bits of the platform’s monotonic counter. Prototype EFI_STATUS GetNextHighMonotonicCount ( OUT UINT32 Parameters Pointer to returned value. HighCount Description GetNextHighMonotonicCount() monotonic counter. The platform’s monotonic counter is comprised of two 32 bit quantities: the high 32 bits and the low 32 bits.
  • Page 121: Installconfigurationtable()

    3.8.6 InstallConfigurationTable() Summary Adds, updates, or removes a configuration table entry from the EFI System Table. Prototype EFI_STATUS InstallConfigurationTable ( IN EFI_GUID IN VOID Parameters A pointer to the GUID for the entry to add, update, or remove. Guid A pointer to the configuration table for the entry to add, update, or Table remove.
  • Page 122 Extensible Firmware Interface Specification If an add, modify, or remove operation is completed, then EFI_SUCCESS is returned. Note: If there is not enough memory to perform an add operation, then EFI_OUT_OF_RESOURCES Status Codes Returned EFI_SUCCESS EFI_INVALID_PARAMETER EFI_NOT_FOUND EFI_OUT_OF_RESOURCES is returned.
  • Page 123: Loaded_Image Protocol

    This chapter defines EFI images, a class of files that contain executable code. We begin by describing the EFI_LOADED_IMAGE OS loaders, and drivers. LOADED_IMAGE Protocol This section provides a detailed description of the Summary Can be used on any image handle to obtain information about the loaded image. GUID #define LOADED_IMAGE_PROTOCOL {5B1B31A1-9562-11d2-8E3F-00A0C969723B}...
  • Page 124 Extensible Firmware Interface Specification Protocol Interface Structure typedef struct { UINT32 EFI_HANDLE EFI_SYSTEM_TABLE // Source location of the image EFI_HANDLE EFI_DEVICE_PATH VOID // Image’s load options UINT32 VOID // Location where image was loaded VOID UINT64 EFI_MEMORY_TYPE EFI_MEMORY_TYPE EFI_IMAGE_UNLOAD } EFI_LOADED_IMAGE;...
  • Page 125 A pointer to the image’s binary load options. LoadOptions The base address at which the image was loaded. ImageBase The size in bytes of the loaded image. ImageSize The memory type that the code sections were loaded as. Type ImageCodeType EFI_MEMORY_TYPE The memory type that the data sections were loaded as.
  • Page 126: Loaded_Image.unload()

    Extensible Firmware Interface Specification 4.1.1 LOADED_IMAGE.Unload() Summary Unloads an image from memory. Prototype typedef EFI_STATUS (EFIAPI *EFI_UNLOAD_IMAGE) ( IN EFI_HANDLE Parameters The handle to the image to unload. Type ImageHandle Chapter 3. Description function unloads an image from memory if...
  • Page 127: Efi Image Header

    EFI Image Header EFI Images are a class of files defined by EFI that contain executable code. The most distinguishing feature of EFI Images is that the first set of bytes in the EFI Image file contains an image header that defines the encoding of the executable image. EFI uses a subset of the PE32+ image format with a modified header signature.
  • Page 128: Efi Applications

    Extensible Firmware Interface Specification EFI Applications Applications are loaded by the boot manager in the EFI firmware, or by other applications. To load an application the firmware allocates enough memory to hold the image, copies the sections within the application to the allocated memory and applies the relocation fix-ups needed. Once done, the allocated memory is set to be the proper type for code and data for the image.
  • Page 129: Efi Image Handoff State

    When the boot manager loads a driver, the image handle may be used to locate the “load options” for the driver. The load options are those options that were stored in the information for the driver. EFI_LOADED_IMAGE 4.5.1 EFI Image Handoff State Control is transferred to a loaded image at the the normal indirect calling conventions for the image’s function of type EFI_IMAGE_ENTRY_POINT.
  • Page 130 Extensible Firmware Interface Specification // EFI System Table #define EFI_SYSTEM_TABLE_SIGNATURE #define EFI_SYSTEM_TABLE_REVISION typedef struct _EFI_SYSTEM_TABLE { EFI_TABLE_HEADER CHAR16 UINT32 EFI_HANDLE SIMPLE_INPUT_INTERFACE EFI_HANDLE SIMPLE_TEXT_OUTPUT_INTERFACE EFI_HANDLE SIMPLE_TEXT_OUTPUT_INTERFACE EFI_RUNTIME_SERVICES EFI_BOOT_SERVICES UINTN EFI_CONFIGURATION_TABLE } EFI_SYSTEM_TABLE; // Standard EFI table header typedef struct _EFI_TABLE_HEADER {...
  • Page 131 typedef struct_EFI_CONFIGURATION_TABLE { EFI_GUID VOID } EFI_CONFIGURATION_TABLE; The EFI system table contains pointers to the runtime and boot services tables. The definitions for these tables are shown in the following code fragments. Except for the table header, all elements in the service tables are prototypes of function pointers to functions as defined in Chapter 3.
  • Page 132 Extensible Firmware Interface Specification EFI_GET_VARIABLE EFI_GET_NEXT_VARIABLE_NAME EFI_SET_VARIABLE // Miscellaneous Services EFI_GET_NEXT_HIGH_MONO_COUNT EFI_RESET_SYSTEM } EFI_RUNTIME_SERVICES; // EFI Boot Services Table #define EFI_BOOT_SERVICES_SIGNATURE #define EFI_BOOT_SERVICES_REVISION typedef struct _EFI_BOOT_SERVICES { EFI_TABLE_HEADER // Task Priority Services EFI_RAISE_TPL EFI_RESTORE_TPL // Memory Services EFI_ALLOCATE_PAGES EFI_FREE_PAGES EFI_GET_MEMORY_MAP...
  • Page 133: Ia-32 Handoff State

    EFI_INSTALL_PROTOCOL_INTERFACE EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface; EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface; EFI_HANDLE_PROTOCOL EFI_HANDLE_PROTOCOL EFI_REGISTER_PROTOCOL_NOTIFY EFI_LOCATE_HANDLE EFI_LOCATE_DEVICE_PATH EFI_INSTALL_CONFIGURATION_TABLE // Image Services EFI_IMAGE_LOAD EFI_IMAGE_START EFI_EXIT EFI_IMAGE_UNLOAD EFI_EXIT_BOOT_SERVICES // Miscellaneous Services ...// See note about InstallConfigurationTable() under “Protocol Handler ...// Services” above. EFI_GET_NEXT_MONOTONIC_COUNT EFI_STALL EFI_SET_WATCHDOG_TIMER } EFI_BOOT_SERVICES; 4.5.1.1 IA-32 Handoff State When an IA-32 EFI OS is loaded, the system firmware hands off control to the OS in flat 32-bit mode.
  • Page 134: Handoff State, Itanium-Based Operating Systems

    Extensible Firmware Interface Specification 4.5.1.2 Handoff State, Itanium-based Operating Systems EFI uses the standard P64 C calling conventions that are defined for Itanium-based operating systems. Figure 4-2 shows the stack after systems. The arguments are also stored in registers: out0 contains contains the address of the EFI_SYSTEM_TABLE.
  • Page 135: Device Path Overview

    Device Path Protocol This chapter contains the definition of the device path protocol and the information needed to construct and manage device paths in the EFI environment. A device path is constructed and used by the firmware to convey the location of important devices, such as the boot device and console, consistent with the software-visible topology of the system.
  • Page 136: Efi_Device_Path Protocol

    Extensible Firmware Interface Specification EFI_DEVICE_PATH Protocol This section provides a detailed description of the Summary Can be used on any device handle to obtain generic path/location information concerning the physical device or logical device. If the handle does not logically map to a physical device, the handle may not necessarily support the device path protocol.
  • Page 137: Device Path Nodes

    Device Path Nodes There are six major types of Device Path nodes: • Hardware Device Path. This Device Path defines how a device is attached to the resource domain of a system, where resource domain is simply the shared memory, memory mapped I/O, and I/O space of the system.
  • Page 138: Hardware Device Path

    Extensible Firmware Interface Specification A Device Path is a series of generic Device Path nodes. The first Device Path node starts at byte offset zero of the Device Path. The next Device Path node starts at the end of the previous Device Path node.
  • Page 139: Pci Device Path

    5.3.2.1 PCI Device Path The Device Path for PCI defines the path to the PCI configuration space address for a PCI device. There is one PCI Device Path entry for each device and function number that defines the path from the root PCI bus to the device.
  • Page 140: Memory Mapped Device Path

    Extensible Firmware Interface Specification 5.3.2.3 Memory Mapped Device Path Table 5-5. Memory Mapped Device Path Byte Mnemonic Offset Type Sub-Type Length Memory Type Start Address End Address 5.3.2.4 Vendor Device Path The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must allocate a Vendor_GUID for a Device Path.
  • Page 141: Acpi Device Path

    5.3.3 ACPI Device Path This Device Path contains ACPI Device IDs that represent a device’s Plug and Play Hardware ID and its corresponding unique persistent ID. The ACPI IDs are stored in the ACPI _HID and _UID device identification objects that are associated with a device. The ACPI Device Path contains values that must match exactly the ACPI name space that is provided by the platform firmware to the operating system.
  • Page 142: Atapi Device Path

    Extensible Firmware Interface Specification 5.3.4.1 ATAPI Device Path Table 5-9. ATAPI Device Path Byte Mnemonic Offset Type Sub-Type Length PrimarySecondary SlaveMaster Logical Unit Number 5.3.4.2 SCSI Device Path Table 5-10. SCSI Device Path Byte Mnemonic Offset Type Sub-Type Length Target ID Logical Unit Number 5.3.4.3 Fibre Channel Device Path...
  • Page 143: 1394 Device Path

    5.3.4.4 1394 Device Path Table 5-12. 1394 Device Path Byte Mnemonic Offset Type Sub-Type Length Reserved GUID The usage of the term GUID is per the 1394 specification. This is not the same as the type defined in the EFI Specification. EFI_GUID 5.3.4.5 USB Device Path Table 5-13.
  • Page 144: Usb Class Device Path

    Extensible Firmware Interface Specification 5.3.4.6 USB Class Device Path Table 5-14. USB Class Device Path Byte Mnemonic Offset Type Sub-Type Length Vendor ID Product ID Device Class Device Subclass Device Protocol 5.3.4.7 I O Device Path Table 5-15. I O Device Path...
  • Page 145: Ipv4 Device Path

    5.3.4.9 IPv4 Device Path Table 5-17. IPv4 Device Path Byte Mnemonic Offset Type Sub-Type Length Local IP Address Remote IP Address Local Port Remote Port Protocol StaticIPAddress 5.3.4.10 IPv6 Device Path Table 5-18. IPv6 Device Path Byte Mnemonic Offset Type Sub-Type Length Local IP Address...
  • Page 146: Infiniband † Device Path

    Extensible Firmware Interface Specification † 5.3.4.11 InfiniBand Device Path † Table 5-19. InfiniBand Device Path Byte Mnemonic Offset Type Sub-Type Length Reserved Node GUID IOC GUID Device ID The usage of the term GUID is per the Infiniband specification. This is not the same as the type defined in the EFI Specification.
  • Page 147: Vendor-Defined Messaging Device Path

    5.3.4.13 Vendor-Defined Messaging Device Path Table 5-21. Vendor-Defined Messaging Device Path Byte Mnemonic Offset Type Sub-Type Length Vendor_GUID Vendor Defined Data The following two GUIDs are used with a Vendor-Defined Messaging Device Path to describe the transport protocol for use with PC-ANSI and VT-100 terminals. Device paths can be constructed with this node as the last node in the device path.
  • Page 148: Hard Drive Media Device Path

    Extensible Firmware Interface Specification Table 5-22. Hard Drive Media Device Path Byte Mnemonic Offset Type Sub-Type Length Partition Number Partition Start Partition Size Partition Signature MBR Type Signature Type The following structure defines an MBR for EFI: Typedef struct _MBR_PARTITION { UINT8 BootIndicator;...
  • Page 149: Cd-Rom Media Device Path

    5.3.5.2 CD-ROM Media Device Path The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM. The CD-ROM is assumed to contain an ISO-9660 file system and follow the CD-ROM “El Torito” format. The Boot Entry number from the Boot Catalog is how the “El Torito” specification defines the existence of bootable entities on a CD-ROM.
  • Page 150: File Path Media Device Path

    Extensible Firmware Interface Specification 5.3.5.4 File Path Media Device Path Table 5-25. File Path Media Device Path Byte Mnemonic Offset Type Sub-Type Length Path Name 5.3.5.5 Media Protocol Device Path The Media Protocol Device Path is used to denote the protocol that is being used in a device path at the location of the path specified.
  • Page 151: Bios Boot Specification Device Path

    5.3.6 BIOS Boot Specification Device Path This Device Path is used to describe the booting of non-EFI-aware operating systems. This Device Path is based on the IPL and BCV table entry data structures defined in Appendix A of the BIOS Boot Specification.
  • Page 152: Rules With Acpi _Hid And _Uid

    Extensible Firmware Interface Specification Device Path structure in the stream. Any future additions to the Device Path structure types will always start with the current standard header. The size of a Device Path can be determined by traversing the generic Device Path structures in each header and adding up the total size of the Device Path.
  • Page 153: Rules With Acpi _Adr

    5.4.3 Rules with ACPI _ADR If a device in the ACPI name space can be completely described by a _ADR object then it will map to an EFI ACPI, Hardware, or Message Device Path structure. A _ADR method implies a bus with a standard enumeration algorithm.
  • Page 154: Media Device Path Rules

    Extensible Firmware Interface Specification 5.4.5 Media Device Path Rules The Media Device Path is used to define the location of information on a medium. Hard Drives are subdivided into partitions by the MBR and a Media Device Path is used to define which partition is being used.
  • Page 155: Device I/O Overview

    This chapter defines the Device I/O protocol. This protocol is used by code, typically drivers, running in the EFI boot services environment to access memory and I/O. In particular, functions for managing PCI buses are defined here although other bus types may be supported in a similar fashion as extensions to this specification.
  • Page 156: Device_Io Protocol

    Extensible Firmware Interface Specification DEVICE_IO Protocol Summary Provides the basic Memory, I/O, and PCI interfaces that are used to abstract accesses to devices. GUID #define DEVICE_IO_PROTOCOL \ { af6ac311-84c3-11d2-8e3c-00a0c969723b } Protocol Interface Structure typedef struct _EFI_DEVICE_IO_INTERFACE { EFI_IO_ACCESS EFI_IO_ACCESS EFI_IO_ACCESS...
  • Page 157 Description protocol provides the basic Memory, I/O, and PCI interfaces that are used to DEVICE_IO abstract accesses to devices. A driver that controls a physical device obtains the proper checking for the supported protocol on the programmatic parent(s) for the device. This is easily done via the LocateDevicePath() The following C code fragment illustrates the use of the...
  • Page 158 Extensible Firmware Interface Specification Related Definitions //******************************************************* // EFI_IO_WIDTH //******************************************************* typedef enum { IO_UINT8 = 0, IO_UINT16 = 1, IO_UINT32 = 2, IO_UINT64 = 3 } EFI_IO_WIDTH; //******************************************************* // EFI_DEVICE_IO //******************************************************* typedef EFI_STATUS (EFIAPI *EFI_DEVICE_IO) ( IN struct _EFI_DEVICE_IO_INTERFACE IN EFI_IO_WIDTH...
  • Page 159: Device_Io.mem(), .Io(), And .Pci()

    6.2.1 DEVICE_IO.Mem(), .Io(), and .Pci() Summary Enable a driver to access device registers in the appropriate memory or I/O space. Prototype typedef EFI_STATUS (EFIAPI *EFI_DEVICE_IO) ( IN struct EFI_DEVICE_IO_INTERFACE IN EFI_IO_WIDTH IN UINT64 IN UINTN IN OUT VOID Parameters A pointer to the This EFI_DEVICE_IO_INTERFACE Signifies the width of the I/O operations.
  • Page 160: Pci Address

    Extensible Firmware Interface Specification Table 6-1. PCI Address Byte Mnemonic Offset Register Function Device Segment Reserved Status Codes Returned EFI_SUCCESS EFI_UNSUPPORTED EFI_INVALID_PARAMETER EFI_OUT_OF_RESOURCES Byte Length Description The register number on the function. The function on the device. The device on the bus.
  • Page 161: Device_Io.pcidevicepath()

    6.2.2 DEVICE_IO.PciDevicePath() Summary Provides an EFI Device Path for a PCI device with the given PCI configuration space address. Prototype typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( IN EFI_DEVICE_IO_INTERFACE IN UINT64 IN OUT EFI_DEVICE_PATH Parameters A pointer to the EFI_DEVICE_IO_INTERFACE. Type This EFI_DEVICE_IO_INTERFACE The PCI configuration space address of the device whose Device Path is PciAddress...
  • Page 162: Device_Io.map()

    Extensible Firmware Interface Specification 6.2.3 DEVICE_IO.Map() Summary Provides the device specific addresses needed to access system memory. Prototype typedef EFI_STATUS (EFIAPI *EFI_IO_MAP) ( IN EFI_DEVICE_IO_INTERFACE IN EFI_IO_OPERATION_TYPE IN EFI_PHYSICAL_ADDRESS IN OUT UINTN OUT EFI_PHYSICAL_ADDRESS OUT VOID Parameters A pointer to the...
  • Page 163 Related Definitions //******************************************************* // EFI_IO_OPERATION_TYPE //******************************************************* typedef enum { EfiBusMasterRead, EfiBusMasterWrite, EfiBusMasterCommonBuffer } EFI_IO_OPERATION_TYPE; EfiBusMasterRead EfiBusMasterWrite EfiBusMasterCommonBuffer Description function provides the device specific addresses needed to access system DEVICE_IO.Map() memory. This function is used to map system memory for bus master DMA accesses. All bus master accesses must be performed through their mapped addresses and such mappings must be freed with when complete.
  • Page 164: Device_Io.unmap()

    Extensible Firmware Interface Specification 6.2.4 DEVICE_IO.Unmap() Summary Completes the operation and releases any corresponding resources. Map() Prototype typedef EFI_STATUS (EFIAPI *EFI_IO_UNMAP) ( IN EFI_DEVICE_IO_INTERFACE IN VOID Parameters A pointer to the This EFI_DEVICE_IO_INTERFACE The mapping value returned from Map(). Mapping...
  • Page 165: Device_Io.allocatebuffer()

    6.2.5 DEVICE_IO.AllocateBuffer() Summary Allocates pages that are suitable for an Prototype typedef EFI_STATUS (EFIAPI *EFI_IO_ALLOCATE_BUFFER) ( IN EFI_DEVICE_IO_INTERFACE IN EFI_ALLOCATE_TYPE IN EFI_MEMORY_TYPE IN UINTN IN OUT EFI_PHYSICAL_ADDRESS Parameters A pointer to the EFI_DEVICE_IO_INTERFACE. Type This EFI_DEVICE_IO_INTERFACE The type allocation to perform. Type Type defined in Chapter 3.
  • Page 166 Extensible Firmware Interface Specification Allocation requests of Type AllocateMaxAddress that satisfies the request that are below or equal to the value pointed to by input. On success, the value pointed to by allocated. If there are not enough consecutive available pages below the requested address, an error is returned.
  • Page 167: Device_Io.flush()

    6.2.6 DEVICE_IO.Flush() Summary Flushes any posted write data to the device. Prototype typedef EFI_STATUS (EFIAPI *EFI_IO_FLUSH) ( IN EFI_DEVICE_IO_INTERFACE Parameters A pointer to the This EFI_DEVICE_IO_INTERFACE Description function flushes any posted write data to the device. Flush() Status Codes Returned EFI_SUCCESS EFI_DEVICE_ERROR Version 1.02...
  • Page 168: Device_Io.freebuffer()

    Extensible Firmware Interface Specification 6.2.7 DEVICE_IO.FreeBuffer() Summary Frees pages that were allocated with AllocateBuffer(). Prototype typedef EFI_STATUS (EFIAPI *EFI_IO_FREE_BUFFER) ( IN EFI_DEVICE_IO_INTERFACE IN UINTN IN EFI_PHYSICAL_ADDRESS Parameters A pointer to the EFI_DEVICE_IO_INTERFACE. Type This EFI_DEVICE_IO_INTERFACE The number of pages to free.
  • Page 169: Console I/O Overview

    Console I/O Protocol This chapter defines the Console I/O protocol. This protocol is used to handle input and output of text-based information intended for the system user during the operation of code in the EFI boot services environment. Also included here are the definitions of three console devices: one for input and one each for normal output and errors.
  • Page 170: Consolein Definition

    Extensible Firmware Interface Specification ConsoleIn Definition protocol defines an input stream that contains Unicode characters and SIMPLE_INPUT required EFI scan codes. Only the control characters defined in Table 7-1 have meaning in the Unicode input or output streams. The control characters are defined to be characters U+0000 through U+001F.
  • Page 171 Table 7-2. EFI Scan Codes for SIMPLE_INPUT_INTERFACE (continued) EFI Scan Code Description 0x0b Function 1. 0x0c Function 2. 0x0d Function 3. 0x0e Function 4. 0x0f Function 5. 0x10 Function 6. 0x11 Function 7. 0x12 Function 8. 0x13 Function 9. 0x14 Function 10.
  • Page 172: Simple_Input Protocol

    Extensible Firmware Interface Specification SIMPLE_INPUT Protocol Summary This protocol is used to obtain input from the GUID #define SIMPLE_INPUT_PROTOCOL \ { 387477c1-69c7-11d2-8e39-00a0c969723b } Protocol Interface Structure typedef struct _SIMPLE_INPUT_INTERFACE { EFI_INPUT_RESET EFI_INPUT_READ_KEY EFI_EVENT } SIMPLE_INPUT_INTERFACE; Parameters Reset the Reset Returns the next input character. See Section 7.3.2.
  • Page 173: Simple_Input.reset()

    7.3.1 SIMPLE_INPUT.Reset() Summary Resets the input device hardware. Prototype EFI_STATUS (EFIAPI *EFI_INPUT_RESET) ( IN SIMPLE_INPUT_INTERFACE IN BOOLEAN Parameters This ExtendedVerification Description function resets the input device hardware. Reset() As part of initialization process, the firmware/device will make a quick but reasonable attempt to verify that the device is functioning.
  • Page 174: Simple_Input.readkeystroke

    Extensible Firmware Interface Specification 7.3.2 SIMPLE_INPUT.ReadKeyStroke Summary Reads the next keystroke from the input device. Prototype EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY) ( IN SIMPLE_INPUT_INTERFACE OUT EFI_INPUT_KEY Parameters This Related Definitions //******************************************************* // EFI_INPUT_KEY //******************************************************* typedef struct { UINT16 ScanCode; CHAR16 UnicodeChar; } EFI_INPUT_KEY;...
  • Page 175: Consoleout Or Standarderror

    ConsoleOut or StandardError SIMPLE_TEXT_OUTPUT protocol. The protocol must also support the Unicode control characters SIMPLE_INPUT defined in Table 7-1. The SIMPLE_TEXT_OUTPUT screen by programmatic methods and therefore does not support the EFI scan codes defined in Table 7-2. SIMPLE_TEXT_OUTPUT Protocol Summary This protocol is used to control text-based output devices.
  • Page 176 Extensible Firmware Interface Specification Sets the foreground and background color of the text that is output. See SetAttribute Section 7.5.6. Clears the screen with the currently set background color. See ClearScreen Section 7.5.7. Sets the current cursor position. See Section 7.5.8.
  • Page 177 Console I/O Protocol Description protocol is used to control text-based output devices. It is the SIMPLE_TEXT_OUTPUT minimum required protocol for any handle supplied as the ConsoleOut StandardError device. In addition, the minimum supported text mode of such devices is at least 80 x 25 characters.
  • Page 178: Simple_Text_Output.reset()

    Extensible Firmware Interface Specification 7.5.1 SIMPLE_TEXT_OUTPUT.Reset() Summary Resets the text output device hardware. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_RESET) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN BOOLEAN Parameters This ExtendedVerification Description function resets the text output device hardware. The cursor position is set to (0, 0), Reset() and the screen is cleared to the default background color for the output device.
  • Page 179: Simple_Text_Output.outputstring()

    7.5.2 SIMPLE_TEXT_OUTPUT.OutputString() Summary Writes a Unicode string to the output device. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_STRING) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN CHAR16 Parameters A pointer to the This Type The Null-terminated Unicode string to be displayed on the output String device(s). All output devices must also support the Unicode drawing characters defined in “Related Definitions”.
  • Page 180 Extensible Firmware Interface Specification #define BOXDRAW_DOWN_LEFT_DOUBLE #define BOXDRAW_DOWN_DOUBLE_LEFT #define BOXDRAW_DOUBLE_DOWN_LEFT #define BOXDRAW_UP_RIGHT_DOUBLE #define BOXDRAW_UP_DOUBLE_RIGHT #define BOXDRAW_DOUBLE_UP_RIGHT #define BOXDRAW_UP_LEFT_DOUBLE #define BOXDRAW_UP_DOUBLE_LEFT #define BOXDRAW_DOUBLE_UP_LEFT #define BOXDRAW_VERTICAL_RIGHT_DOUBLE #define BOXDRAW_VERTICAL_DOUBLE_RIGHT #define BOXDRAW_DOUBLE_VERTICAL_RIGHT #define BOXDRAW_VERTICAL_LEFT_DOUBLE #define BOXDRAW_VERTICAL_DOUBLE_LEFT #define BOXDRAW_DOUBLE_VERTICAL_LEFT #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL...
  • Page 181 //******************************************************* // EFI Required Arrow shapes //******************************************************* #define ARROW_UP #define ARROW_DOWN Description function writes a Unicode string to the output device. This is the most OutputString() basic output mechanism on an output device. The location on the output device(s) and the cursor is advanced according to the following rules: Mnemonic Unicode Description...
  • Page 182: Simple_Text_Output.teststring()

    Extensible Firmware Interface Specification 7.5.3 SIMPLE_TEXT_OUTPUT.TestString() Summary Verifies that all characters in a Unicode string can be output to the target device. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_TEST_STRING) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN CHAR16 Parameters A pointer to the This Type The Null-terminated Unicode string to be examined for the output String device(s).
  • Page 183: Simple_Text_Output.querymode()

    7.5.4 SIMPLE_TEXT_OUTPUT.QueryMode() Summary Returns information for an available text mode that the output device(s) supports. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_QUERY_MODE) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN UINTN OUT UINTN OUT UINTN Parameters A pointer to the This Type The mode number to return information on. ModeNumber Returns the geometry of the text output device for the request Columns, Rows...
  • Page 184: Simple_Text_Output.setmode()

    Extensible Firmware Interface Specification 7.5.5 SIMPLE_TEXT_OUTPUT.SetMode() Summary Sets the output device(s) to a specified mode. Prototype EFI_STATUS (* EFIAPI EFI_TEXT_SET_MODE) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN UINTN Parameters A pointer to the This Type The text mode to set. ModeNumber Description function sets the output device(s) to the requested mode.
  • Page 185: Simple_Text_Output.setattribute()

    7.5.6 SIMPLE_TEXT_OUTPUT.SetAttribute() Summary Sets the background and foreground colors for the functions. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN UINTN Parameters A pointer to the This Type The attribute to set. Bits 0..3 are the foreground color, and bits 4..6 are Attribute the background color.
  • Page 186 Extensible Firmware Interface Specification #define EFI_BACKGROUND_BLACK #define EFI_BACKGROUND_BLUE #define EFI_BACKGROUND_GREEN #define EFI_BACKGROUND_CYAN #define EFI_BACKGROUND_RED #define EFI_BACKGROUND_MAGENTA #define EFI_BACKGROUND_BROWN #define EFI_BACKGROUND_LIGHTGRAY #define EFI_TEXT_ATTR(foreground,background) ((foreground) | ((background) << 4)) Description function sets the background and foreground colors for the SetAttribute() OutputString() ClearScreen() The color mask can be set even when the device is in an invalid text mode.
  • Page 187: Simple_Text_Output.clearscreen()

    7.5.7 SIMPLE_TEXT_OUTPUT.ClearScreen() Summary Clears the output device(s) display to the currently selected background color. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_CLEAR_SCREEN) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This Parameters A pointer to the This Type Description function clears the output device(s) display to the currently selected ClearScreen() background color.
  • Page 188: Simple_Text_Output.setcursorposition()

    Extensible Firmware Interface Specification 7.5.8 SIMPLE_TEXT_OUTPUT.SetCursorPosition() Summary Sets the current coordinates of the cursor position. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN UINTN IN UINTN Parameters A pointer to the This Type The position to set the cursor to. Must greater than or equal to zero and Column, Row less than the number of columns and rows returned by QueryMode().
  • Page 189: Simple_Text_Output.enablecursor()

    7.5.9 SIMPLE_TEXT_OUTPUT.EnableCursor() Summary Makes the cursor visible or invisible. Prototype EFI_STATUS (EFIAPI *EFI_TEXT_ENABLE_CURSOR) ( IN SIMPLE_TEXT_OUTPUT_INTERFACE *This, IN BOOLEAN Parameters A pointer to the This Type If TRUE, the cursor is set to be visible. If FALSE, the cursor is set to be Visible invisible.
  • Page 190 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 191: Block_Io Protocol

    This chapter defines the Block I/O protocol. This protocol is used to abstract mass storage devices to allow code running in the EFI boot services environment to access them without specific knowledge of the type of device or controller that manages the device. Functions are defined to read and write data at a block level from mass storage devices as well as to manage such devices in the EFI boot services environment.
  • Page 192 Extensible Firmware Interface Specification Parameters Revision Media Reset ReadBlocks WriteBlocks FlushBlocks The following data values in code that produces the EFI_BLOCK_IO MediaId RemovableMedia MediaPresent LogicalPartition ReadOnly WriteCaching BlockSize IoAlign LastBlock The revision to which the block IO interface adheres. All future revisions must be backwards compatible.
  • Page 193 Related Definitions //******************************************************* // EFI_BLOCK_IO_MEDIA //******************************************************* typedef struct { UINT32 BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN UINT32 UINT32 EFI_LBA } EFI_BLOCK_IO_MEDIA; //******************************************************* // EFI_LBA //******************************************************* typedef UINT64 Description LogicalPartition TRUE only one partition, the value will always be TRUE. For media that have multiple partitions, this value is for the handle that accesses the entire device.
  • Page 194: Efi_Block_Io.reset()

    Extensible Firmware Interface Specification 8.1.1 EFI_BLOCK_IO.Reset() Summary Resets the block device hardware. Prototype EFI_STATUS (EFIAPI *EFI_BLOCK_RESET) ( IN EFI_BLOCK_IO IN BOOLEAN Parameters This ExtendedVerification Description function resets the block device hardware. Reset() As part of the initialization process, the firmware/device will make a quick but reasonable attempt to verify that the device is functioning.
  • Page 195: Efi_Block_Io.readblocks()

    8.1.2 EFI_BLOCK_IO.ReadBlocks() Summary Reads the requested number of blocks from the device. Prototype EFI_STATUS (EFIAPI *EFI_BLOCK_READ) ( IN EFI_BLOCK_IO IN UINT32 IN EFI_LBA IN UINTN OUT VOID Parameters Indicates a pointer to the calling context. Type This defined in Section 8.1. The media id that the read request is for.
  • Page 196 Extensible Firmware Interface Specification Status Codes Returned EFI_SUCCESS EFI_DEVICE_ERROR EFI_NO_MEDIA EFI_MEDIA_CHANGED EFI_BAD_BUFFER_SIZE EFI_INVALID_PARAMETER The data was read correctly from the device. The device reported an error while attempting to perform the read operation. There is no media in the device.
  • Page 197: Efi_Block_Io.writeblocks()

    8.1.3 EFI_BLOCK_IO.WriteBlocks() Summary Writes a specified number of blocks to the device. Prototype EFI_STATUS (EFIAPI *EFI_BLOCK_WRITE) ( IN EFI_BLOCK_IO IN UINT32 IN EFI_LBA IN UINTN IN VOID Parameters Indicates a pointer to the calling context. Type This defined in Section 8.1. The media id that the write request is for.
  • Page 198 Extensible Firmware Interface Specification Status Codes Returned EFI_SUCCESS EFI_WRITE_PROTECTED EFI_NO_MEDIA EFI_MEDIA_CHANGED EFI_DEVICE_ERROR EFI_BAD_BUFFER_SIZE EFI_INVALID_PARAMETER The data were written correctly to the device. The device cannot be written to. There is no media in the device. MediaId is not for the current media.
  • Page 199: Block_Io.flushblocks()

    8.1.4 BLOCK_IO.FlushBlocks() Summary Flushes all modified data to a physical block device. Prototype EFI_STATUS (EFIAPI *EFI_BLOCK_FLUSH) ( IN EFI_BLOCK_IO Parameters Indicates a pointer to the calling context. Type This defined in Section 8.1. Description function flushes all modified data to the physical block device. FlushBlocks() All data written to the device prior to the flush must be physically written before returning from this function.
  • Page 200 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 201: Disk_Io Protocol

    This chapter defines the Disk I/O protocol. This protocol is used to abstract the block accesses of the Block I/O protocol to a more general offset-length protocol. The firmware is responsible for adding this protocol to any Block I/O interface that appears in the system that does not already have a Disk I/O protocol.
  • Page 202 Extensible Firmware Interface Specification Description protocol is used to control block I/O interfaces. EFI_DISK_IO The disk I/O functions allow I/O operations that need not be on the underlying device’s block boundaries or alignment requirements. This is done by copying the data to/from internal buffers as needed to provide the proper requests to the block I/O device.
  • Page 203: Efi_Disk_Io.readdisk()

    9.1.1 EFI_DISK_IO.ReadDisk() Summary Reads a specified number of bytes from a device. Prototype EFI_STATUS (EFIAPI *EFI_DISK_READ) ( IN EFI_DISK_IO IN UINT32 IN UINT64 IN UINTN OUT VOID Parameters Indicates a pointer to the calling context. Type This defined in Section 9.1. Id of the medium to be read.
  • Page 204: Efi_Disk_Io.writedisk()

    Extensible Firmware Interface Specification 9.1.2 EFI_DISK_IO.WriteDisk() Summary Writes a specified number of bytes to a device. Prototype EFI_STATUS (EFIAPI *EFI_DISK_WRITE) ( IN EFI_DISK_IO IN UINT32 IN UINT64 IN UNITN IN VOID Parameters Indicates a pointer to the calling context. Type This defined in Section 9.1.
  • Page 205: Simple File System Protocol

    This chapter defines the File System protocol. This protocol allows code running in the EFI boot services environment to obtain file based access to a device. The Simple File System protocol is used to open a device volume and return an device volume.
  • Page 206 Extensible Firmware Interface Specification Description The Simple File System protocol provides a minimal interface for file-type access to a device. This protocol is only supported on some devices. Devices that support the Simple File System protocol return an EFI_FILE_IO_INTERFACE. The only function of this interface is to open a handle to the root directory of the file system on the volume.
  • Page 207: Efi_File_Io_Interface.openvolume()

    10.1.1 EFI_FILE_IO_INTERFACE.OpenVolume() Summary Opens the root directory on a volume. Prototype typedef EFI_STATUS (EFIAPI *EFI_VOLUME_OPEN) ( IN EFI_FILE_IO_INTERFACE OUT EFI_FILE Parameters A pointer to the volume to open the root directory of. Type This EFI_FILE_IO_INTERFACE A pointer to the location to return the opened file handle for the root Root directory.
  • Page 208: Efi_File Protocol

    Extensible Firmware Interface Specification 10.2 EFI_FILE Protocol Summary Provides file based access to supported file systems. Revision Number #define EFI_FILE_REVISION Protocol Interface Structure typedef struct _EFI_FILE { UINT64 EFI_FILE_OPEN EFI_FILE_CLOSE EFI_FILE_DELETE EFI_FILE_READ EFI_FILE_WRITE EFI_FILE_GET_POSITION EFI_FILE_SET_POSITION EFI_FILE_GET_INFO EFI_FILE_SET_INFO EFI_FILE_FLUSH } EFI_FILE;...
  • Page 209 File System Protocol Description provides file IO access to supported file systems. EFI_FILE provides access to a file’s or directory’s contents, and is also a reference to a EFI_FILE location in the directory tree of the file system in which the file resides. With any given file handle, other files may be opened relative to this file’s location, yielding new file handles.
  • Page 210: Efi_File.open()

    Extensible Firmware Interface Specification 10.2.1 EFI_FILE.Open() Summary Opens a new file relative to the source file’s location. Prototype EFI_STATUS (EFIAPI *EFI_FILE_OPEN) ( IN EFI_FILE OUT EFI_FILE IN CHAR16 IN UINT64 IN UINT64 Parameters A pointer to the This location. This would typically be an open handle to a directory. Type EFI_FILE A pointer to the location to return the opened handle for the new file.
  • Page 211 Related Definitions //******************************************************* // Open Modes //******************************************************* #define EFI_FILE_MODE_READ #define EFI_FILE_MODE_WRITE #define EFI_FILE_MODE_CREATE //******************************************************* // File Attributes //******************************************************* #define EFI_FILE_READ_ONLY #define EFI_FILE_HIDDEN #define EFI_FILE_SYSTEM #define EFI_FILE_RESERVED #define EFI_FILE_DIRECTORY #define EFI_FILE_ARCHIVE #define EFI_FILE_VALID_ATTR Description The Open()function opens the file or directory referred to by and returns a NewHandle.
  • Page 212 Extensible Firmware Interface Specification Status Codes Returned EFI_SUCCESS EFI_NOT_FOUND EFI_NO_MEDIA EFI_MEDIA_CHANGED EFI_DEVICE_ERROR EFI_VOLUME_CORRUPTED EFI_WRITE_PROTECTED EFI_ACCESS_DENIED EFI_OUT_OF_RESOURCES EFI_VOLUME_FULL The file was opened. The specified file could not be found on the device. The device has no medium. The device has a different medium in it or the medium is no longer supported.
  • Page 213: Efi_File.close()

    10.2.2 EFI_FILE.Close() Summary Closes a specified file handle. Prototype EFI_STATUS (EFIAPI *EFI_FILE_CLOSE) ( IN EFI_FILE Parameters A pointer to the This Type Description function closes a specified file handle. All “dirty” cached file data is flushed to the Close() device, and the file is closed. In all cases the handle is closed. Status Codes Returned EFI_SUCCESS Version 1.02...
  • Page 214: Efi_File.delete()

    Extensible Firmware Interface Specification 10.2.3 EFI_FILE.Delete() Summary Closes and deletes a file. Prototype EFI_STATUS (EFIAPI *EFI_FILE_DELETE) ( IN EFI_FILE Parameters A pointer to the This delete. Type Description function closes and deletes a file. In all cases the file handle is closed. If the file...
  • Page 215: Efi_File.read()

    10.2.4 EFI_FILE.Read() Summary Reads data from a file. Prototype EFI_STATUS (EFIAPI *EFI_FILE_READ) ( IN EFI_FILE IN OUT UINTN OUT VOID Parameters A pointer to the This from. Type On input, the size of the Buffer. On output, the amount of data BufferSize returned in Buffer.
  • Page 216: Efi_File.write()

    Extensible Firmware Interface Specification 10.2.5 EFI_FILE.Write() Summary Writes data to a file. EFI_STATUS (EFIAPI *EFI_FILE_WRITE) ( IN EFI_FILE IN OUT UINTN IN VOID Parameters A pointer to the This to. Type On input, the size of the Buffer. On output, the amount of data BufferSize actually written.
  • Page 217: Efi_File.setposition()

    10.2.6 EFI_FILE.SetPosition() Summary Sets a file’s current position. Prototype EFI_STATUS (EFIAPI *EFI_FILE_SET_POSITION) ( IN EFI_FILE IN UINT64 Parameters A pointer to the This requested position on. Type The byte position from the start of the file to set. Position Description function sets the current file position for the handle to the position SetPosition() supplied.
  • Page 218: Efi_File.getposition()

    Extensible Firmware Interface Specification 10.2.7 EFI_FILE.GetPosition() Summary Returns a file’s current position. Prototype EFI_STATUS (EFIAPI *EFI_GET_POSITION) ( IN EFI_FILE OUT UINT64 Parameters A pointer to the This current position on. Type The address to return the file’s current position value.
  • Page 219: Efi_File.getinfo()

    10.2.8 EFI_FILE.GetInfo() Summary Returns information about a file. Prototype EFI_STATUS (EFIAPI *EFI_FILE_GET_INFO) ( IN EFI_FILE IN EFI_GUID IN OUT UINTN OUT VOID Parameters A pointer to the This information is for. Type The type identifier for the information being requested. Type InformationType EFI_GUID the related GUID definitions.
  • Page 220: Efi_File.setinfo()

    Extensible Firmware Interface Specification 10.2.9 EFI_FILE.SetInfo() Summary Sets information about a file. Prototype EFI_STATUS (EFIAPI *EFI_FILE_SET_INFO) ( IN EFI_FILE IN EFI_GUID IN UINTN OUT VOID Parameters A pointer to the This information is for. Type The type identifier for the information being set. Type InformationType defined in Chapter 3.
  • Page 221: Efi_File.flush()

    10.2.10 EFI_FILE.Flush() Summary Flushes all modified data associated with a file to a device. Prototype EFI_STATUS (EFIAPI *EFI_FILE_FLUSH) ( IN EFI_FILE Parameters A pointer to the This Type Description function flushes all modified data associated with a file to a device. Flush() Status Codes Returned EFI_SUCCESS...
  • Page 222: Efi_File_Info

    Extensible Firmware Interface Specification 10.2.11 EFI_FILE_INFO Summary Provides a GUID and a data structure that can be used with to set or get generic file information. EFI_FILE.GetInfo() GUID #define EFI_FILE_INFO_ID \ { 09576e92-6d3f-11d2-8e39-00a0c969723b } Related Definitions typedef struct { UINT64...
  • Page 223 The time when the file’s contents were last modified. ModificationTime The attribute bits for the file. See “Related Definitions”. Attribute The Null-terminated Unicode name of the file. FileName Description data structure supports EFI_FILE_INFO case of SetInfo()the following additional rules apply: •...
  • Page 224: Efi_File_System_Info

    Extensible Firmware Interface Specification 10.2.12 EFI_FILE_SYSTEM_INFO Summary Provides a GUID and a data structure that can be used with information about the system volume, and volume label. GUID #define EFI_FILE_SYSTEM_INFO_ID \ { 09576e93-6d3f-11d2-8e39-00a0c969723b } Related Definitions typedef struct { UINT64...
  • Page 225: Efi_File_System_Volume_Label

    10.2.13 EFI_FILE_SYSTEM_VOLUME_LABEL Summary Provides a GUID and a data structure that can be used with EFI_FILE.SetInfo()to get or set information about the system’s volume label. GUID #define EFI_FILE_SYSTEM_VOLUME_LABEL_ID \ { DB47D7D3-FE81-11d3-9A35-0090273FC14D } Related Definitions typedef struct { CHAR16 } EFI_FILE_SYSTEM_VOLUME_LABEL; Parameters The Null-terminated string that is the volume’s label.
  • Page 226 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 227: Load_File Protocol

    This chapter defines the Load File protocol. This protocol is designed to allow code running in the EFI boot services environment to find and load other modules of code. 11.1 LOAD_FILE Protocol Summary Is used to obtain files from arbitrary devices. GUID #define LOAD_FILE_PROTOCOL \ {56EC3091-954C-11d2-8E3F-00A0C969723B}...
  • Page 228: Load_File.loadfile()

    Extensible Firmware Interface Specification 11.1.1 LOAD_FILE.LoadFile() Summary Causes the driver to load a specified file. Prototype EFI_STATUS (EFIAPI *EFI_LOAD_FILE) ( IN EFI_LOAD_FILE_INTERFACE *This, IN EFI_DEVICE_PATH IN BOOLEAN IN OUT UINTN IN VOID Parameters Indicates a pointer to the calling context. Type...
  • Page 229 BootPolicy FALSE FilePath exists, is returned. If EFI_NOT_FOUND to perform a network boot through the PXE Base Code protocol, the firmware’s boot manager is attempting to load an EFI image that is a BootPolicy TRUE boot selection. In this case, FilePath Normally the firmware would implement the policy on how to handle an inexact boot file path;...
  • Page 230 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 231: Serial_Io Protocol

    This chapter defines the Serial I/O protocol. This protocol is used to abstract byte stream devices. 12.1 SERIAL_IO Protocol Summary This protocol is used to communicate with any type of character-based I/O device. GUID #define SERIAL_IO_PROTOCOL \ { BB25CF6F-F1D4-11D2-9A0C-0090273FC1FD } Revision Number #define SERIAL_IO_INTERFACE_REVISION Protocol Interface Structure...
  • Page 232 Extensible Firmware Interface Specification SetControl GetControl Write Read Mode Related Definitions //******************************************************* // SERIAL_IO_MODE //******************************************************* typedef struct { UINT32 // current Attributes UINT32 UINT64 UINT32 UINT32 UINT32 UINT32 } SERIAL_IO_MODE; The data values in the SERIAL_IO_MODE produces the SERIAL_IO_INTERFACE ControlMask...
  • Page 233 If applicable, this is the Parity checked as each character is transmitted or received. If the device does not support parity the value is the default parity value. If applicable, the StopBits character. If the device does not support stop bits the value is the default stop bit value.
  • Page 234 Extensible Firmware Interface Specification The default attributes for all UART-style serial device interfaces are: 115,200 baud, a 1 byte receive FIFO, a 1,000,000 microsecond timeout per character, no parity, 8 data bits, and 1 stop bit. Flow control is the responsibility of the software that uses the protocol. Hardware flow control can be implemented through the use of the (described below) to monitor and assert the flow control signals.
  • Page 235: Serial_Io.reset()

    12.1.1 SERIAL_IO.Reset() Summary Resets the serial device. Prototype EFI_STATUS (EFIAPI *EFI_SERIAL_RESET) ( IN SERIAL_IO_INTERFACE Parameters This Description function resets the hardware of a serial device. Reset() Status Codes Returned EFI_SUCCESS EFI_DEVICE_ERROR Version 1.02 *This A pointer to the SERIAL_IO_INTERFACE is defined in Section 12.1. SERIAL_IO_INTERFACE The serial device was reset.
  • Page 236: Serial_Io.setattributes()

    Extensible Firmware Interface Specification 12.1.2 SERIAL_IO.SetAttributes() Summary Sets the baud rate, receive FIFO depth, transmit/receive time out, parity, data bits, and stop bits on a serial device. EFI_STATUS (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) ( IN SERIAL_IO_INTERFACE IN UINT64 IN UINT32 IN UINT32 IN EFI_PARITY_TYPE...
  • Page 237 Description function sets the baud rate, receive-FIFO depth, transmit/receive time SetAttributes() out, parity, data bits, and stop bits on a serial device. The controller for a serial device is programmed with the specified attributes. If the Parity, DataBits, or values are not valid, then an error will be returned. If the specified StopBits is below the minimum baud rate supported by the serial device, an error will be BaudRate...
  • Page 238: Serial_Io.setcontrol()

    Extensible Firmware Interface Specification 12.1.3 SERIAL_IO.SetControl() Summary Sets the control bits on a serial device. Prototype EFI_STATUS (EFIAPI *EFI_SERIAL_SET_CONTROL) ( IN SERIAL_IO_INTERFACE IN UINT32 Parameters This Control Related Definitions //******************************************************* // CONTROL BITS //******************************************************* #define EFI_SERIAL_CLEAR_TO_SEND #define EFI_SERIAL_DATA_SET_READY #define EFI_SERIAL_RING_INDICATE...
  • Page 239 Only the REQUEST_TO_SEND, DATA_TERMINAL_READY, HARDWARE_LOOPBACK_ENABLE, SOFTWARE_LOOPBACK_ENABLE, and with SetControl(). All the bits can be read with GetControl(). Status Codes Returned EFI_SUCCESS The new control bits were set on the serial device. EFI_UNSUPPORTED The serial device does not support this operation. EFI_DEVICE_ERROR The serial device is not functioning correctly.
  • Page 240: Serial_Io.getcontrol()

    Extensible Firmware Interface Specification 12.1.4 SERIAL_IO.GetControl() Summary Retrieves the status of the control bits on a serial device. Prototype EFI_STATUS (EFIAPI *EFI_SERIAL_GET_CONTROL) ( IN SERIAL_IO_INTERFACE OUT UINT32 Parameters This Control Related Definitions //******************************************************* // CONTROL BITS //******************************************************* #define EFI_SERIAL_CLEAR_TO_SEND #define EFI_SERIAL_DATA_SET_READY...
  • Page 241: Serial_Io.write()

    12.1.5 SERIAL_IO.Write() Summary Writes data to a serial device. Prototype EFI_STATUS (EFIAPI *EFI_SERIAL_WRITE) ( IN SERIAL_IO_INTERFACE IN OUT UINTN IN VOID Parameters This BufferSize Buffer Description function writes the specified number of bytes to a serial device. If a time out error Write() occurs while data is being sent to the serial port, transmission of this buffer will terminate, and will be returned.
  • Page 242: Serial_Io.read()

    Extensible Firmware Interface Specification 12.1.6 SERIAL_IO.Read() Summary Reads data from a serial device. Prototype EFI_STATUS (EFIAPI *EFI_SERIAL_READ) ( IN SERIAL_IO_INTERFACE IN OUT UINTN OUT VOID Parameters This BufferSize Buffer Description function reads a specified number of bytes from a serial device. If a time out error or...
  • Page 243: Unicode_Collation Protocol

    This chapter defines the Unicode Collation protocol. This protocol is used to allow code running in the boot services environment to perform lexical comparison functions on Unicode strings for given languages. 13.1 UNICODE_COLLATION Protocol Summary Is used to perform case-insensitive comparisons of Unicode strings. GUID #define UNICODE_COLLATION_PROTOCOL \ { 1d85cd7f-f43d-11d2-9a0c-0090273fc14d }...
  • Page 244 Extensible Firmware Interface Specification StrUpr FatToStr StrToFat SupportedLanguages Description UNICODE_COLLATION strings. One or more of the UNICODE_COLLATION instance can support one or more language codes. The language codes that are supported in the interface is declared in SupportedLanguages. UNICODE_COLLATION SupportedLanguages terminated ASCII string.
  • Page 245: Unicode_Collation.stricoll()

    13.1.1 UNICODE_COLLATION.StriColl() Summary Performs a case-insensitive comparison of two Null-terminated Unicode strings. Prototype INTN (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) ( IN UNICODE_COLLATION_INTERFACE IN CHAR16 IN CHAR16 Parameters This Description function performs a case-insensitive comparison of two Null-terminated StriColl() Unicode strings. This function performs a case-insensitive comparison between the Unicode string Unicode string using the rules for the language codes that this protocol instance supports.
  • Page 246: Unicode_Collation.metaimatch()

    Extensible Firmware Interface Specification 13.1.2 UNICODE_COLLATION.MetaiMatch() Summary Performs a case-insensitive comparison of a Null-terminated Unicode pattern string and a Null- terminated Unicode string. Prototype BOOLEAN (EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) ( IN UNICODE_COLLATION_INTERFACE IN CHAR16 IN CHAR16 Parameters This String Pattern Description function performs a case-insensitive comparison of a Null-terminated MetaiMatch() Unicode pattern string and a Null-terminated Unicode string.
  • Page 247 Examples patterns (for English): *.FW [a-z] [!@#$%^&*()] D?.* Status Codes Returned TRUE Pattern was found in String. FALSE Pattern was not found in String. Version 1.02 Unicode Collation Protocol Matches all strings that end in “.FW” or “.fw” or “.Fw” or “.fW”. Match any letter in the alphabet.
  • Page 248: Unicode_Collation.strlwr()

    Extensible Firmware Interface Specification 13.1.3 UNICODE_COLLATION.StrLwr() Summary Converts all the Unicode characters in a Null-terminated Unicode string to lower case Unicode characters. Prototype VOID (EFIAPI *EFI_UNICODE_COLLATION_STRLWR) ( IN UNICODE_COLLATION_INTERFACE IN OUT CHAR16 Parameters This String Description This functions walks through all the Unicode characters in String, and converts each one to its lower case equivalent if it has one.
  • Page 249: Unicode_Collation.strupr()

    13.1.4 UNICODE_COLLATION.StrUpr() Summary Converts all the Unicode characters in a Null-terminated Unicode string to upper case Unicode characters. Prototype VOID (EFIAPI *EFI_UNICODE_COLLATION_STRUPR) ( IN UNICODE_COLLATION_INTERFACE IN OUT CHAR16 Parameters This String Description This functions walks through all the Unicode characters in String, and converts each one to its upper case equivalent if it has one.
  • Page 250: Unicode_Collation.fattostr()

    Extensible Firmware Interface Specification 13.1.5 UNICODE_COLLATION.FatToStr() Summary Converts an 8.3 FAT file name in an OEM character set to a Null-terminated Unicode string. Prototype VOID (EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) ( IN UNICODE_COLLATION_INTERFACE IN UINTN IN CHAR8 OUT CHAR16 Parameters This FatSize String...
  • Page 251: Unicode_Collation.strtofat()

    13.1.6 UNICODE_COLLATION.StrToFat() Summary Converts a Null-terminated Unicode string to legal characters in a FAT filename using an OEM character set. Prototype BOOLEAN (EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) ( IN UNICODE_COLLATION_INTERFACE IN CHAR16 IN UINTN OUT CHAR8 Parameters This String FatSize Description This function converts the first characters in an OEM character set and stores then in the string Fat.
  • Page 252 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 253: Efi_Pxe_Base_Code Protocol

    This chapter defines the Preboot Execution Environment (PXE) Base Code protocol, which is used to access PXE-compatible devices for network access and network booting. More information about PXE can be found in the Preboot Execution Environment (PXE) Specification at: ftp://download.intel.com/ial/wfm/pxespec.pdf. 14.1 EFI_PXE_BASE_CODE Protocol Summary EFI_PXE_BASE_CODE these devices are defined in the Preboot Execution Environment (PXE) Specification.
  • Page 254 Extensible Firmware Interface Specification Parameters Revision Start Stop Dhcp Discover Mtftp UdpWrite UdpRead SetIpFilter SetParameters SetStationIp SetPackets Mode The revision of the EFI_PXE_BASE_CODE future revisions must be backwards compatible. If a future version is not backwards compatible it is not the same GUID.
  • Page 255 Related Definitions //******************************************************* // Maximum ARP and Route Entries //******************************************************* #define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES #define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES //******************************************************* // EFI_PXE_BASE_CODE_MODE // The data values in this structure are read-only and // are updated by the code that produces the EFI_PXE_BASE_CODE // protocol functions. //******************************************************* typedef struct { BOOLEAN...
  • Page 256 Extensible Firmware Interface Specification EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES]; UINT32 EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES]; EFI_PXE_BASE_CODE_ICMP_ERROR EFI_PXE_BASE_CODE_TFTP_ERROR } EFI_PXE_BASE_CODE_MODE; Started Ipv6Available Ipv6Supported UsingIpv6 BisSupported BisDetected AutoArp SendGUID DhcpDiscoverValid DhcpAckReceived RouteTableEntries; IcmpError; TftpError; if this device has been started by calling Start(). This TRUE field is set to...
  • Page 257 This field is initialized to ProxyOfferReceived set to and a proxy DHCP offer packet was received. When ProxyOffer changed by the When TRUE, the PxeDiscover packet field is valid. This PxeDiscoverValid field is set to and can be set to SetPackets() When PxeReplyReceived...
  • Page 258 Extensible Firmware Interface Specification StationIp SubnetMask DhcpDiscover DhcpAck ProxyOffer PxeDiscover PxeReply PxeBisReply IpFilter ArpCacheEntries ArpCache The device’s current IP address. This field is initialized to a zero address by Start(). This field is set when the Dhcp()function completes successfully. This field can also be set by the function.
  • Page 259 The number of valid entries in the current route table. This field RouteTableEntries is reset to zero by the Array of route table entries. RouteTable ICMP error packet. This field is updated when an ICMP error is IcmpError received and is undefined until the first ICMP error is received. This field is zero-filled by the TFTP error packet.
  • Page 260 Extensible Firmware Interface Specification //******************************************************* // This section defines the data types for DHCP packets, ICMP // error packets, and TFTP error packets. // packed data structures. //******************************************************* //******************************************************* // NOTE: ALL THE MULTIBYTE FIELDS IN THESE STRUCTURES ARE // STORED IN NETWORK ORDER.
  • Page 261 //******************************************************* // EFI_PXE_BASE_CODE_ICMP_ERROR //******************************************************* typedef struct { UINT8 UINT8 UINT16 union { UINT32 UINT32 UINT32 struct { UINT16 UINT16 } Echo; } u; UINT8 } EFI_PXE_BASE_CODE_ICMP_ERROR; //******************************************************* // EFI_PXE_BASE_CODE_TFTP_ERROR //******************************************************* typedef struct { UINT8 CHAR8 } EFI_PXE_BASE_CODE_TFTP_ERROR; //******************************************************* // This section defines the data types for IP receive filter // settings.
  • Page 262 Extensible Firmware Interface Specification //******************************************************* // This section defines the data types for ARP cache entries, // and route table entries. //******************************************************* //******************************************************* // EFI_PXE_BASE_CODE_ARP_ENTRY //******************************************************* typedef struct { EFI_IP_ADDRESS EFI_MAC_ADDRESS } EFI_PXE_BASE_CODE_ARP_ENTRY; //******************************************************* // EFI_PXE_BASE_CODE_ROUTE_ENTRY //******************************************************* typedef struct {...
  • Page 263: Pxe Tag Definitions For Efi

    //******************************************************* // The following table defines values for the PXE DHCP and // Bootserver Discover packet tags that are specific to the EFI // environment. Complete definitions of all PXE tags are defined // in Table 2-1 PXE DHCP Options (Full List), in the PXE // Specification.
  • Page 264 Extensible Firmware Interface Specification Description The basic mechanisms and flow for remote booting in EFI are identical to the remote boot functionality described in detail in the PXE Specification. However, the actual execution environment, linkage, and calling conventions are replaced and enhanced for the EFI environment.
  • Page 265: Efi_Pxe_Base_Code.start()

    14.1.1 EFI_PXE_BASE_CODE.Start() Summary Enables the use of the PXE Base Code Protocol functions. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_START) ( IN EFI_PXE_BASE_CODE IN BOOLEAN Parameters Pointer to the This Specifies the type of IP addresses that are to be used during the session UseIpv6 that is being started.
  • Page 266 Extensible Firmware Interface Specification DhcpCompleted ProxyOfferReceived StationIp SubnetMask DhcpDiscover DhcpAck ProxyOffer PxeDiscoverValid PxeDiscover PxeReplyValid PxeReply PxeBisReplyValid PxeBisReply IpFilter ArpCacheEntries ArpCache RouteTableEntries RouteTable IcmpErrorReceived IcmpError TftpErroReceived TftpError MakeCallbacks Set to DEFAULT_ToS. Set to FALSE. Set to FALSE. Set to an address of all zeros.
  • Page 267 Status Codes Returned EFI_SUCCESS The PXE Base Code Protocol was started. EFI_INVALID_PARAMETER One of the parameters is not valid. EFI_UNSUPPORTED UseIpv6 EFI_BASE_CODE_MODE EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. EFI_DEVICE_ERROR The network device encountered an error during this operation. EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the PXE Base Code Protocol.
  • Page 268: Efi_Pxe_Base_Code.stop()

    Extensible Firmware Interface Specification 14.1.2 EFI_PXE_BASE_CODE.Stop() Summary Disables the use of the PXE Base Code Protocol functions. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_STOP) ( IN EFI_PXE_BASE_CODE Parameters Pointer to the This Description This function stops all activity on the network device. All the resources allocated in...
  • Page 269: Efi_Pxe_Base_Code.dhcp()

    14.1.3 EFI_PXE_BASE_CODE.Dhcp() Summary Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6 S.A.R.R (solicit / advertise / request / reply) sequence. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_DHCP) ( IN EFI_PXE_BASE_CODE IN BOOLEAN Parameters Pointer to the This SortOffers TRUE...
  • Page 270 Extensible Firmware Interface Specification Status Codes Returned EFI_SUCCESS EFI_NOT_STARTED EFI_INVALID_PARAMETER EFI_DEVICE_ERROR EFI_OUT_OF_RESOURCES EFI_ABORTED EFI_TIMEOUT EFI_ICMP_ERROR EFI_NO_RESPONSE Valid DHCP has completed. The PXE Base Code Protocol is in the stopped state. One of the parameters is not valid. The network device encountered an error during this operation.
  • Page 271: Efi_Pxe_Base_Code.discover()

    14.1.4 EFI_PXE_BASE_CODE.Discover() Summary Attempts to complete the PXE Boot Server and/or boot image discovery sequence. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) ( IN EFI_PXE_BASE_CODE IN UINT16 IN UINT16 IN BOOLEAN IN EFI_PXE_BASE_CODE_DISCOVER_INFO Parameters Pointer to the This The type of bootstrap to perform. See “Related Definitions”. Type Pointer to the boot server layer number to discover, which must be Layer...
  • Page 272 Extensible Firmware Interface Specification Related Definitions //******************************************************* // Bootstrap Types //******************************************************* #define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI #define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD #define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM #define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG #define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 #define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 #define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL #define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT...
  • Page 273 //******************************************************* // EFI_PXE_BASE_CODE_DISCOVER_INFO //******************************************************* typedef struct { BOOLEAN BOOLEAN BOOLEAN BOOLEAN EFI_IP_ADDRESS UINT16 EFI_PXE_BASE_CODE_SRVLIST } EFI_PXE_BASE_CODE_DISCOVER_INFO; //******************************************************* // EFI_PXE_BASE_CODE_SRVLIST //******************************************************* typedef struct { UINT16 BOOLEAN UINT8 EFI_IP_ADDRESS } EFI_PXE_BASE_CODE_SRVLIST; Version 1.02 PXE Base Code Protocol UseMCast; UseBCast; UseUCast; MustUseList; ServerMCastIp; IpCnt;...
  • Page 274 Extensible Firmware Interface Specification Description This function attempts to complete the PXE Boot Server and/or boot image discovery sequence. If this sequence is completed, then PxeDiscover, PxeReplyReceived, and EFI_PXE_BASE_CODE_MODE PxeBisReplyReceived and PxeBisReply structure will also be filled in. If FALSE.
  • Page 275: Efi_Pxe_Base_Code.mtftp()

    14.1.5 EFI_PXE_BASE_CODE.Mtftp() Summary Used to perform TFTP and MTFTP services. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_MTFTP) ( IN EFI_PXE_BASE_CODE IN EFI_PXE_BASE_CODE_TFTP_OPCODE IN OUT VOID IN BOOLEAN IN OUT UINTN IN UINTN IN EFI_IP_ADDRESS IN CHAR8 IN EFI_PXE_BASE_CODE_MTFTP_INFO IN BOOLEAN Parameters Pointer to the This The type of operation to perform.
  • Page 276 Extensible Firmware Interface Specification Pointer to the MTFTP information. This information is required to start Info or join a multicast TFTP session. It is also required to perform the “get file size” and “read directory” operations of MTFTP. See "Related Definitions"...
  • Page 277 File multicast IP address. This is the IP address to which the MCastIp server will send the requested file. Client multicast listening port. This is the UDP port to which the CPort server will send the requested file. Server multicast listening port. This is the UDP port on which SPort the server listens for multicast open requests and data acks.
  • Page 278 Extensible Firmware Interface Specification The format of the data returned from a TFTP read directory operation is a null-terminated filename followed by a null-terminated information string, of the form “size year-month-day hour:minute:second” (i.e. %d %d-%d-%d %d:%d:%f - note that the seconds field can be a decimal number), where the date and time are UTC.
  • Page 279: Efi_Pxe_Base_Code.udpwrite()

    14.1.6 EFI_PXE_BASE_CODE.UdpWrite() Summary Writes a UDP packet to the network interface. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) ( IN EFI_PXE_BASE_CODE IN UINT16 IN EFI_IP_ADDRESS IN EFI_PXE_BASE_CODE_UDP_PORT IN EFI_IP_ADDRESS IN EFI_IP_ADDRESS IN OUT EFI_PXE_BASE_CODE_UDP_PORT IN UINTN IN VOID IN UINTN IN VOID Parameters Pointer to the This The UDP operation flags.
  • Page 280 Extensible Firmware Interface Specification HeaderPtr HeaderSize the data at BufferPtr. A pointer to the size of the data at BufferPtr. BufferSize A pointer to the data to be written. BufferPtr Description This function writes a UDP packet specified by the (optional parameters to the network interface.
  • Page 281: Efi_Pxe_Base_Code.udpread()

    14.1.7 EFI_PXE_BASE_CODE.UdpRead() Summary Reads a UDP packet from the network interface. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) ( IN EFI_PXE_BASE_CODE IN UINT16 IN OUT EFI_IP_ADDRESS IN OUT EFI_PXE_BASE_CODE_UDP_PORT IN OUT EFI_IP_ADDRESS IN OUT EFI_PXE_BASE_CODE_UDP_PORT IN UINTN IN VOID IN OUT UINTN IN VOID Parameters Pointer to the This...
  • Page 282: Destination Ip Filter Operation

    Extensible Firmware Interface Specification Description This function reads a UDP packet from a network interface. The data contents are returned in (the optional and) BufferPtr, and the size of the buffer received is returned in HeaderPtr . If the input...
  • Page 283: Source Ip Filter Operation

    Table 14-4. Source IP Filter Operation OpFlags ANY_SRC_IP SrcIp Action Return NULL NULL Receive a packet sent from any IP address. Receive a packet whose source IP address matches not NULL not NULL Receive a packet sent from any IP address, and return the source IP address in Table 14-5.
  • Page 284: Efi_Pxe_Base_Code.setipfilter()

    Extensible Firmware Interface Specification 14.1.8 EFI_PXE_BASE_CODE.SetIpFilter() Summary Updates the IP receive filters of a network device and enables software filtering. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) ( IN EFI_PXE_BASE_CODE IN EFI_PXE_BASE_CODE_IP_FILTER Parameters Pointer to the This Pointer to the new set of IP receive filters.
  • Page 285: Efi_Pxe_Base_Code.arp()

    14.1.9 EFI_PXE_BASE_CODE.Arp() Summary Uses the ARP protocol to resolve a MAC address. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_ARP) ( IN EFI_PXE_BASE_CODE IN EFI_IP_ADDRESS IN EFI_MAC_ADDRESS Parameters Pointer to the This Pointer to the IP address that is used to resolve a MAC address. When IpAddr the MAC address is resolved, the fields of the...
  • Page 286: Efi_Pxe_Base_Code.setparameters()

    Extensible Firmware Interface Specification 14.1.10 EFI_PXE_BASE_CODE.SetParameters() Summary Updates the parameters that affect the operation of the PXE Base Code Protocol. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) ( IN EFI_PXE_BASE_CODE IN BOOLEAN IN BOOLEAN IN UINT8 IN UINT8 IN BOOLEAN Parameters Pointer to the...
  • Page 287 Description This function sets parameters that affect the operation of the PXE Base Code Protocol. The parameter specified by NewAutoArp is TRUE, then ARP Protocol packets will be generated as required by the PXE Base NewAutoArp Code Protocol. If is FALSE, then no ARP Protocol packets will be generated. In NewAutoArp this case, the only mappings that are available are those stored in the structure.
  • Page 288: Efi_Pxe_Base_Code.setstationip()

    Extensible Firmware Interface Specification 14.1.11 EFI_PXE_BASE_CODE.SetStationIp() Summary Updates the station IP address and/or subnet mask values of a network device. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) ( IN EFI_PXE_BASE_CODE IN EFI_IP_ADDRESS IN EFI_IP_ADDRESS Parameters Pointer to the This Pointer to the new IP address to be used by the network device. If this...
  • Page 289: Efi_Pxe_Base_Code.setpackets()

    14.1.12 EFI_PXE_BASE_CODE.SetPackets() Summary Updates the contents of the cached DHCP and Discover packets. Prototype EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) ( IN EFI_PXE_BASE_CODE IN BOOLEAN IN BOOLEAN IN BOOLEAN IN BOOLEAN IN BOOLEAN IN BOOLEAN IN EFI_PXE_BASE_CODE_PACKET IN EFI_PXE_BASE_CODE_PACKET IN EFI_PXE_BASE_CODE_PACKET IN EFI_PXE_BASE_CODE_PACKET IN EFI_PXE_BASE_CODE_PACKET IN EFI_PXE_BASE_CODE_PACKET Parameters...
  • Page 290 Extensible Firmware Interface Specification NewPxeBisReplyReceived NewDhcpDiscover NewDhcpAck NewProxyOffer NewPxeDiscover NewPxeReply NewPxeBisReply Description The pointers to the new packets are used to update the contents of the cached packets in the EFI_PXE_BASE_CODE_MODE Status Codes Returned EFI_SUCCESS EFI_INVALID_PARAMETER EFI_NOT_STARTED If not NULL, a pointer to a value that specifies whether to...
  • Page 291: Efi_Pxe_Base_Code_Callback Protocol

    14.2 EFI_PXE_BASE_CODE_CALLBACK Protocol Summary This is a specific instance of the PXE Base Code Callback Protocol that is invoked when the PXE Base Code Protocol is about to transmit, has received, or is waiting to receive a packet. The PXE Base Code Callback Protocol must be on the same handle as the PXE Base Code Protocol.
  • Page 292: Efi_Pxe_Base_Code_Callback.callback()

    Extensible Firmware Interface Specification 14.2.1 EFI_PXE_BASE_CODE_CALLBACK.Callback() Summary Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has received, or is waiting to receive a packet. Prototype EFI_PXE_BASE_CODE_CALLBACK_STATUS (*EFI_PXE_CALLBACK) ( IN EFI_PXE_BASE_CODE_CALLBACK IN EFI_PXE_BASE_CODE_FUNCTION IN BOOLEAN...
  • Page 293 Related Definitions //******************************************************* // EFI_PXE_BASE_CODE_CALLBACK_STATUS //******************************************************* typedef enum { EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST, EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT, EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST } EFI_PXE_BASE_CODE_CALLBACK_STATUS; //******************************************************* // EFI_PXE_BASE_CODE_FUNCTION //******************************************************* typedef enum { EFI_PXE_BASE_CODE_FUNCTION_FIRST, EFI_PXE_BASE_CODE_FUNCTION_DHCP, EFI_PXE_BASE_CODE_FUNCTION_DISCOVER, EFI_PXE_BASE_CODE_FUNCTION_MTFTP, EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE, EFI_PXE_BASE_CODE_FUNCTION_UDP_READ, EFI_PXE_BASE_CODE_FUNCTION_ARP, EFI_PXE_BASE_CODE_FUNCTION_IGMP, EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST } EFI_PXE_BASE_CODE_FUNCTION; Description This function is invoked when the PXE Base Code Protocol is about to transmit, has received, or is waiting to receive a packet.
  • Page 294 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 295: Efi_Simple_Network Protocol

    This chapter defines the Simple Network Protocol. This protocol provides a packet level interface to a network adapter. 15.1 EFI_SIMPLE_NETWORK Protocol Summary EFI_SIMPLE_NETWORK packets, receive packets, and close a network interface. GUID #define EFI_SIMPLE_NETWORK_PROTOCOL \ { A19832B9-AC25-11D3-9A2D-0090273fc14d } Revision Number #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION Protocol Interface Structure typedef struct _EFI_SIMPLE_NETWORK_ {...
  • Page 296 Extensible Firmware Interface Specification Parameters Revision of the Revision must be backwards compatible. If a future version is not backwards compatible it is not the same GUID. Prepares the network interface for further command operations. No Start other this call is made.
  • Page 297 Related Definitions //******************************************************* // EFI_SIMPLE_NETWORK_MODE // Note that the fields in this data structure are read-only and // are updated by the code that produces the EFI_SIMPLE_NETWORK // protocol functions. // during driver initialization. //******************************************************* typedef struct { UINT32 UINT32 UINT32 UINT32 UINT32...
  • Page 298 Extensible Firmware Interface Specification State HwAddressSize MediaHeaderSize MaxPacketSize NvRamSize NvRamAccessSize ReceiveFilterMask ReceiveFilterSetting MaxMCastFilterCount MCastFilterCount MCastFilter CurrentAddress BroadcastAddress PermanentAddress IfType MacAddressChangeable MultipleTxSupported Reports the current state of the network interface (see EFI_SIMPLE_NETWORK_STATE driver has initialized a network EFI_SIMPLE_NETWORK interface, it is left in the EfiSimpleNetworkStopped The size, in bytes, of the network interface’s HW address.
  • Page 299 MediaPresentSupported TRUE FALSE. If FALSE, MediaPresent TRUE FALSE. This field is only valid immediately after calling Initialize(). //******************************************************* // EFI_SIMPLE_NETWORK_STATE //******************************************************* typedef enum { EfiSimpleNetworkStopped, EfiSimpleNetworkStarted, EfiSimpleNetworkInitialized, EfiSimpleNetworkMaxState } EFI_SIMPLE_NETWORK_STATE; //******************************************************* // MAX_MCAST_FILTER_CNT //******************************************************* #define MAX_MCAST_FILTER_CNT //******************************************************* // Bit Mask Values for ReceiveFilterSetting. // Note that all other bit values are reserved.
  • Page 300: Efi_Simple_Network.start()

    Extensible Firmware Interface Specification 15.1.1 EFI_SIMPLE_NETWO RK.Start() Summary Changes the state of a network interface from “stopped” “started”. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_START) ( IN EFI_SIMPLE_NETWORK Parameters This Description This function starts a network interface. If the network interface was successfully started, then will be returned.
  • Page 301: Efi_Simple_Network.stop()

    15.1.2 EFI_SIMPLE_NETWO RK.Stop() Summary Changes the state of a network interface from “started” to “stopped”. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STOP) ( IN EFI_SIMPLE_NETWORK Parameters This Description This function stops an network interface. This call is only valid if the network interface is in the started state.
  • Page 302: Efi_Simple_Network.initialize()

    Extensible Firmware Interface Specification 15.1.3 EFI_SIMPLE_NETWO RK.Initialize() Summary Resets a network adapter and allocates the transmit and receive buffers required by the network interface; optionally, also requests allocation of additional transmit and receive buffers. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) ( IN EFI_SIMPLE_NETWORK...
  • Page 303: Efi_Simple_Network.reset()

    15.1.4 EFI_SIMPLE_NETW ORK.Reset() Summary Resets a network adapter and re-initializes it with the parameters that were provided in the previous call to Initialize(). Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RESET) ( IN EFI_SIMPLE_NETWORK IN BOOLEAN Parameters This ExtendedVerification Description This function resets a network adapter and re-initializes it with the parameters that were provided in the previous call to Initialize().
  • Page 304: Efi_Simple_Network.shutdown()

    Extensible Firmware Interface Specification 15.1.5 EFI_SIMPLE_NETWO RK.Shutdown() Summary Resets a network adapter and leaves it in a state that is safe for another driver to initialize. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) ( IN EFI_SIMPLE_NETWORK Parameters This Description This function releases the memory buffers assigned in the transmits and receives are lost, and interrupts are cleared and disabled.
  • Page 305: Efi_Simple_Network.receivefilters()

    15.1.6 EFI_SIMPLE_NETWO RK.ReceiveFilters() Summary Manages the multicast receive filters of a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) ( IN EFI_SIMPLE_NETWORK IN UINT32 IN UINT32 IN BOOLEAN IN UINTN IN EFI_MAC_ADDRESS Parameters This Enable Disable ResetMCastFilter MCastFilterCnt MCastFilter Description This function modifies the current receive filter mask on a network interface. The bits set in are set on the current receive filter mask.
  • Page 306 Extensible Firmware Interface Specification is TRUE, then the multicast receive filter list on the network interface ResetMCastFilter will be reset to the default multicast receive filter list. If this network interface allows the multicast receive filter list to be modified, then the...
  • Page 307: Efi_Simple_Network.stationaddress()

    15.1.7 EFI_SIMPLE_NETWO RK.StationAddress() Summary Modifies or resets the current station address, if supported. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) ( IN EFI_SIMPLE_NETWORK IN BOOLEAN IN EFI_MAC_ADDRESS Parameters This Reset Description This function modifies or resets the current station address of a network interface, if supported. If is TRUE, then the current station address is set to the network interface's permanent Reset address.
  • Page 308: Efi_Simple_Network.statistics()

    Extensible Firmware Interface Specification 15.1.8 EFI_SIMPLE_NETWO RK.Statistics() Summary Resets or collects the statistics on a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) ( IN EFI_SIMPLE_NETWORK IN BOOLEAN IN OUT UINTN OUT EFI_NETWORK_STATISTICS *StatisticsTable Parameters This Reset StatisticsSize StatisticsTable Related Definitions //******************************************************* // EFI_NETWORK_STATISTICS // Any statistic value that is –1 is not available...
  • Page 309 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 UINT64 } EFI_NETWORK_STATISTICS; Total number of frames received. Includes frames with errors RxTotalFrames and dropped frames. Number of valid frames received and copied into receive buffers. RxGoodFrames Number of frames below the minimum length for the media.
  • Page 310 Extensible Firmware Interface Specification TxOversizeFrames TxDroppedFrames TxUnicastFrames TxBroadcastFrames TxMulticastFrames TxCrcErrorFrames TxTotalBytes Collisions UnsupportedProtocol Description This function resets or collects the statistics on a network interface. If the size of the statistics table specified by StatisticsSize network interface, then a partial buffer of statistics is returned in StatisticsTable,...
  • Page 311: Efi_Simple_Network.mcastiptomac()

    15.1.9 EFI_SIMPLE_NETWO RK.MCastIPtoMAC() Summary Converts a multicast IP address to a multicast HW MAC address. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) ( IN EFI_SIMPLE_NETWORK IN BOOLEAN IN EFI_IP_ADDRESS OUT EFI_MAC_ADDRESS Parameters This IPv6 Description This function converts a multicast IP address to a multicast HW MAC address for all packet transactions.
  • Page 312: Efi_Simple_Network.nvdata()

    Extensible Firmware Interface Specification 15.1.10 EFI_SIMPLE_NETWO RK.NvData() Summary Performs read and write operations on the NVRAM device attached to a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) ( IN EFI_SIMPLE_NETWORK IN BOOLEAN IN UINTN IN UINTN IN OUT VOID Parameters This...
  • Page 313 Status Codes Returned EFI_SUCCESS The NVRAM access was performed. EFI_NOT_STARTED The network interface has not been started. EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. EFI_DEVICE_ERROR The command could not be sent to the network interface. EFI_UNSUPPORTED This function is not supported by the network interface.
  • Page 314: Efi_Simple_Network.getstatus()

    Extensible Firmware Interface Specification 15.1.11 EFI_SIMPLE_NETWO RK.GetStatus() Summary Reads the current interrupt status and recycled transmit buffer status from a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) ( IN EFI_SIMPLE_NETWORK OUT UINT32 OUT VOID Parameters This InterruptStatus TxBuf Related Definitions //******************************************************* // Interrupt Bit Mask Settings for InterruptStatus.
  • Page 315 Description This function gets the current interrupt and recycled transmit buffer status from the network interface. The interrupt status is returned as a bit mask in InterruptStatus. If is NULL, the interrupt status will not be read. If InterruptStatus recycled transmit buffer address will be retrieved. If a recycled transmit buffer address is returned in TxBuf, then the buffer has been successfully transmitted, and the status for that buffer is cleared.
  • Page 316: Efi_Simple_Network.transmit()

    Extensible Firmware Interface Specification 15.1.12 EFI_SIMPLE_NETWO RK.Transmit() Summary Places a packet in the transmit queue of a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) ( IN EFI_SIMPLE_NETWORK IN UINTN IN UINTN IN VOID IN EFI_MAC_ADDRESS IN EFI_MAC_ADDRESS IN UINT16 Parameters This...
  • Page 317 Description This function places the packet specified by is non-zero and HeaderSize HeaderSize >MediaHeaderSize, then EFI_INVALID_PARAMETER less than This->Mode->MediaHeaderSize, then returned. If is NULL, then Buffer is non-zero and HeaderSize DestAddr will be returned. If the transmit engine of the network interface is EFI_INVALID_PARAMETER busy, then will be returned.
  • Page 318: Efi_Simple_Network.receive()

    Extensible Firmware Interface Specification 15.1.13 EFI_SIMPLE_NETWO RK.Receive() Summary Receives a packet from a network interface. Prototype EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) ( IN EFI_SIMPLE_NETWORK OUT UINTN IN OUT UINTN OUT VOID OUT EFI_MAC_ADDRESS OUT EFI_MAC_ADDRESS OUT UINT16 Parameters This HeaderSize BufferSize Buffer...
  • Page 319 Description This function retrieves one packet from the receive queue of a network interface. If there are no packets on the receive queue, then EFI_NOT_READY receive queue, and the size of the packet is smaller than BufferSize, then the contents of the packet will be placed in Buffer, and packet.
  • Page 320: Network_Interface_Identifier Protocol

    Extensible Firmware Interface Specification 15.2 NETWORK_INTERFACE_IDENTIFIER Protocol Summary This is an optional protocol that is used to describe details about the software layer that is used to produce the Simple Network Protocol. This protocol is only required if the underlying network interface is 16-bit UNDI, 32/64-bit S/W UNDI, or H/W UNDI.
  • Page 321 16-bit UNDI and 32/64-bit S/W UNDI: contains the address of the first byte of the copy of the structure in the relocated UNDI code segment. See the Preboot Execution Environment (PXE) Specification and Appendix G. H/W UNDI: contains the address of the Address of the un-relocated network interface image.
  • Page 322 Extensible Firmware Interface Specification Major version number. MajorVer 16-bit UNDI: MajorVer UNDI ROM ID (PXE) Specification. 32/64-bit S/W UNDI and H/W UNDI: MajorVer Appendix G. Minor version number. MinorVer 16-bit UNDI: MinorVer UNDI ROM ID (PXE) Specification. 32/64-bit S/W UNDI and H/W UNDI: MinorVer Appendix G.
  • Page 323: System Partition

    The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI.
  • Page 324: File System Format

    (not used in FAT-32). The first block (sector) also contains code that will be executed as part of the boot process on a legacy Intel architecture system. This code in the first block (sector) usually contains code that can read a file from the root directory into memory and transfer control to it.
  • Page 325 This directory contains EFI images that aide in recovery if the boot selections for the software installed on the EFI system partition are ever lost. Any additional EFI executables must be in sub directories below the vendor sub directory. The following is a sample directory structure for an EFI system partition present on a hard disk.
  • Page 326: Partition Discovery

    Extensible Firmware Interface Specification 16.2 Partition Discovery EFI requires the firmware to be able to parse legacy master boot records, the new GUID Partition Table (GPT), and El Torito logical device volumes. The EFI firmware produces a logical device for each EFI Partition Entry, El Torito logical device volume, and if no EFI BLOCK_IO Partition Table is present any partitions found in the partition tables.
  • Page 327: Efi Partition Header

    EFI supports the nesting of legacy MBR partitions, by allowing any legacy MBR partition to contain more legacy MBR partitions. This is accomplished by supporting the same partition discovery algorithm on every logical block device. It should be noted that the GUID Partition Table does not allow nesting of GUID Partition Table Headers.
  • Page 328: Guid Partition Table (Gpt) Scheme

    Extensible Firmware Interface Specification Partition Entry array is the PartitionEntrySize multiplied by NumberOfPartitionEntries. When a GUID Partition Entry is updated the PartitionEntryArrayCRC must be updated. When the PartitionEntryArrayCRC is updated the GUID Partition Table Header CRC must also be updated, since the PartitionEntryArrayCRC is stored in the GUID Partition Table Header.
  • Page 329: Guid Partition Table Header

    Table 16-1. GUID Partition Table Header Byte Mnemonic Offset Signature Revision HeaderSize HeaderCRC32 Reserved MyLBA AlternateLBA FirstUsableLBA LastUsableLBA DiskGUID PartitionEntryLBA NumberOfPartitionEntries SizeOfPartitionEntry PartitionEntryArrayCRC32 Reserved The following test must be performed to determine if a GUID Partition Table is valid: • Check the GUID Partition Table Signature •...
  • Page 330: Guid Partition Entry

    Extensible Firmware Interface Specification If the GUID Partition Table is the primary table, stored at LBA 1: • Check the AlternateLBA to see if it is a valid GUID Partition Table If the primary GUID Partition Table is corrupt: •...
  • Page 331: Defined Guid Partition Entry - Partition Type Guids

    The SizeOfPartitionEntry variable in the GUID Partition Table Header defines the size of a GUID Partition Entry. The GUID Partition Entry starts in the first byte of the GUID Partition Entry and any unused space at the end of the defined partition entry is reserved space and must be set to zero. Each partition record contains a Unique Partition GUID variable that uniquely identifies every partition that will ever be created.
  • Page 332: Iso-9660 And El Torito

    Since the EFI file system definition does not use the same Initial/Default entry as a legacy CD ROM it is possible to boot Intel architecture personal computers using an EFI CD-ROM or DVD-ROM. The inclusion of boot code for Intel architecture personal computers is optional and not required by EFI.
  • Page 333: Legacy Master Boot Record

    Version 1.02 Byte Length Description Code used on legacy Intel architecture system to select a partition record and load the first block (sector) of the partition pointed to by the partition record. This code is not executed on EFI systems.
  • Page 334: Legacy Master Boot Record And Gpt Partitions

    Extensible Firmware Interface Specification Table 16-6. Legacy Master Boot Record Partition Record (continued) Byte Mnemonic Offset End Track Starting LBA Size In LBA EFI defines a valid legacy MBR as follows. The signature at the end of the MBR must be 0xaa55.
  • Page 335: Media Formats

    EFI code does not assume a fixed block size. Since EFI firmware does not execute the MBR code and does not depend on the bootable flag field in the partition entry the hard disk can still boot and function normally on an Intel architecture- based personal computer.
  • Page 336: Cd-Rom And Dvd-Rom

    Since the EFI file system definition does not use the same Initial/Default entry as a legacy CD-ROM, it is possible to boot Intel architecture personal computers using an EFI CD-ROM or DVD-ROM. The inclusion of boot code for Intel architecture personal computers is optional and not required by EFI.
  • Page 337: Firmware Boot Manager

    The EFI boot manager is a firmware policy engine that can be configured by modifying architecturally defined global NVRAM variables. The boot manager will attempt to load EFI drivers and EFI applications (including EFI OS boot loaders) in an order defined by the global NVRAM variables.
  • Page 338 Extensible Firmware Interface Specification Programmatic interaction with the boot manager is accomplished through globally defined variables. On initialization the boot manager reads the values which comprise all of the published load options among the EFI environment variables. By using the data that contain these environment variables can be modified.
  • Page 339 and fixed media types. This search occurs when the device path of the boot image listed in any boot option points directly to a SIMPLE_FILE_SYSTEM load. The file discovery method is explained in “Boot Option Variables Default Behavior” starting on page 325. The default media boot case of a protocol other than handled by the LOAD_FILE_PROTOCOL handled by the boot manager.
  • Page 340 Extensible Firmware Interface Specification A packed array of EFI device paths. The first element of the array is an FilePathList EFI device path that describes the device and location of the Image for this load option. The type. Other device paths may optionally exist in the FilePathList, but their usage is OSV specific.
  • Page 341: Globally-Defined Variables

    17.2 Globally-Defined Variables This section defines a set of variables that have architecturally defined meanings. In addition to the defined data content, each such variable has an architecturally defined attribute that indicates when the data variable may be accessed. The variables with an attribute of NV are non-volatile. This means that their values are persistent across resets and power cycles.
  • Page 342 Extensible Firmware Interface Specification variable contains an array of 3-character (8-bit ASCII characters) LangCodes ISO-639-2 language codes that the firmware can support. At initialization time the firmware computes the supported languages and creates this data variable. Since the firmware creates this value on each initialization, its contents are not stored in non-volatile memory.
  • Page 343: Boot Option Variables Default Behavior

    list is used by the firmware’s boot manager as the default load order for EFI DriverOrder drivers that it should explicitly load. 17.3 Boot Option Variables Default Behavior The default state of globally-defined variables is firmware vendor specific. However the boot options require a standard default behavior in the exceptional case that valid boot options are not present on a platform.
  • Page 344: Boot Via Load_File Protocol

    Extensible Firmware Interface Specification removable media device will point to a device that “speaks” the protocol. The will not contain a file name or sub directories. FilePath The system firmware will attempt to boot from a removable media file name in the form \EFI\BOOT\BOOT{machine type short-name}.EFI. Where machine type short-name defines a PE32+ image format architecture.
  • Page 345: Standard Pci Expansion Rom Header

    Local Bus Specification, Revision 2.2). The code type field is used to identify the type of code contained in this section of the ROM. The following code types are assigned by the PCI Local Bus Specification, Revision 2.2: • ® 0x00 – Intel IA-32, PC-AT compatible • 0x01 – Open Firmware standard for PCI •...
  • Page 346: Efi Pci Expansion Rom Header

    Extensible Firmware Interface Specification EFI will coordinate with a future revision of the PCI specification to allocate the code type of 0x03 to represent EFI images. This code type will signify that EFI extensions are present in the standard PCI expansion ROM header.
  • Page 347: Multiple Image Format Support

    The IA-32 and Itanium-based image type represent 32-bit and 64-bit native Intel architecture processor code that has knowledge about EFI interfaces. The intermediate byte stream type is a place holder for a new format that will be defined in a subsequent version of the EFI specification.
  • Page 348 Extensible Firmware Interface Specification 12/01/00 Version 1.01...
  • Page 349: A-1. Efi Guid Format

    All EFI GUIDs (Globally Unique Identifiers) have the format described in Appendix J of the Wired for Management Baseline Specification. This document references the format of the GUID, but implementers must reference the Wired for Management specifications for algorithms to generate GUIDs.
  • Page 350 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 351: B.1 Simple_Input

    The EFI console was designed so that it could map to common console devices. This appendix explains how an EFI console could map to a VGA with PC AT 101/102, PCANSI, or ANSI X3.64 consoles. B.1 SIMPLE_INPUT Table B-1 gives examples of how an EFI scan code can be mapped to ANSI X3.64 terminal, PCANSI terminal, or an AT 101/102 keyboard.
  • Page 352: B.2 Simple_Text_Output

    Extensible Firmware Interface Specification Table B-1. EFI Scan Codes for SIMPLE_INPUT (continued) EFI Scan Code Description 0x0e Function 4 0x0f Function 5 0x10 Function 6 0x11 Function 7 0x12 Function 8 0x13 Function 9 0x14 Function 10 0x17 Escape B.2 SIMPLE_TEXT_OUTPUT Table B-2 defines how the programmatic methods of the be implemented as PCANSI or ANSI X3.64 terminals.
  • Page 353 Table B-2. Control Sequences that Can Be Used to Implement SIMPLE_TEXT_OUTPUT (continued) PCANSI ANSI X3.64 Codes Codes Description ESC [ 41 m CSI 41 m Red background, compliant with ISO Standard 6429. ESC [ 42 m CSI 42 m Green background, compliant with ISO Standard 6429. ESC [ 43 m CSI 43 m Yellow background, compliant with ISO Standard 6429.
  • Page 354 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 355: Example Computer System

    This appendix presents an example EFI Device Path and explains its relationship to the ACPI name space. An example system design is presented along with its corresponding ACPI name space. These physical examples are mapped back to EFI Device Paths. C.1 Example Computer System Figure C-1 represents a hypothetical computer system architecture that will be used to discuss the construction of EFI Device Paths.
  • Page 356: C.2 Legacy Floppy

    Extensible Firmware Interface Specification The remainder of this appendix describes how to construct a device path for three example devices from the system in Figure C-1. The following is a list of the examples used: • Legacy floppy • IDE Disk •...
  • Page 357: C.3 Ide Disk

    Table C-1. Legacy Floppy Device Path Byte Byte Offset Length Data 0x02 0x01 0x0C 0x41D0, 0x0A03 0x0000 0x01 0x01 0x06 0x00 0x10 0x02 0x01 0x0C 0x41D0, 0x0303 0x0000 0xFF 0xFF 0x04 C.3 IDE Disk The IDE Disk controller is a PCI device that is contained in a function of the root PCI host bridge. The root PCI host bridge is a multi function device and has a separate function for chipset registers, USB, and IDE.
  • Page 358: C-2. Ide Disk Device Path

    Extensible Firmware Interface Specification The EFI Device Path for the PCI IDE controller would contain entries for the following things: • Root PCI Bridge. ACPI Device Path _HID PNP0A03, _UID 0. ACPI name space \_SB\PCI0 • PCI IDE controller. PCI Device Path with device and function of the IDE controller. ACPI name space \_SB\PCI0\IDE0 •...
  • Page 359: C.4 Secondary Root Pci Bus With Pci To Pci Bridge

    C.4 Secondary Root PCI Bus with PCI to PCI Bridge The secondary PCI host bridge materializes a second set of PCI buses into the system. The PCI buses on the secondary PCI host bridge are totally independent of the PCI buses on the root PCI host bridge.
  • Page 360: C.5 Acpi Terms

    Extensible Firmware Interface Specification C.5 ACPI Terms Names in the ACPI name space that start with an underscore (“_”) are reserved by the ACPI specification and have architectural meaning. All ACPI names in the name space are four characters in length. The following four ACPI names are used in this specification.
  • Page 361: Efi Device Path Displayed As A Name Space

    C.6 EFI Device Path as a Name Space Figure C-3 shows the EFI Device Path for the example system represented as a name space. The Device Path can be represented as a name space, but EFI does support manipulating the Device Path as a name space.
  • Page 362 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 363: D-1. Efi_Status Codes Ranges

    EFI interfaces return an EFI_STATUS success, errors, and warnings, respectively. Error codes also have their highest bit set, so all error codes have negative values. The range of status codes that have the highest bit set and the next to highest bit clear are reserved for use by EFI.
  • Page 364: D-4. Efi_Status Warning Codes (High Bit Clear)

    Extensible Firmware Interface Specification Table D-3. EFI_STATUS Error Codes (High bit set) (continued) Mnemonic EFI_NOT_READY EFI_DEVICE_ERROR EFI_WRITE_PROTECTED EFI_OUT_OF_RESOURCES EFI_VOLUME_CORRUPTED EFI_VOLUME_FULL EFI_NO_MEDIA EFI_MEDIA_CHANGED EFI_NOT_FOUND EFI_ACCESS_DENIED EFI_NO_RESPONSE EFI_NO_MAPPING EFI_TIMEOUT EFI_NOT_STARTED EFI_ALREADY_STARTED EFI_ABORTED EFI_ICMP_ERROR EFI_TFTP_ERROR EFI_PROTOCOL_ERROR Table D-4. EFI_STATUS Warning Codes (High bit clear)
  • Page 365: E-1. Functions Listed In Alphabetic Order

    This appendix contains two tables that list all EFI functions alphabetically. Table E-1 lists the functions in pure alphabetic order. Functions that have the same name can be distinguished by the associated service or protocol (column 2). For example, there are two “Flush” functions, one from the Device I/O Protocol and one from the File System Protocol.
  • Page 366 Extensible Firmware Interface Specification Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service EFI_PXE_BASE_CODE_CAL PXE Base Code LBACK Protocol EFI_IMAGE_ENTRY_POINT Boot Services EnableCursor Simple Text Output Protocol Exit Boot Services ExitBootServices Boot Services FatToStr Unicode Collation...
  • Page 367 Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service GetTime Runtime Services GetVariable Runtime Services GetWakeupTime Runtime Services HandleProtocol Boot Services Initialize Simple Network Protocol InstallConfigurationTable Boot Services InstallProtocolInterface Boot Services Io.Read Device I/O Protocol Io.Write Device I/O Protocol LoadFile...
  • Page 368 Extensible Firmware Interface Specification Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service MetaiMatch Unicode Collation Protocol Mtftp PXE Base Code Protocol NVData Simple Network Protocol Open File System Protocol OpenVolume Simple File System Protocol...
  • Page 369 Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service ReinstallProtocolInterface Boot Services Reset Block I/O Protocol Reset Serial I/O Protocol Reset Simple Input Protocol Reset Simple Network Protocol Reset Simple Text Output Protocol ResetSystem Runtime Services RestoreTPL Boot Services SetAttribute...
  • Page 370 Extensible Firmware Interface Specification Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service SetTime Runtime Services SetTimer Boot Services SetVariable Runtime Services SetVirtualAddressMap Runtime Services SetWakeupTime Runtime Services SetWatchdogTimer Boot Services Shutdown Simple Network Protocol...
  • Page 371 Table E-1. Functions Listed in Alphabetic Order (continued) Function Name Service or Protocol Sub-Service StrLwr Unicode Collation Protocol StrToFat Unicode Collation Protocol StrUpr Unicode Collation Protocol TestString Simple Text Output Protocol Transmit Simple Network Protocol UdpRead PXE Base Code Protocol UdpWrite PXE Base Code Protocol...
  • Page 372: E-2. Functions Listed Alphabetically Within Service Or Protocol

    Extensible Firmware Interface Specification Table E-2. Functions Listed Alphabetically Within Service or Protocol Service or Protocol Function Block I/O Protocol FlushBlocks ReadBlocks Reset WriteBlocks Boot Services AllocatePages AllocatePool CheckEvent CloseEvent CreateEvent EFI_IMAGE_ ENTRY_POINT Exit ExitBootServices FreePages FreePool GetMemoryMap GetNextMonotonicCount Returns a monotonically increasing count for the...
  • Page 373 Table E-2. Functions Listed Alphabetically Within Service or Protocol (continued) Service or Protocol Function Boot Services (cont.) Stall StartImage UninstallProtocolInterface Removes a protocol interface from a device handle. UnloadImage WaitForEvent Device I/O Protocol AllocateBuffer Flush FreeBuffer Io.Read Io.Write Mem.Read Mem.Write Pci.Read Pci.Write PciDevicePath...
  • Page 374 Extensible Firmware Interface Specification Table E-2. Functions Listed Alphabetically Within Service or Protocol (continued) Service or Protocol Function PXE Base Code Protocol Dhcp Discover EFI_PXE_BASE_CODE _CALLBACK Mtftp SetIpFilter SetPackets SetParameters SetStationIp Start Stop UdpRead UdpWrite Runtime Services ConvertPointer GetNextHigh MonotonicCount...
  • Page 375 Table E-2. Functions Listed Alphabetically Within Service or Protocol (continued) Service or Protocol Function Serial I/O Protocol GetControl Read Reset SetAttributes SetControl Write Simple File System OpenVolume Protocol Simple Input Protocol ReadKeyStroke Reset Simple Network GetStatus Protocol Initialize MCastIPtoMAC NVData Receive Reset Shutdown...
  • Page 376 Extensible Firmware Interface Specification Table E-2. Functions Listed Alphabetically Within Service or Protocol (continued) Service or Protocol Function Simple Text Output ClearScreen Protocol EnableCursor OutputString QueryMode Reset SetAttribute SetCursorPosition SetMode TestString Unicode Collation FatToStr Protocol MetaiMatch StriColl StrLwr StrToFat StrUpr...
  • Page 377: F Glossary

    _ADR A reserved name in ACPI name space. It refers to an address on a bus that has standard enumeration. An example would be PCI, where the enumeration method is described in the PCI Local Bus specification. _CRS A reserved name in ACPI name space. It refers to the current resource setting of a device.
  • Page 378 Extensible Firmware Interface Specification BIOS Boot Specification Device Path A Device Path that is used to point to boot legacy operating systems; it is based on the BIOS Boot Specification, Version 1.01. BIOS Parameter Block (BPB) The first block (sector) of a partition. It defines the type and location of the FAT File System on a drive.
  • Page 379 Boot Services Time The period of time between platform initialization and the call to ExitBootServices(). During this time, EFI drivers and applications are loaded iteratively and the system boots from an ordered list of EFI OS loaders. See BIOS Parameter Block. See Common Information Model.
  • Page 380 Extensible Firmware Interface Specification Desktop Management Task Force (DMTF) The DMTF is a standards organization comprised of companies from all areas of the computer industry. Its purpose is to create the standards and infrastructure for cost- effective management of PC systems.
  • Page 381 EM (Enhanced Mode) The 64-bit architecture extension that makes up part of the Intel Itanium architecture. End of Hardware Device Path A Device Path which, depending on the sub-type, is used to indicate the end of the Device Path instance or Device Path structure.
  • Page 382 Extensible Firmware Interface Specification Event An EFI data structure that describes an “event” — for example, the expiration of a timer. Event Services The set of functions used to manage events. Includes CheckEvent(), CreateEvent(), CloseEvent(), SignalEvent(), and WaitForEvent(). See File Allocation Table.
  • Page 383 StartImage(), UnloadImage(), Exit(), ExitBootServices(), and EFI_IMAGE_ENTRY_POINT. Intel Architecture-32 (IA-32) The 32-bit and 16-bit architecture described in the Intel Architecture Software Developer’s Manual. IA-32 is the architecture of the Intel P6 family of processors, ® which includes the Intel Version 1.02 ®...
  • Page 384 IA-32 instruction set. This architecture is described in the IA-64 Architecture Software Developer’s Manual. Intel Architecture Platform Architecture A collective term for PC-AT-class computers and other systems based on Intel Architecture processors of all families. Legacy Platform A platform which, in the interests of providing backward-compatibility, retains obsolete technology.
  • Page 385 See Machine Check Abort. Media Device Path A Device Path that is used to describe the portion of a medium that is being abstracted by a boot service. For example, a Media Device Path could define which partition on a hard drive was being used.
  • Page 386 Extensible Firmware Interface Specification See Network Boot Program. Network Boot Program A remote boot image downloaded by a PXE client using the Trivial File Transfer Protocol or the Multicast Trivial File Transfer Protocol. Page Memory A set of contiguous pages. Page memory is allocated by returned by FreePages().
  • Page 387 Protocol Handler Services The set of functions used to manipulate handles, protocols, and protocol interfaces. Includes InstallProtocolInterface(), UninstallProtocolInterface(), ReInstallProtocolInterface(), HandleProtocol(), RegisterProtocolNotify(), LocateHandle(),and LocateDevicePath(). Protocol Interface Structure The set of data definitions and functions used to access a particular type of device. For example, BLOCK_IO is a protocol that encompasses interfaces to read and write blocks from mass storage devices.
  • Page 388 Extensible Firmware Interface Specification Simple File System Protocol A component of the File System Protocol. It provides a minimal interface for file-type access to a device. Simple Input Protocol A protocol that is used to obtain input from the ConsoleIn device. It is one of two protocols that make up the Console I/O Protocol.
  • Page 389 Iomega Zip drive). System Partitions can reside on any medium that is supported by EFI Boot Services. System Partitions support backward compatibility with legacy Intel Architecture systems by reserving the first block (sector) of the partition for compatibility code.
  • Page 390 Extensible Firmware Interface Specification Trivial File Transport Protocol (TFTP) A protocol used to download a Network Boot Program from a TFTP server. Unicode An industry standard internationalized character set used for human readable message display. Unicode Collation Protocol A protocol that is used during boot services to perform case-insensitive comparisons of Unicode strings.
  • Page 391: G.1 Introduction

    G.1 Introduction This appendix defines the 32/64-bit H/W and S/W Universal Network Driver Interfaces (UNDIs). These interfaces provide one method for writing a network driver; other implementations are possible. NOTE This is the Beta-1 version of the 32/64-bit UNDI Specification. G.1.1 Definitions Table G-1.
  • Page 392: G.1.2 Referenced Specifications

    Extensible Firmware Interface Specification Table G-1. Definitions (continued) Term Definition Preboot Execution Environment The complete PXE specification covers three areas; the client, the network and the server. Client • Makes network devices into bootable devices. • Provides APIs for PXE protocol modules in EFI and for universal drivers in the OS.
  • Page 393 DHCP for Ipv4 (protocol: http://www.ietf.org/rfc/rfc2131.txt, options: http://www.ietf.org/rfc/rfc2132.txt) Required reading for those implementing the BC protocol or PXE Bootservers. Extensible Firmware Interface – Required reading for those implementing NBPs, OS loaders and preboot applications for machines with the EFI preboot environment.
  • Page 394: G.1.3 Os Network Stacks

    Extensible Firmware Interface Specification Table G-2. Referenced Specification (continued) Acronym Protocol/Specification Transmission Control Protocol TCPv4: http://www.ietf.org/rfc/rfc0793.txt TCPv6: ftp://ftp.ipv6.org/pub/rfc/rfc2147.txt Required reading for those implementing the BC protocol. TFTP Trivial File Transfer Protocol TFTP over IPv4 (protocol: http://www.ietf.org/rfc/rfc1350.txt, options: http://www.ietf.org/rfc/rfc2347.txt, http://www.ietf.org/rfc/rfc2349.txt). TFTP over IPv6: %%TBD need URL and an RFC! Required reading for those implementing the BC protocol.
  • Page 395: G-3. Driver Types: Pros And Cons

    Table G-3. Driver Types: Pros and Cons Driver • Can be very fast and efficient. Custom NIC vendor tunes driver to OS & device. • OS vendor does not have to write NIC driver. • S/W UNDI driver is simpler S/W UNDI than a Custom driver.
  • Page 396: G.2 Overview

    Extensible Firmware Interface Specification G.2 Overview There are three major design changes between this specification and the 16-bit UNDI in version 2.1 of the PXE Specification: • A new architectural hardware interface has been added. • All UNDI commands use the same command format.
  • Page 397: G-4. !Pxe Structure Field Definitions

    The !PXE structure for S/W UNDI can be loaded into system memory from one of three places; ROM on a NIC, system non-volatile storage, or external storage. Since there are no direct memory or I/O ports available in the S/W UNDI !PXE structure, an indirect callable entry point is provided. S/W UNDI developers are free to make their internal designs as simple or complex as they desire, as long as all of the UNDI commands in this specification are implemented.
  • Page 398 Extensible Firmware Interface Specification Table G-4. !PXE Structure Field Definitions (continued) Identifier Value Description Implementation Varies Identifies type of UNDI (S/W or H/W, 32 bit or 64 bit) and what features have been implemented. The implementation bits are defined below. Undefined bits must be set to zero by UNDI implementors.
  • Page 399 Table G-4. !PXE Structure Field Definitions (continued) Identifier Value Description Status Varies UNDI operation, command and interrupt status flags. This is a read-only port. Undefined status bits must be set to zero. Reading this port does NOT clear the status. Bit 0x00: Command completion interrupt pending (1) or not pending (0) Bit 0x01: Packet received interrupt pending (1) or not pending (0) Bit 0x02: Transmit complete interrupt pending (1) or not pending (0)
  • Page 400 Extensible Firmware Interface Specification Table G-4. !PXE Structure Field Definitions (continued) Identifier Value Description S/W UNDI Fields EntryPoint Varies S/W UNDI API entry point address. This is either a virtual address or an offset from the start of the !PXE structure. Protocol drivers will push the 64-bit virtual address of a CDB on the stack and then call the UNDI API entry point.
  • Page 401: Issuing Undi Commands

    G.2.1.1 Issuing UNDI Commands How commands are written and status is checked varies a little depending on the type of UNDI (H/W or S/W) implementation being used. The command flowchart below is a high level diagram on how commands are written to both H/W and S/W UNDI. Step 1.
  • Page 402: G.2.2 Undi Command Format

    Extensible Firmware Interface Specification G.2.2 UNDI Command Format The format of the CDB is the same for all UNDI commands. Some of the commands do not use or always require the use of all of the fields in the CDB. When fields are not used they must be initialized to zero or the UNDI will return an error.
  • Page 403 Table G-5. UNDI CDB Field Definitions (continued) Identifier Description CPBsize Command Parameter Block Size This field should be set to a number that is equal to the number of bytes that will be read from CPB structure during command execution. Setting this field to a number that is too small will cause the command to not be executed and a StatCode of PXE_STATCODE_INVALID_CDB The contents of the CPB structure will not be modified.
  • Page 404: G.3 Undi C Definitions

    Extensible Firmware Interface Specification Table G-5. UNDI CDB Field Definitions (continued) Identifier Description IFnum Interface Number This field is used to identify which network adapter (S/W UNDI) or network connector (H/W UNDI) this command is being sent to. If an invalid interface number is given, the command will not execute and a StatCode of returned.
  • Page 405 G.3.1.3 PXE_BUSTYPE Used to convert a 4-character ASCII identifier to a 32-bit unsigned integer. #if PXE_INTEL_ORDER # define PXE_BUSTYPE(a,b,c,d) ((((PXE_UINT32)(d) & 0xFF) << 24) | (((PXE_UINT32)(c) & 0xFF) << 16) | (((PXE_UINT32)(b) & 0xFF) << 8) | ((PXE_UINT32)(a) & 0xFF)) #else # define PXE_BUSTYPE(a,b,c,d) ((((PXE_UINT32)(a) &...
  • Page 406 Extensible Firmware Interface Specification G.3.1.4 PXE_SWAP_UINT16 This macro swaps bytes in a 16-bit word. #ifdef PXE_INTEL_ORDER # define PXE_SWAP_UINT16(n) ((((PXE_UINT16)(n) & 0x00FF) << 8) | (((PXE_UINT16)(n) & 0xFF00) >> 8)) #else # define PXE_SWAP_UINT16(n) #endif G.3.1.5 PXE_SWAP_UINT32 This macro swaps bytes in a 32-bit word.
  • Page 407 G.3.1.6 PXE_SWAP_UINT64 This macro swaps bytes in a 64-bit word for compilers that support 64-bit words. #if PXE_UINT64_SUPPORT != 0 # ifdef PXE_INTEL_ORDER define PXE_SWAP_UINT64(n) ((((PXE_UINT64)(n) & 0x00000000000000FF) << 56) |\ (((PXE_UINT64)(n) & 0x000000000000FF00) << 40) | \ (((PXE_UINT64)(n) & 0x0000000000FF0000) << 24) | \ (((PXE_UINT64)(n) &...
  • Page 408: G.3.2 Miscellaneous Macros

    The storage sizes defined in this section are critical for PXE module inter-operation. All of the portability typedefs define little endian (Intel format) storage. The least significant byte is stored in the lowest memory address and the most significant byte is stored in the highest memory address.
  • Page 409 G.3.3.3 PXE_VOID The void type does not allocate storage. This type is used only to prototype functions that do not return any information and/or do not take any parameters. typedef void PXE_VOID; G.3.3.4 PXE_UINT8 Unsigned 8-bit integer. typedef unsigned char PXE_UINT8; G.3.3.5 PXE_UINT16 Unsigned 16-bit integer.
  • Page 410: G.3.4 Simple Types

    Extensible Firmware Interface Specification G.3.4 Simple Types The PXE simple types are defined using one of the portability types from the previous section. G.3.4.1 PXE_BOOL Boolean (true/false) data type. For PXE zero is always false and non-zero is always true.
  • Page 411 // Change the UNDI operational state from Initialized to Started. #define PXE_OPCODE_SHUTDOWN // Read & change state of external interrupt enables. #define PXE_OPCODE_INTERRUPT_ENABLES // Read & change state of packet receive filters. #define PXE_OPCODE_RECEIVE_FILTERS // Read & change station MAC address. #define PXE_OPCODE_STATION_ADDRESS // Read traffic statistics.
  • Page 412 Extensible Firmware Interface Specification G.3.4.3 PXE_OPFLAGS typedef PXE_UINT16 PXE_OPFLAGS; #define PXE_OPFLAGS_NOT_USED //******************************************************* // UNDI Get State //******************************************************* // No OpFlags //******************************************************* // UNDI Start //******************************************************* // No OpFlags //******************************************************* // UNDI Stop //******************************************************* // No OpFlags //******************************************************* // UNDI Get Init Info...
  • Page 413 //******************************************************* // UNDI Initialize //******************************************************* #define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK #define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE #define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE //******************************************************* // UNDI Reset //******************************************************* #define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS #define PXE_OPFLAGS_RESET_DISABLE_FILTERS //******************************************************* // UNDI Shutdown //******************************************************* // No OpFlags //******************************************************* // UNDI Interrupt Enables //******************************************************* // Select whether to enable or disable external interrupt signals. // Setting both enable and disable will return // PXE_STATCODE_INVALID_OPFLAGS.
  • Page 414 Extensible Firmware Interface Specification // Enable receive interrupts. // generated after a complete non-error packet has been received. #define PXE_OPFLAGS_INTERRUPT_RECEIVE // Enable transmit interrupts. // generated after a complete non-error packet has been // transmitted. #define PXE_OPFLAGS_INTERRUPT_TRANSMIT // Enable command interrupts.
  • Page 415 #define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK #define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE #define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE #define PXE_OPFLAGS_RECEIVE_FILTER_READ // To reset the contents of the multicast MAC address filter list, // set this OpFlag: #define PXE_OPFLAGS_RECEIVE_FILTERS_RESET_MCAST_LIST // Enable unicast packet receiving. // station MAC address will be received. #define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST // Enable broadcast packet receiving.
  • Page 416 Extensible Firmware Interface Specification // Enable promiscuous packet receiving. // received. #define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS // Enable promiscuous multicast packet receiving. // packets will be received. #define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST //******************************************************* // UNDI Station Address //******************************************************* #define PXE_OPFLAGS_STATION_ADDRESS_READ #define PXE_OPFLAGS_STATION_ADDRESS_WRITE #define PXE_OPFLAGS_STATION_ADDRESS_RESET //******************************************************* // UNDI Statistics...
  • Page 417 // UNDI NvData //******************************************************* // Select the type of non-volatile data operation. #define PXE_OPFLAGS_NVDATA_OPMASK #define PXE_OPFLAGS_NVDATA_READ #define PXE_OPFLAGS_NVDATA_WRITE //******************************************************* // UNDI Get Status //******************************************************* // Return current interrupt status. // interrupts that are currently set. // polling routine. The interrupt flags are still set and cleared // even when the interrupts are disabled.
  • Page 418 Extensible Firmware Interface Specification // UNDI Transmit //******************************************************* // S/W UNDI only. Return after the packet has been transmitted. // A transmit complete interrupt will still be generated and the // transmit buffer will have to be recycled. #define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK...
  • Page 419 #define PXE_STATFLAGS_COMMAND_QUEUED //******************************************************* // UNDI Get State //******************************************************* #define PXE_STATFLAGS_GET_STATE_MASK #define PXE_STATFLAGS_GET_STATE_INITIALIZED #define PXE_STATFLAGS_GET_STATE_STARTED #define PXE_STATFLAGS_GET_STATE_STOPPED //******************************************************* // UNDI Start //******************************************************* // No additional StatFlags //******************************************************* // UNDI Get Init Info //******************************************************* #define PXE_STATFLAGS_CABLE_DETECT_MASK #define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED #define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED //******************************************************* // UNDI Initialize //******************************************************* #define PXE_STATFLAGS_INITIALIZED_NO_MEDIA //*******************************************************...
  • Page 420 Extensible Firmware Interface Specification //******************************************************* // UNDI Shutdown //******************************************************* // No additional StatFlags //******************************************************* // UNDI Interrupt Enables //******************************************************* // If set, receive interrupts are enabled. #define PXE_STATFLAGS_INTERRUPT_RECEIVE // If set, transmit interrupts are enabled. #define PXE_STATFLAGS_INTERRUPT_TRANSMIT // If set, command interrupts are enabled.
  • Page 421 // If set, all multicast packets will be received. #define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010 //******************************************************* // UNDI Station Address //******************************************************* // No additional StatFlags //******************************************************* // UNDI Statistics //******************************************************* // No additional StatFlags //******************************************************* // UNDI MCast IP to MAC //******************************************************* // No additional StatFlags //******************************************************* // UNDI NvData //*******************************************************...
  • Page 422 Extensible Firmware Interface Specification // If set, at least one receive interrupt occurred. #define PXE_STATFLAGS_GET_STATUS_RECEIVE // If set, at least one transmit interrupt occurred. #define PXE_STATFLAGS_GET_STATUS_TRANSMIT // If set, at least one command interrupt occurred. #define PXE_STATFLAGS_GET_STATUS_COMMAND // If set, at least one software interrupt occurred.
  • Page 423 G.3.4.5 PXE_STATCODE typedef PXE_UINT16 PXE_STATCODE; #define PXE_STATCODE_INITIALIZE //******************************************************* // Common StatCodes returned by all UNDI commands, UNDI protocol // functions and BC protocol functions. //******************************************************* #define PXE_STATCODE_SUCCESS #define PXE_STATCODE_INVALID_CDB #define PXE_STATCODE_INVALID_CPB #define PXE_STATCODE_BUSY #define PXE_STATCODE_QUEUE_FULL #define PXE_STATCODE_ALREADY_STARTED #define PXE_STATCODE_NOT_STARTED #define PXE_STATCODE_NOT_SHUTDOWN #define PXE_STATCODE_ALREADY_INITIALIZED #define PXE_STATCODE_NOT_INITIALIZED #define PXE_STATCODE_DEVICE_FAILURE...
  • Page 424 Extensible Firmware Interface Specification G.3.4.6 PXE_IFNUM typedef PXE_UINT16 PXE_IFNUM; // This interface number must be passed to the S/W UNDI Start // command. #define PXE_IFNUM_START // This interface number is returned by the S/W UNDI Get State and // Start commands if information in the CDB, CPB or DB is invalid.
  • Page 425 #define PXE_FRAME_TYPE_FILTERED_MULTICAST #define PXE_FRAME_TYPE_PROMISCUOUS #define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST G.3.4.9 PXE_IPV4 This storage type is always big endian (network order) not little endian (Intel order). typedef PXE_UINT32 PXE_IPV4; G.3.4.10 PXE_IPV6 This storage type is always big endian (network order) not little endian (Intel order).
  • Page 426 Extensible Firmware Interface Specification G.3.4.12 PXE_IFTYPE The interface type is returned by the Get Initialization Information command and is used by the BC DHCP protocol function. This field is also used for the low order 8-bits of the H/W type field in ARP packets.
  • Page 427: G.3.5 Compound Types

    G.3.5 Compound Types All PXE structures must be byte packed. G.3.5.1 PXE_HW_UNDI This section defines the C structures and #defines for the !PXE H/W UNDI interface. #pragma pack(1) typedef struct s_pxe_hw_undi { PXE_UINT32 Signature; PXE_UINT8 Len; PXE_UINT8 Fudge; PXE_UINT8 Rev; PXE_UINT8 IFcnt;...
  • Page 428 Extensible Firmware Interface Specification // If set, last command failed #define PXE_HWSTAT_COMMAND_FAILED // If set, identifies enabled receive filters #define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED #define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED #define PXE_HWSTAT_BROADCAST_RX_ENABLED #define PXE_HWSTAT_MULTICAST_RX_ENABLED #define PXE_HWSTAT_UNICAST_RX_ENABLED // If set, identifies enabled external interrupts #define PXE_HWSTAT_SOFTWARE_INT_ENABLED #define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED...
  • Page 429 // Use these to enable/disable receive filters. #define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000 #define PXE_HWCMD_PROMISCUOUS_RX_ENABLE #define PXE_HWCMD_BROADCAST_RX_ENABLE #define PXE_HWCMD_MULTICAST_RX_ENABLE #define PXE_HWCMD_UNICAST_RX_ENABLE // Use these to enable/disable external interrupts #define PXE_HWCMD_SOFTWARE_INT_ENABLE #define PXE_HWCMD_TX_COMPLETE_INT_ENABLE #define PXE_HWCMD_PACKET_RX_INT_ENABLE #define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE // Use these to clear pending external interrupts #define PXE_HWCMD_CLEAR_SOFTWARE_INT #define PXE_HWCMD_CLEAR_TX_COMPLETE_INT #define PXE_HWCMD_CLEAR_PACKET_RX_INT...
  • Page 430 Extensible Firmware Interface Specification PXE_UINT64 EntryPoint; PXE_UINT8 reserved2[3]; PXE_UINT8 BusCnt; PXE_UINT32 BusType[1]; } PXE_SW_UNDI; #pragma pack() G.3.5.3 PXE_UNDI PXE_UNDI combines both the H/W and S/W UNDI types into one typedef and has #defines for common fields in both H/W and S/W UNDI types.
  • Page 431 #define PXE_ROMID_IMP_64BIT_DEVICE #define PXE_ROMID_IMP_FRAG_SUPPORTED #define PXE_ROMID_IMP_CMD_LINK_SUPPORTED #define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED #define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED #define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK #define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE #define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE #define PXE_ROMID_IMP_NVDATA_READ_ONLY #define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE #define PXE_ROMID_IMP_STATISTICS_SUPPORTED #define PXE_ROMID_IMP_STATION_ADDR_SETTABLE #define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED \ 0x00000080 #define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED \ 0x00000040 #define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED \ 0x00000020 #define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED \ 0x00000010 #define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED \ 0x00000008 #define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED \...
  • Page 432 PXE_STATFLAGS StatFlags; PXE_UINT16 IFnum; PXE_CONTROL Control; } PXE_CDB; #pragma pack() G.3.5.5 PXE_IP_ADDR This storage type is always big endian (network order) not little endian (Intel order). #pragma pack(1) typedef union u_pxe_ip_addr { PXE_IPV6 IPv6; PXE_IPV4 IPv4; } PXE_IP_ADDR; #pragma pack() 12/12/00 Version 1.02...
  • Page 433 G.3.5.6 PXE_DEVICE This typedef is used to identify the network device that is being used by the UNDI. This information is returned by the Get Config Info command. #pragma pack(1) typedef union pxe_device { // PCI and PC Card NICs are both identified using bus, device // and function numbers.
  • Page 434: G.4 Undi Commands

    Extensible Firmware Interface Specification G.4 UNDI Commands All 32/64-bit UNDI commands use the same basic command format, the CDB (Command Descriptor Block). CDB fields that are not used by a particular command must be initialized to zero by the application/driver that is issuing the command.
  • Page 435: G.4.1 Command Linking & Queuing

    G.4.1 Command Linking & Queuing When linking commands, the CDBs must be stored consecutively in system memory without any gaps in between. Do not set the Link bit in the last CDB in the list. The Link bit must be set in all other CDBs in the list.
  • Page 436: G.4.2 Get State

    Extensible Firmware Interface Specification When a command is queued a StatFlag of commands are queued only the StatFlag of the first CDB gets set). This signals that the command was added to the queue. Commands in the queue will be run on a first-in, first-out, basis. When a command fails, the next command in the queue is run.
  • Page 437 G.4.2.1 Issuing the Command To issue a Get State command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Get State command OpCode PXE_OPCODE_GET_STATE OpFlags PXE_OPFLAGS_NOT_USED CPBsize PXE_CPBSIZE_NOT_USED DBsize...
  • Page 438: G.4.3 Start

    Extensible Firmware Interface Specification G.4.3 Start This command is used to change the UNDI operational state from stopped to started. No other operational checks are made by this command. If this is a S/W UNDI, the Delay() and Virt2Phys() functions will not be called by this command.
  • Page 439 Preparing the CPB The CPB for the S/W UNDI Start command (shown below) must be filled in and the size and address of the CPB must be given in the CDB. #pragma pack(1) typedef struct s_pxe_cpb_start { // PXE_VOID Delay(PXE_UINT64 microseconds); // UNDI will never request a delay smaller than 10 microseconds // and will always request delays in increments of 10 // microseconds.
  • Page 440: G.4.4 Stop

    Extensible Firmware Interface Specification // This field can be set to zero if virtual and physical // addresses are equal. PXE_UINT64 Virt2Phys; PXE_UINT64 Mem_IO; } PXE_CPB_START; #pragma pack() #define PXE_DELAY_MILLISECOND #define PXE_DELAY_SECOND #define PXE_IO_READ #define PXE_IO_WRITE #define PXE_MEM_READ #define PXE_MEM_WRITE G.4.3.2...
  • Page 441: G.4.5 Get Init Info

    G.4.4.1 Issuing the Command To issue a Stop command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Stop command OpCode PXE_OPCODE_STOP OpFlags PXE_OPFLAGS_NOT_USED CPBsize PXE_CPBSIZE_NOT_USED DBsize PXE_DBSIZE_NOT_USED CPBaddr...
  • Page 442 Extensible Firmware Interface Specification G.4.5.1 Issuing the Command To issue a Get Init Info command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Get Init Info command...
  • Page 443 #pragma pack(1) typedef struct s_pxe_db_get_init_info { // Minimum length of locked memory buffer that must be given to // the Initialize command. // generally give better performance. // If MemoryRequired is zero, the UNDI does not need and will not // use system memory to receive and transmit packets.
  • Page 444 Extensible Firmware Interface Specification // Number of bytes in the NIC hardware (MAC) address. PXE_UINT16 HWaddrLen; // Maximum number of multicast MAC addresses in the multicast // MAC address filter list. PXE_UINT16 MCastFilterCnt; // Default number and size of transmit and receive buffers that // will be allocated by the UNDI.
  • Page 445: G.4.6 Get Config Info

    #define PXE_MAX_TXRX_UNIT_ETHER #define PXE_HWADDR_LEN_ETHER #define PXE_DUPLEX_ENABLE_FULL_SUPPORTED #define PXE_DUPLEX_FORCE_FULL_SUPPORTED #define PXE_LOOPBACK_INTERNAL_SUPPORTED #define PXE_LOOPBACK_EXTERNAL_SUPPORTED G.4.6 Get Config Info This command is used to retrieve configuration information about the NIC being controlled by the UNDI. G.4.6.1 Issuing the Command To issue a Get Config Info command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Get Config Info command OpCode...
  • Page 446 Extensible Firmware Interface Specification G.4.6.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode SUCCESS INVALID_CDB BUSY QUEUE_FULL NOT_STARTED #pragma pack(1) typedef struct s_pxe_pci_config_info { // This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
  • Page 447 typedef struct s_pxe_pcc_config_info { // This is the flag field for the PXE_DB_GET_CONFIG_INFO union. // For PCC bus devices, this field is set to PXE_BUSTYPE_PCC. PXE_UINT32 BusType; // This identifies the PCC network device that this UNDI // interface is bound to. PXE_UINT16 Bus;...
  • Page 448: G.4.7 Initialize

    Extensible Firmware Interface Specification G.4.7 Initialize This command resets the network adapter and initializes UNDI using the parameters supplied in the CPB. The Initialize command must be issued before the network adapter can be setup to transmit and receive packets. This command will not enable the receive unit or external interrupts.
  • Page 449 Preparing the CPB If the field returned in the MemoryRequired Initialize command does not need to be given a memory buffer or even a CPB structure. If the field is non-zero, the Initialize command does need a memory buffer. MemoryRequired #pragma pack(1) typedef struct s_pxe_cpb_initialize { // Address of first (lowest) byte of the memory buffer.
  • Page 450 Extensible Firmware Interface Specification // The following configuration parameters are optional and must // be zero to use the default values. PXE_UINT8 Duplex; PXE_UINT8 LoopBack; } PXE_CPB_INITIALIZE; #pragma pack() #define PXE_DUPLEX_DEFAULT #define PXE_FORCE_FULL_DUPLEX #define PXE_ENABLE_FULL_DUPLEX #define LOOPBACK_NORMAL #define LOOPBACK_INTERNAL #define LOOPBACK_EXTERNAL G.4.7.2...
  • Page 451 G.4.7.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode Reason SUCCESS Command completed successfully. UNDI and network device is now initialized. DB has been written. Check StatFlags. INVALID_CDB One of the CDB fields was not set correctly.
  • Page 452: G.4.8 Reset

    Extensible Firmware Interface Specification G.4.8 Reset This command resets the network adapter and re-initializes the UNDI with the same parameters provided in the Initialize command. The transmit and receive queues are emptied and any pending interrupts are cleared. Depending on the state of the OpFlags, the receive filters and external interrupt enables may also be reset.
  • Page 453: G.4.9 Shutdown

    G.4.8.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode Reason SUCCESS Command completed successfully. UNDI and network device have been reset. Check StatFlags. INVALID_CDB One of the CDB fields was not set correctly. BUSY UNDI is already processing commands.
  • Page 454 Extensible Firmware Interface Specification G.4.9.1 Issuing the Command To issue a Shutdown command, create a CDB and fill it in as shown in the table below: CDB Field How to initialize the CDB structure for a Shutdown command OpCode PXE_OPCODE_SHUTDOWN...
  • Page 455: G.4.10 Interrupt Enables

    G.4.10 Interrupt Enables The Interrupt Enables command can be used to read and/or change the current external interrupt enable settings. Disabling an external interrupt enable prevents an external (hardware) interrupt from being signaled by the network device, internally the interrupt events can still be polled by using the Get Status command.
  • Page 456 Extensible Firmware Interface Specification G.4.10.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags COMMAND_COMPLETE COMMAND_FAILED COMMAND_QUEUED INITIALIZE G.4.10.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution.
  • Page 457: G.4.11 Receive Filters

    G.4.11 Receive Filters This command is used to read and change receive filters and, if supported, read and change the multicast MAC address filter list. G.4.11.1 Issuing the Command To issue a Receive Filters command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Receive Filters command OpCode...
  • Page 458 Extensible Firmware Interface Specification Preparing the CPB The receive filter CPB is used to change the contents multicast MAC address filter list. To leave the multicast MAC address filter list unchanged, set the PXE_CPBSIZE_NOT_USED To change the multicast MAC address filter list, set multicast MAC address filter list and set mutlicast MAC address filter list.
  • Page 459 G.4.11.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode SUCCESS INVALID_CDB INVALID_CPB BUSY QUEUE_FULL NOT_STARTED NOT_INITIALIZED StatFlags The receive filter settings in CDB.StatFlags are: • PXE_STATFLAGS_RECEIVE_FILTER_UNICAST • PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST •...
  • Page 460: G.4.12 Station Address

    Extensible Firmware Interface Specification G.4.12 Station Address This command is used to get current station and broadcast MAC addresses and, if supported, to change the current station MAC address. G.4.12.1 Issuing the Command To issue a Station Address command, create a CDB and fill it in as shows in the table below:...
  • Page 461 G.4.12.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags COMMAND_COMPLETE COMMAND_FAILED COMMAND_QUEUED INITIALIZE G.4.12.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution.
  • Page 462: G.4.13 Statistics

    Extensible Firmware Interface Specification G.4.13 Statistics This command is used to read and clear the NIC traffic statistics. Before using this command check to see if statistics is supported in the G.4.13.1 Issuing the Command To issue a Statistics command, create a CDB and fill it in as shows in the table below:...
  • Page 463 G.4.13.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags COMMAND_COMPLETE COMMAND_FAILED COMMAND_QUEUED INITIALIZE G.4.13.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution.
  • Page 464 Extensible Firmware Interface Specification PXE_UINT64 Data[64]; } PXE_DB_STATISTICS; // Total number of frames received. // and dropped frames. #define PXE_STATISTICS_RX_TOTAL_FRAMES // Number of valid frames received and copied into receive // buffers. #define PXE_STATISTICS_RX_GOOD_FRAMES // Number of frames below the minimum length for the media.
  • Page 465 // Transmit statistics. #define PXE_STATISTICS_TX_TOTAL_FRAMES #define PXE_STATISTICS_TX_GOOD_FRAMES #define PXE_STATISTICS_TX_UNDERSIZE_FRAMES #define PXE_STATISTICS_TX_OVERSIZE_FRAMES #define PXE_STATISTICS_TX_DROPPED_FRAMES #define PXE_STATISTICS_TX_UNICAST_FRAMES #define PXE_STATISTICS_TX_BROADCAST_FRAMES #define PXE_STATISTICS_TX_MULTICAST_FRAMES #define PXE_STATISTICS_TX_CRC_ERROR_FRAMES #define PXE_STATISTICS_TX_TOTAL_BYTES // Number of collisions detection on this subnet. #define PXE_STATISTICS_COLLISIONS // Number of frames destined for unsupported protocol. #define PXE_STATISTICS_UNSUPPORTED_PROTOCOL Version 1.02 32/64-bit UNDI Specification...
  • Page 466: G.4.14 Mcast Ip To Mac

    Extensible Firmware Interface Specification G.4.14 MCast IP To MAC Translate a multicast IPv4 or IPv6 address to a multicast MAC address. G.4.14.1 Issuing the Command To issue a MCast IP To MAC command, create a CDB and fill it in as shows in the table below:...
  • Page 467: G.4.15 Nvdata

    G.4.14.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags COMMAND_COMPLETE COMMAND_FAILED COMMAND_QUEUED INITIALIZE G.4.14.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution.
  • Page 468 Extensible Firmware Interface Specification G.4.15.1 Issuing the Command To issue a NvData command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a NvData command OpCode PXE_OPCODE_NVDATA OpFlags Set as needed.
  • Page 469 Sparse NvData CPB typedef struct s_pxe_cpb_nvdata_sparse { // NvData item list. Only items in this list will be updated. struct { // Non-volatile storage address to be changed. PXE_UINT32 Addr; // Data item to write into above storage address. union { PXE_UINT8 Byte;...
  • Page 470 Extensible Firmware Interface Specification Bulk NvData CPB // When using bulk update, the size of the CPB structure must be // the same size as the non-volatile NIC storage. typedef union u_pxe_cpb_nvdata_bulk { // Array of byte-wide data items. PXE_UINT8 Byte[n];...
  • Page 471 G.4.15.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode SUCCESS INVALID_CDB INVALID_CPB BUSY QUEUE_FULL NOT_STARTED NOT_INITIALIZED UNSUPPORTED Check the width and number of non-volatile storage items. This information is returned by the Get Init Info command.
  • Page 472: G.4.16 Get Status

    Extensible Firmware Interface Specification G.4.16 Get Status This command returns the current interrupt status and/or the transmitted buffer addresses. If the current interrupt status is returned, pending interrupts will be acknowledged by this command. Transmitted buffer addresses that are written to the DB are removed from the transmitted buffer queue.
  • Page 473 G.4.16.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode Reason SUCCESS Command completed successfully. StatFlags and/or DB are updated. INVALID_CDB One of the CDB fields was not set correctly. BUSY UNDI is already processing commands.
  • Page 474: G.4.17 Fill Header

    Extensible Firmware Interface Specification Using the DB When reading the transmitted buffer addresses there should be room for at least one 64-bit address in the DB. Once a complete transmitted buffer address is written into the DB, the address is removed from the transmitted buffer queue.
  • Page 475 G.4.17.1 Issuing the Command To issue a Fill Header command, create a CDB and fill it in as shows in the table below: CDB Field How to initialize the CDB structure for a Fill Header command OpCode PXE_OPCODE_FILL_HEADER OpFlags Set as needed. CPBsize PXE_CPB_FILL_HEADER DBsize...
  • Page 476 Extensible Firmware Interface Specification // Length of packet data in bytes (not including the media // header). PXE_UINT32 PacketLen; // Protocol type. // without doing byte swapping. // obtained from the Assigned Numbers RFC 1700. PXE_UINT16 Protocol; // Length of the media header in bytes.
  • Page 477 // Number of packet fragment descriptors. PXE_UINT16 FragCnt; // Reserved, must be set to zero. PXE_UINT16 reserved; // Array of packet fragment descriptors. // media header is the first byte of the first fragment. struct { // Address of this packet fragment. PXE_UINT64 FragAddr;...
  • Page 478: G.4.18 Transmit

    Extensible Firmware Interface Specification G.4.17.3 Checking Command Execution Results After command execution completes, either successfully or not, the contains the result of the command execution. StatCode Reason SUCCESS Command completed successfully. Frame is ready to transmit. INVALID_CDB One of the CDB fields was not set correctly.
  • Page 479 OpFlags Check the !PXE.Implementation packets. Select one of the OpFlags below so the UNDI knows what type of CPB is being used. • PXE_OPFLAGS_TRANSMIT_WHOLE • PXE_OPFLAGS_TRANSMIT_FRAGMENTED In addition to selecting whether or not fragmented packets are being given, S/W UNDI needs to know if it should block until the packets are transmitted.
  • Page 480 Extensible Firmware Interface Specification Fragmented Frame #pragma pack(1) typedef struct s_pxe_cpb_transmit_fragments { // Length of packet data in bytes (not including the media // header). PXE_UINT32 FrameLen; // Length of the media header in bytes. PXE_UINT16 MediaheaderLen; // Number of packet fragment descriptors.
  • Page 481 G.4.18.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags Reason COMMAND_COMPLETE Command completed successfully. Use the Get Status command to see when frame buffers can be re-used.
  • Page 482: G.4.19 Receive

    Extensible Firmware Interface Specification G.4.19 Receive When the network adapter has received a frame, this command is used to copy the frame into driver/application storage. Once a frame has been copied, it is removed from the receive queue. G.4.19.1 Issuing the Command...
  • Page 483 G.4.19.2 Waiting for the Command to Execute Monitor the upper two bits (14 & 15) in the report PXE_STATFLAGS_COMMAND_COMPLETE the command has not been executed by the UNDI. StatFlags Reason COMMAND_COMPLETE Command completed successfully. Frames received and DB is written. COMMAND_FAILED Command failed.
  • Page 484: Undi As An Efi Runtime Driver

    Extensible Firmware Interface Specification // Protocol type from media header. PXE_PROTOCOL Protocol; // Length of media header in received frame. PXE_UINT16 MediaHeaderLen; // Type of receive frame. PXE_FRAME_TYPE Type; // Reserved, must be zero. PXE_UINT8 reserved[7]; } PXE_DB_RECEIVE; #pragma pack() G.5 UNDI as an EFI Runtime Driver...
  • Page 485 32/64-bit UNDI Specification } NII_entry[n]; // the length of this array is given in the NumberOfInterfaces field } UNDI_CONFIG_TABLE; Since there can only be one configuration table associated with any GUID and there can be more than one UNDI loaded, every instance of UNDI must check for any previous installations of the configuration tables and if there are any, it must traverse though the list of all UNDI configuration tables using the nextlink and install itself as the nextlink of the last table in the list.
  • Page 486 Extensible Firmware Interface Specification 12/12/00 Version 1.02...
  • Page 487: Index

    _HID, 123 _UID, 123 ACPI, 8 ACPI name space, 337, 342 ACPI Source Language, 117 Advanced Configuration and Power Interface specification, 8. See also related information Alphabetic Function Lists, 347 ANSI 3.64 terminals, and SIMPLE_TEXT_OUTPUT, 334 Application, EFI, 110 ARP cache entries, 244 ASL.
  • Page 488 Extensible Firmware Interface Specification Device I/O Protocol, 137 Functions AllocateBuffer (), 147, 150 Flush(), 149 Io(), 141 Map(), 144 Mem(), 141 Pci(), 141 PciDevicePath (), 143 Unmap(), 146 GUID, 138 Interface Structure, 138 Device I/O, overview, 137 Device Path for IDE disk, 339...
  • Page 489 EFI Directory Structure, 306 EFI Driver, 110, 305 EFI Driver, definition of, 363 EFI File, definition of, 363 EFI Image, 105, 109, 305 EFI Image handoff state IA-32, 115 Itanium-based, 116 overview, 111 EFI Image Header, 109 PE32+ image format, 109 EFI Image, definition of, 365 EFI OS Loader, 110, 305 EFI OS loader, definition of, 363...
  • Page 490 Extensible Firmware Interface Specification Image Services (cont.) StartImage(), 71 UnloadImage(), 72 overview, 67 images, loading, 13 implementation requirements general, 21 optional elements, 22 required elements, 21, 23 information, resources, 6 Intel Architecture Platform Architecture, definition of, 366 interfaces general categories, 15...
  • Page 491 PCANSI terminals, and SIMPLE_TEXT_OUTPUT, 334 PCI Expansion ROM, 327 driver for EFI, 329 image types, 329 PCI Expansion ROM Header EFI, 328 standard, 327 PE32+ image format, 109 plug and play option ROMs and boot services, 14 PMBR. See Protective MBR prerequisite specifications, 8 Protective MBR, 316 Protocol...
  • Page 492 Extensible Firmware Interface Specification Simple File System Protocol, 187 functions OpenVolume(), 189 GUID, 187 Interface Structure, 187 Revision Number, 187 Simple Input Protocol, 152, 154 Functions ReadDisk(), 155 ReadKeyStroke(), 156 GUID, 154 Interface Structure, 154 Scan Codes for, 152 Simple Network Protocol, 235, 246, 277...
  • Page 493 UNDI Specification, 32/64-Bit, 373 Unicode Collation Protocol, 225 Functions FatToStr(), 232 MetaiMatch(), 228 StriColl(), 227 StrLwr(), 230 StrToFat(), 233 StrUpr(), 231 GUID, 225 Interface Structure, 225 Unicode control characters, supported, 152 Unicode, definition of, 372 Variable Services function list, 77 functions GetNextVariableName(), 80 GetVariable(), 78...
  • Page 494 Extensible Firmware Interface Specification 12/12/00 Version 1.02...

Table of Contents