Version 1.02 12/12/00 25
3Services
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.
Two types of services are described here:
Boot Services. Functions that are available before a successful call to
ExitBootServices().
Runtime Services. Functions that are available before and after any call to
ExitBootServices().
During boot, system resources are owned by the firmware and are controlled through boot services
interface functions. These functions can be characterized as “global” or ‘handle-based”. The term
“global” simply means that a function accesses system services and is available on all platforms
(since all platforms support all system services). The term “handle-based” means that the function
accesses a specific device or device functionality and may not be available on some platforms
(since some devices are not available on some platforms). Protocols are created dynamically. This
chapter discusses the “global” functions and runtime functions; subsequent chapters discuss the
"handle-based".
EFI applications (including OS loaders) must use boot services functions to access devices and
allocate memory. On entry, an EFI Image is provided a pointer to an EFI system table which
contains the Boot Services dispatch table and the default handles for accessing the console. All
boot services functionality is available until an EFI OS loader loads enough of its own environment
to take control of the system’s continued operation and then terminates boot services with a call to
ExitBootServices().
In principle, the ExitBootServices() call is intended for use by the operating system to
indicate that its loader is ready to assume control of the platform and all platform resource
management. Thus boot services are available up to this point to assist the OS loader in preparing
to boot the operating system. Once the OS loader takes control of the system and completes the
operating system boot process, only runtime services may be called. Code other than the OS
loader, however, may or may not choose to call ExitBootServices(). This choice may in
part depend upon whether or not such code is designed to make continued use of EFI boot services
or the boot services environment.