Re: Safe Mode Problem



Oldster wrote:

As a subsiduary question... How does windows know which drivers to load in "safe" mode?

It gets the information from the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot Registry key**. Also, before the kernel reads that key ntldr reads the registry looking for device drivers with a start value of 0, telling it (ntldr) that the device driver is to be loaded at boot time, typically these are low level hardware device drivers, things like the keyboard, mouse, disk and controller drivers, etc. The drivers with a start value of 0 are "loaded" by ntldr but they are "started" by the kernel.

** The HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot does not exist when the computer is shut down, this key is created form one of the numbered Control Sets when Windows is booted, so when booting to Safe Mode the information will actually be retrieved from one of the numbered Control Sets. We usually say that the information is obtained from the Current Control Set because the information in the numbered Control Set will be identical and it is easier for users to look at the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet to get the information accurately, otherwise the HKEY_LOCAL_MACHINE\SYSTEM\Select key has to be consulted to obtain the proper Control Set, see below for explanations about the Select key.


> Or, for that matter,in "last good" mode?

When you boot the computer and select a boot option ntldr reads the HKEY_LOCAL_MACHINE\SYSTEM\Select key to determine which Control Set it should load. The Select key contains the following values:

Current
Default
Failed
LastKnownGood

These values typically contains data as shown here:

"Current"=dword:00000001
"Default"=dword:00000001
"Failed"=dword:00000000
"LastKnownGood"=dword:00000002

The data may be different, if you have had failed boots you may have different numbers (like 00000003) and the numbers assigned to the values may be different than shown above. These numbers tell ntldr which Control Set to load, the Control Sets are also held in the HKEY_LOCAL_MACHINE\SYSTEM key, typically:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002

When you boot the computer normally ntldr looks for the "Default" value and loads the Control Set assigned to it, in the above example it would load HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001, if you boot to Last Known Good ntldr looks at, of course, the "LastKnownGood" value and loads the corresponding Control Set.

The Last Known Good set is only copied and recorded after a user successfully logs on. In the above example, if you boot normally, Windows will be booted using ControlSet001, after a user successfully logs on the ControlSet001 will be copied to ControlSet002 and the control set number will be recorded in the Select key. The value of the Select key and the ControlSetnnn of the "LastKnownGood" configuration will not change until the next successful logon. Booting successfully to Safe Mode does not change the "LastKnownGood" Control Set, in only changes when booting Windows normally.

John
.



Relevant Pages

  • Re: How to make "last known good boot" the default boot?
    ... Ok here are my registry dword values after I booted to the LastKnownGood ... load, NOT the default load. ... You can't set the computer to always boot to the Last Known Good ... try advanced techiques you could try changing the Control Set numbers at ...
    (microsoft.public.windowsxp.basics)
  • Re: XP installation/multiboot problem
    ... boot files don't have to be in the same partition or in the same ... mention (boot.ini, ntldr, ntdetect.com) have to be on the 2nd HD. ... positions just under the root of the D: partition as they had been ... The new OS should load. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: How to make "last known good boot" the default boot?
    ... You can't set the computer to always boot to the Last Known Good ... try advanced techiques you could try changing the Control Set numbers at ... should load. ... Windows will be booted using ControlSet001, ...
    (microsoft.public.windowsxp.basics)
  • Re: Safe Mode Problem
    ... Also, before the kernel reads that key ntldr reads the registry looking for device drivers with a start value of 0, telling it that the device driver is to be loaded at boot time, typically these are low level hardware device drivers, things like the keyboard, mouse, disk and controller drivers, etc. ... We usually say that the information is obtained from the Current Control Set because the information in the numbered Control Set will be identical and it is easier for users to look at the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet to get the information accurately, otherwise the HKEY_LOCAL_MACHINE\SYSTEM\Select key has to be consulted to obtain the proper Control Set, see below for explanations about the Select key. ... When you boot the computer and select a boot option ntldr reads the HKEY_LOCAL_MACHINE\SYSTEM\Select key to determine which Control Set it should load. ...
    (microsoft.public.windowsxp.basics)
  • Re: Safe Mode Problem
    ... before the kernel reads that key ntldr reads the registry ... Current Control Set because the information in the numbered Control Set ... When you boot the computer and select a boot option ntldr reads the ... should load. ...
    (microsoft.public.windowsxp.basics)