Services
Version 1.02 12/12/00 67
3.4 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

firmwares loader. Table 3-8 summarizes the differences between images.

Table 3-8. Image Type Differences Summary

EFI Application EFI Boot Services Driver EFI Runtime Services Driver
Description A transient application
that is loaded during boot
services time. EFI
applications are either
unloaded when they
complete, or they take
responsibility for the
continued operation of the
system via
ExitBootServices().
The applications are
loaded in sequential order
by the boot manager, but
one application may
dynamically load another.
A program that is loaded into boot
services memory and stays resident
until boot services terminates.
A program that is loaded into
runtime services memory and
stays resident during runtime. The
memory required for a Runtime
Services Driver must be performed
in a single memory allocation, and
marked as
EfiRuntimeServicesData. (Note
that the memory only stays
resident when booting an EFI-
compatible operating system.
Legacy operating systems will
reuse the memory.)
Loaded into
memory type
EfiLoaderCode,
EfiLoaderData
EfiBootServicesCode,
EfiBootServicesData
EfiRuntimeServicesCode,
EfiRuntimeServicesData
Default pool
allocations
from memory
type
EfiLoaderData EfiBootServicesData EfiRuntimeServicesData
Exit
behaviour
When an application
exits, firmware frees the
memory used to hold its
image.
When a boot services driver exits with
an error code, firmware frees the
memory used to hold its image.
When a boot services drivers entry
point completes with EFI_SUCCESS,
the image is retained in memory.
When a runtime services driver
exits with an error code, firmware
frees the memory used to hold its
image.
When a runtime services drivers
entry point completes with
EFI_SUCCESS, the image is
retained in memory.
Notes This type of image would
not install any protocol
interfaces or handles.
This type of image would typically use
InstallProtocolInterface().
A runtime driver can only allocate
runtime memory during boot
services time. Due to the
complexity of performing a virtual
relocation for a runtime image, this
driver type is discouraged unless it
is absolutely required.