Specifications

6
Components of CSM
The CSM code consists of the following six main components or functional areas:
EFI Compatibility Support Module initialization code
A set of modules to initialize the CSM data structures and the traditional Post
Memory Manager (PMM).
Dispatching traditional OpROMs:
A set of EfiCompatibility
drivers to simulate traditional INTs, and code to
place traditional OpROMs within the traditional OpROM memory region and
invoke the OpROMs.
Translating traditional devices into CSM structures and updating traditional
tables:
A set of Compatibility16 functions to extract data from EFI and then convert
the extracted data into standard Compatibility16 data structures.
Booting the OS:
A set of EfiCompatibility
procedures to boot a traditional OS or boot an EFI-
aware OS off a device controller by using a traditional OpROM.
Thunk and reverse thunk code:
There are two flavors of the thunk
code; Far call and Interrupt (INT). Both of
these internally are assembly-based calls rather than C-based calls but
externally are C-based. The thunk provides a mechanism to transfer control
from EFI to 16-bit traditional code and return to EFI after completion. The
reverse thunk provides a mechanism to transfer from 16-bit traditional code
to 32-bit EFI code and return after completion. It is expected that the
reverse thunk will be invoked only in exceptional conditions.
Runtime traditional code provided by an IBV:
Consists of the following:
The Compatibility16 runtime code
Traditional SMM code residing with EFI SMM code
EfiCompatibility
platform protocol internals
2.4 CSM Architecture
Overview
The CSM provides additional functionality to EFI. This additional functionality permits the
loading of a traditional OS or the use of a traditional OpROM. This new functionality
requires the following:
New 32-bit code that operates in the EFI environment (EfiCompatibility)
A stripped-down traditional 16-bit real-mode BIOS (Compatibility16)
Code to transition between the 32-bit and 16-bit code (thunk and reverse
thunk)
Optionally code in SMM (CompatibilitySmm) to perform traditional functions
not taken over by EFI SMM