Windows NT Technical Support
Chapter 17
The Windows NT Boot Process
In this chapter we’ll take a look at the mysteries of the computer’s startup sequence and the NT bootup process. We’ll see how its supposed to work, and some of the things that can go wrong too.
When a Windows NT computer starts up, it goes through five “phases”:
The processes are a little different between x86 type computers and RISC (mostly Alpha AXP processor) computers. I will focus on the Intel x86 computers, although you might come into contact with RISC computers in the future, so keep the location of this material in mind so that you know where to look it up if you need to in the future.
What are the required files in order to boot up successfully?
What are these files for?
First, what happens before the Windows NT Boot sequence?
The NT Boot Sequence begins after the loading of Ntldr into memory
After completing the boot sequence, we are now ready for loading the operating system. The loading of the NT operating system is called the “load phase”.
The Load Phase has five steps:
During the Kernel Load Phase, the ntoskrnl.exe is loaded, and then the HAL is loaded, and finally the system hive is loaded. The system hive contains information regarding which drivers and services should be started. This is taking place while you’re watch the “black dot screen”. If you want to see which drivers are actually loading, you can put the /sos switch at the end of the OS line for the particular operating system in the boot.ini file.
During this phase, the loaded drivers and services are initialized (started). This is the “blue dot screen”. The CurrentControlSet is saved (a “control set” is a list of device drivers and services to load). The registry hardware list is created during this phase as well.
What happens if one of the drivers is bad and doesn’t load or initial correctly? Sometimes you can start the computer, and sometimes you’re stuck with the dreaded BSOD with no one to hear your screams. Well, what happens is determined by an “error control value” given to each driver. Depending on the error control level assigned to the driver, you might be able to start the computer or not:
The Session Manager starts up now. The Session Manager will start the higher order substystem and services. The Session Manager will carry out instructions in these 4 registry entries:
The BootExecute Data Item will run programs automatically at startup. An example is the Autochk.exe program. You can add other programs or alter the way these programs run from within this registry key.
The Memory Management Key controls how memory will be managed for the operating system. One of the things it does is create the pagefile for virtual memory.
The DOS Devices Key converts DOS hardware calls into NT hardware calls. For example, the PRN command in DOS sends jobs directory to the printer by accessing the hardware. HAL would not be happy. So, this key redirects the print job to LPT1 which is managed by HAL
The Subsystems Key starts the required subsystems. By default, only the Win32 subsystem is required.
Remember that the Win32 subsystem is responsible for programs that are written in DOS, Win 3.x, Win95, and Windows NT. When the Win32 subsystem starts it also starts the winlogon.exe process, which then starts up the lsass.exe (local security authority subsystem).
Then, the Service Controller is started (screg.exe). The Service controller takes another look at the registry and looks for services that are marked to load automatically (you control that process in the services applet in the control panel). These services are now started up.
The boot is completed and considered good when only when the user actually logs on.
Given how complicated this is, you can imagine that a lot of things can go bad along the way.
BOOT:
Couldn’t find NTLDR
Please
insert another disk
You’ll see this is the ntldr file is missing. Do a repair process for the startup environment and it will fix this.
NTDETECT
V4.0 Checking Hardware…
NTDETECT
failed
You’ll see this one if ntdetect.com is missing. Again, do a repair process for the startup environment and it will fix this
Windows
NT could not start because the following file is missing or corrupt:
\winnt
root\system32\ntoskrnl.exe
Please
re-install a cpy of the above file.
You’ll see this is the ntoskrnl.exe is corrupt or missing, but really, this isn’t the case very often. More likely, your boot.ini isn’t pointing to the boot partition. Fix it!
I/O
Error accessing boot sector file
Multi(0)disk(0)rdisk(0)partition(1):\bootss
This nasty shows up when your bootsect.dos file gets whacked. Fix this by doing a repair process for the startup environment.
OS
Loader V4.0
Windows
NT could not start ecause of a computer disk hardware configuration problem.
Could
not read from the selected boot disk.
Check boot path and disk hardware.
Please
check the Windows NT documentation bout hardware disk configuration and your
hardware reference manuals for additional information.
What
this is trying to tell you is that it can’t find the disk that the boot
partition is on. This is usually from
the disk either being dead or asleep or not plugged into the drive controller. Fix it.
What do you do when the boot process goes haywire and you just want to get the machine started without having to go through the repair process? A quick fix is to create an NT boot disk. However, the process of creating an NT boot disk is completely different then creating a DOS boot disk.
How do you make one?
The last known configuration was put there so that you can get out of jams you might have got yourself into when you’ve junked up the registry or installed a device driver that’s lame.
Whenever a user successfully logs on, the control set is saved. Now, if the user goes in and makes changes to the registry or adds or removes drivers, the control set that was there when the user logged on (a good one we assume), is safe and sound, unaffected by the changes that are made, which are saved in the “CurrentControlSet” registry key.
When you start your computer you have the option of choosing either:
So, if you’ve made registry changes or added or removed drivers during your last session, and now you can’t boot up, try using the Last Known Good configuration. That will “undo” everything you did AFTER the last time you logged on, and start you up with the same control set you have when you successfully logged on.
Now, if you think that you’ve messed up, but you get to the log on screen. DON’T LOG ON! Because once you log on, the system thinks that was a good configuration, and will save it as a Last Known Good configuration, even if you are not sure its completely good.
You might use the LKG configuration when you’ve installed a new video driver and it whacks your display. That will return the system to using the old video driver, and then you can see again.
The LKG configuration will NOT help you if there is a problem with the hardware itself. For example, you have installed a new video card and its no good. Using the LKG configuration will be of no help to you here, but the hardware is broken, and not too many software programs can fix broken hardware.
You should ALWAYS first try the LKG before doing the repair process. Mostly because its faster and easier, and if it works, you’ve saved yourself a lot of time. However, if the LKG doesn’t pull you through, you’ll have to move next to the Repair Process.
The Emergency Repair Process can save you from a multitude of sins. It can repair the registry and restore or fix important operating system files.
Where does the Repair Process get the information it needs to carry out the repair? From one of two places:
How do you get information to put on a ERD (emergency repair disk) or the repair folder?
You have to run the RDISK.exe program. When you run RDISK, it will place registry key and startup information in the repair folder or the ERD or both. Every time you make an important system configuration change you should make a new ERD. DO NOT WRITE OVER THE OLD ONE. You should keep the old ERDs in case you want to “rollback” to a previous configuration for some reason. (like the last configuration change was no good, but you did an RDISK before you knew it was no good).
When you create an ERD, it will format the disk first, so make sure you don’t need anything on it, It does this to make sure there aren’t any nasty things on there like viruses.
Also, if you don’t want to type 20,000 user accounts all over again, run the RDISK command with the /s switch. The /s switch will save security information too.
So, it’s broken, but you have done an RDISK recently, so you know you can get your stuff back. How?
Now, the repair process will allow you to fix different things: