Boot Configuration
Controlling Windows 7 Boot Options
Contents
With Vista, Microsoft changed the mechanism for configuring bootup. The traditional boot.ini file, was replaced with a Boot Configuration Datastore or BCD. The BCD is configured using the command-line tool bcdedit.
bcdedit needs to be run with elevated priviledges.
BCDedit Examples
Top Bottom- bcdedit
- lists current datastore settings - same as "bcdedit /enum"
- bcdedit /copy {current} /d "Windows Vista Alternate Boot"
- copies the current boot configuration to a new entry named "Windows Vista Alternate Boot"
- bcdedit /set {configname} systemroot windowsvista
- change value for systemroot in {configname} to "windowsvista". Can be used to change values of any field listed by "bcdedit /enum"
- bcdedit /set {configname} removememory 256
- reduces total memory available to {configname by 256MB
- bcdedit /set /bootsequence {configname}
- makes {configname} the default boot configuration for the next boot only. Useful if you wish to try a change and then revert back to the original configuration on next boot
- bcdedit /default {configname}
- permanently change the default boot configuration
- bcdedit /timeout 15
- change the boot menu timeout to 15 seconds. Turns on the boot menu even if BCD has only one entry. Useful for buying time to reach recovery console.
- bcdedit /export c:\exportfolder\exportfilename
- export current configuration to "exportfilename" for backup purposes
- bcdedit /import c:\exportfolder\exportfilename
- restores BCD from backup file
- bcdedit /set {configname} debug on
- turns on kernel debugger for {configname}
- restore the boot menu option for an existing Windows XP installation
- bcdedit /create {ntldr} -d "Menu Description"
Recovery Console
Top BottomReached by pressing "F8" as boot configuration is loaded
System Boot Sequence
Top BottomThe startup process with Windows 7 runs as follows:
- When the machine is powered on it performs a Power-On Self-Test (POST)
- The BIOS reads the MBR of the boot device, and transfers control to the MBR
- The MBR reads the boot sector which contains the code to start Bootmgr
- Bootmgr reads the content of the BCD to build and display the Boot Menu
- If the current Windows 7 installation is selected, Bootmgr starts Winload.exe found in %SYSTEMROOT%\system32
- Winload.exe starts by loading Ntoskrnl.exe and Hal.dll
- Registry settings are read
- Drivers are loaded
- Smss.exe is started
- Smss.exe starts Wininit.exe
- Wininit.exe starts Lsass.exe and Services.exe
- The logon screen is displayed
If you choose to resume from hibernation, Bootmgr loads Winresume.exe at step 5 to restore the systems state prior to hibernation.
Each time you install a Windows operating system it rewrites the MBR to call it's own bootloader. To restore the Windows 7 bootloader to the MBR, insert the Windows 7 DVD and run:
d:\boot\ bootsect.exe /nt60 all
