On x86 platforms, the machine hardware is initialized at boot time by the NTLDR. To initialize the video hardware, NTLDR makes a BIOS call to set the video adapter in 80x50, 16-color, alphanumeric mode. It then clears the screen and displays the Boot Manager messages.
On RISC platforms, the entire machine, including video hardware, is
initialized by the OSLOADER, which programs an appropriate alphanumeric
mode to display the Boot Manager information.
After the operating system and boot drivers are loaded from the disk into memory by NTLDR or OSLOADER, control is passed to the Windows NT Executive.
The HAL is an Executive component that exports the platform-specific functionality. It supports limited output functionality to allow the Kernel to display informational and error messages as other components of the kernel-mode Executive are initialized.
The NTLDR’s initial BIOS call is made in x86 real mode.
HAL support for video output also is necessary if the machine crashes.
The HAL can be called by the Kernel to reinitialize the video adapter to
an alphanumeric mode and to display information, such as a register dump
and stack backtrace.
The Registry’s System hive, which is visible to users under the HKEY_LOCAL_MACHINE tree after the system is running, determines the load order of all drivers in the system. The NTLDR or OSLOADER and the I/O Manager both access the contents of the System hive to determine which drivers should be loaded and when each driver should be initialized.
Each driver key under the registry node HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services has a value entry named Start. The value assigned to Start determines when any particular driver is loaded during the system initialization process.
When each driver is loaded, its DriverEntry routine is automatically called by the I/O Manager.
For each device object created, a driver may create a corresponding value entry with a name that is the same as the device object in the registry under HKEY_LOCAL_MACHINE\Hardware\DeviceMap.
Both the created value entry in the registry DeviceMap and the symbolic
link are volatile: each is regenerated automatically every time the machine
is booted, based on the drivers that were initialized by the I/O Manager.
Both are logical names representing a device in the machine.
In this phase of initialization the Service Control Manager will proceed to load any remaining drivers that have a Start value of 2. These drivers will be displayed in the control panel applet as being started automatically. These drivers are loaded in order by load order group, if specified, and then all remaining drivers will be loaded alphabetically.
The first driver to claim a device obtains ownership of that device, either shared or exclusive.
Driver load order is determined by entries in the \Machine\System\CurrentControlSet key in the registry. This key has a Control subkey containing system-wide information and a Services subkey containing driver-specific information.
During system initialization, when a driver is loaded depends on the following characteristics:
\Machine\System\CurrentControlSet\Control\ServiceGroupOrder contains a list of the driver load service groups. The list is scanned twice. First, all drivers with start value SERVICE_BOOT_START are loaded; then all drivers with start value SERVICE_SYSTEM_START are loaded.
If a driver is a member of a load service group, the group name is listed in the driver’s services subkey in the registry (\Machine\Hardware\System\CurrentControlSet\Services\DriverName\Group).
After all ServiceGroupOrder groups of a given Start value have been loaded, the system loads all groups not in the list and then all drivers without a group.
Load Order Within a Group
Drivers that are in a load group and have a start value of SERVICE_BOOT_START
or SERVICE_SYSTEM_START can use tags to indicate their load order within
the group.
The registry key \Machine\Hardware\System\CurrentControlSet\Control\GroupOrderList defines the number of tags in each group and the order in which tagged drivers are loaded within a group.
Drivers without a tag are loaded last in their group.
Not every group is included in the GroupOrderList. When a group is not in the GroupOrderList, the order in which the drivers load within the group cannot be guaranteed.
Dependencies
Prerequisite drivers are listed in a driver’s services subkey in the
DependOnGroup and DependOnService entries.
Defining Driver Load Order for New Drivers
To define the load order for a new driver, assign the driver a start
value, a service group (optional), a group tag (optional), and prerequisite
drivers (optional).
The start value must be one of the system-defined SERVICE_xxx values.
The service group can be an existing system-defined group or a new group. If you define a new group, add it to \Machine\System\CurrentControlSet\Control\ServiceGroupOrder. Note that ServiceGroupOrder is reset during a system upgrade, so drivers that modify this registry key may need to be reinstalled after an upgrade.
Use an existing group tag, or define a new one in \Machine\System\CurrentControlSet\Control\GroupOrderList.
List prerequisite drivers in DependOnGroup and DependOnService in the driver’s services key.
A driver writer can modify the registry using routines, INF files, or
the Windows NT registry editor (regedt32). During driver development it
may be convenient to edit the registry manually with the registry editor.
When the driver is nearing completion, it is best for the driver to make
any necessary registry changes using routines (RtlCreateRegistryKey and
RtlWriteRegistryValue) or through the driver’s INF file.
At starting when you see the prompt 'Press spacebar NOW to invoke Hardware Profile/Last Known Good', press Spacebar and you will see the Hardware Profile/Configuration Recovery Menu. If you press L, you will switch to the Last Known Good configuration. You can switch back to the default by pressing D. Hit Enter, and NT should load.