OS/2 Initialization
OS/2 requires a PSD for system initialization. The system will display an
error message if a valid PSD for the current platform cannot be installed.
The following is a list of steps, in the order in which they occur, that
are executed after a PSD is installed. If any step does not complete successfully,
the system initialization process will stop, and a fatal error message will
be displayed.
After a PSD is successfully installed, its Init
function is invoked. This function is used to allocate and initialize any
resources that the PSD may require, as well as initializing the state of
the hardware.
The kernel determines the number of usable processors
on the current platform by using the PSD_GET_NUM_OF_PROCS function.
The kernel allocates all resources required to
support the additional processors. This step determines what to allocate
based on the results of the previous step.
The PSD's processor initialization function is
invoked on the current processor (CPU0).
An MP daemon is created for CPU0. An MP daemon
is a thread that never goes away, which is used for MP operations by a specific
processor.
An MP daemon is created for the next logical
processor.
The PSD's start processor call is invoked to
start the next logical processor. The PSD should only start the specified
processor, and then return (see the PSD_START_PROC function for more detail).
The started processor will spin in a tight loop waiting for a variable to
be cleared. This variable is referred to as the processor initialization
real mode spinlock.
Upon return from the PSD's start processor call,
the processor initialization real mode spinlock is cleared.
CPU0 will spin in a tight loop waiting for a
variable to be cleared. This variable is referred to as the CPU0 spinlock.
10.
The started processor continues execution of the
kernel's real mode processor initialization code now that processor's initialization
real mode spinlock has been cleared.
11.
The
started processor sets up all protect mode and paging information, and switches
into protect mode with paging enabled.
12.
Up
to this point, the started processor has been running on a small processor
initialization stack (It has not been running as an OS/2 thread). The current
context is switched to that of this processors MP daemon.
13.
OS/2
calls the PSD's processor initialization function for the current processor.
14.
The PSD indicates that
the processor has been initialized.
15.
The
started processor will spin in a tight loop waiting for a variable to be
cleared. This variable is referred to as the processor initialization protect
mode spinlock.
16.
The CPU0
spinlock is cleared.
17.
System
initialization continues on CPU0 now that its spinlock has been cleared.
18.
Steps 6, through 17 are
repeated until all processors have been started.
19.
The
rest of system initialization continues normally, on CPU0.
20.
After
the system is fully initialized, the processor initialization protect mode
spinlock is cleared. This allows CPU1 through CPU-N to start executing code.
[Back: Platform Specific Driver Architecture and Structure]
[Next: PSD Function Glossary]