Status codes returned – Intel Extensible Firmware Interface User Manual

Page 80

Advertising
background image

Extensible Firmware Interface Specification

4-2

12/01/02

Version 1.10

The first argument is the image’s image handle. The second argument is a pointer to the image’s
system table. The system table contains the standard output and input handles, plus pointers to the

EFI_BOOT_SERVICES

and

EFI_RUNTIME_SERVICES

tables. The service tables contain the

entry points in the firmware for accessing the core EFI system functionality. The handles in the
system table are used to obtain basic access to the console. In addition, the EFI system table
contains pointers to other standard tables that a loaded image may use if the associated pointers are
initialized to nonzero values. Examples of such tables are ACPI, SMBIOS, SAL System Table, etc.

The

ImageHandle

is a firmware-allocated handle that is used to identify the image on various

functions. The handle also supports one or more protocols that the image can use. All images
support the

EFI_LOADED_IMAGE

protocol that returns the source location of the image, the

memory location of the image, the load options for the image, etc. The exact

EFI_LOADED_IMAGE

structure is defined in Chapter 7.

If the EFI image is an EFI Application, then the EFI Application executes and either returns or calls
the EFI Boot Services

Exit()

. An EFI Application is always unloaded from memory when it

exits, and its return status is returned to the component that started the EFI Application.

If the EFI image is an EFI OS Loader, then the EFI OS Loader executes and either returns, calls the
EFI Boot Service

Exit(),

or calls the EFI Boot Service

ExitBootServices()

. If the EFI

OS Loader returns or calls

Exit()

, then the load of the OS has failed, and the EFI OS Loader is

unloaded from memory and control is returned to the component that attempted to boot the EFI OS
Loader. If

ExitBootServices()

is called, then the OS Loader has taken control of the

platform, and EFI will not regain control of the system until the platform is reset. One method of
resetting the platform is through the EFI Runtime Service

ResetSystem()

.

If the EFI image is an EFI Driver, then the EFI Driver executes and either returns or calls the EFI
Boot Service

Exit()

. If an EFI driver returns an error, then the driver is unloaded from memory.

If the EFI driver returns

EFI_SUCCESS

, then it stays resident in memory. If the EFI Driver does

not follow the EFI Driver Model, then it performs any required initialization and installs its
protocol services before returning. If the EFI driver does follow the EFI Driver Model, then the
entry point is not allowed to touch any device hardware. Instead, the entry point is required to
create and install the

EFI_DRIVER_BINDING_PROTOCOL

(Chapter 9) on the

ImageHandle

of the EFI Driver. If this process is completed, then

EFI_SUCCESS

is returned. If the resources

are not available to complete the driver initialization, then

EFI_OUT_OF_RESOURCES

is returned.

Status Codes Returned

EFI_SUCCESS

The driver was initialized

.

EFI_OUT_OF_RESOURCES

The request could not be completed due to a lack of resources.

Advertising