10
data structures. That data is used to update standard traditional data values in the BDA,
EBDA, and CMOS. The data is also used by Legacy BIOS Protocol APIs to reprogram
traditional devices to traditional resources.
Compatibility16 does not configure low-level device hardware and instead leaves that
operation to EFI. EFI does not assign IRQs to devices such as serial ports, but
Compatibility16 requires them to be configured with the appropriate IRQs. The
LegacyBios code must reconfigure any traditional devices that were configured by EFI
into a valid Compatibility16 configuration.
It is expected that there will be a light and full version of the Legacy BIOS Protocol. The
light version is for environments where the OS is always an EFI-aware OS that might
have traditional OpROMS. The full version is for environments where a traditional OS
might be invoked.
2.4.2.1.2 Legacy BIOS Protocol
The Legacy BIOS Protocol, along with the initialization of the LegacyBios driver, provides
the foundation of the CSM code. The table below lists the functions that are included in
the Legacy BIOS Protocol. See EFI_LEGACY_BIOS_PROTOCOL in Code Definitions
for the definitions of these functions.
Table 3 Functions in Legacy BIOS Protocol
Functions Description
BootUnconventionalDevice() Allows the user to boot off of an unconventional device such as a
PARTIES partition.
CheckPciRom() Checks if a device has a traditional OpROM associated with it. It is used
to determine valid traditional OS boot devices, or if a traditional OpROM
exists for a device that has no EFI OpROM support.
CopyLegacyRegion() Allows EFI to copy data to the area specified by
GetLegacyRegion(). It may be invoked multiple times. This
function performs boundary checking via information passed into
GetLegacyRegion().
FarCall86() Allows the 32-bit protected-mode code to perform a far call to 16-bit
real-mode code. It is analogous to the
Int86() function, but a far
call is patched instead.
GetBbsInfo() Allows external drivers to access the internal EfiCompatibility BBS data
structures. This function is normally used by BIOS Setup.
GetLegacyRegion() Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block. This
function may be invoked only once.
Int86() Allows the 32-bit protected-mode code to perform a traditional 16-bit
real-mode software interrupt. The function invokes the thunk code to
switch to 16-bit real mode, patches an INT instruction with the required
software interrupt, loads the IA-32 registers from data in the passed-in
register file, and issues the software interrupt. Upon completion of the
interrupt, it updates the register file and switches back to 32-bit
protected mode.
InstallPciRom() Installs a traditional OpROM in the 0xC0000 to 0xFFFFF region.
LegacyBoot() Initiates booting from a traditional OS. The majority of the CSM work is
done within this function, because the final commitment to boot from a
traditional OS has been made and the boot process will destroy EFI
code. This function returns to the caller only in the exceptional condition
in which a traditional INT19 failed but control was never passed to an
OS first-stage loader. If control was ever passed to an OS first-stage
loader, then the Compatibility16 code must issue a reset, because
memory may have been written over and EFI corrupted.