Computer Technos

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 15 August 2010

Troubleshooting Boot and Startup Problems - Driver Loading in Safe Mode

Posted on 10:04 by Unknown
How does Windows know which device drivers and services are part of standard and networking-enabled safe mode? The answer lies in the HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot registry key. This key contains the Minimal and Network subkeys. Each subkey contains more subkeys that specify the names of device drivers or services or of groups of drivers. For example, the vga.sys subkey identifies the VGA display device driver that the startup configuration includes. The VGA display driver provides basic graphics services for any PC-compatible display adapter. The system uses this driver as the safe-mode display driver in lieu of a driver that might take advantage of an adapter’s advanced hardware features but that might also prevent the system from booting. Each subkey under the SafeBoot key has a default value that describes what the subkey identifies; the vga.sys subkey’s default value is “Driver”.

The Boot file system subkey has as its default value “Driver Group”. When developers design a device driver’s installation script, they can specify that the device driver belongs to a driver group. The driver groups that a system defines are listed in the List value of the HKLM\ SYSTEM\CurrentControlSet\Control\ServiceGroupOrder key. A developer specifies a driver as a member of a group to indicate to Windows at what point during the boot process the driver should start. The ServiceGroupOrder key’s primary purpose is to define the order in which driver groups load; some driver types must load either before or after other driver types. The Group value beneath a driver’s configuration registry key associates the driver with a group.

Driver and service configuration keys reside beneath HKLM\SYSTEM\CurrentControlSet\Services. If you look under this key, you’ll find the VgaSave key for the VGA display device driver, which you can see in the registry is a member of the Video Save group. Any file system drivers that Windows requires for access to the Windows system drive are automatically loaded as if part of the Boot file system group. Other file system drivers are part of the File system group, which the standard and networking-enabled safe-mode configurations also include.

When you boot into a safe-mode configuration, the boot loader (Winload) passes an associated switch to the kernel (Ntoskrnl.exe) as a command-line parameter, along with any switches you’ve specified in the BCD for the installation you’re booting. If you boot into any safe mode, Winload sets the safeboot BCD option with a value describing the type of safe mode you select. For standard safe mode, Winload sets minimal, and for networking-enabled safe mode, it adds network. Winload adds minimal and sets safebootalternateshell for safe mode with command prompt and dsrepair for Directory Services Restore mode.

The Windows kernel scans boot parameters in search of the safe-mode switches early during the boot, during the InitSafeBoot function, and sets the internal variable InitSafeBootMode to a value that reflects the switches the kernel finds. The kernel writes the InitSafeBootMode value to the registry value HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Option\OptionValue so that user-mode components, such as the SCM, can determine what boot mode the system is in. In addition, if the system is booting in safe mode with command prompt, the kernel sets the HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Option\UseAlternateShell value to 1. The kernel records the parameters that Winload passes to it in the value HKLM\SYSTEM\CurrentControlSet\Control\SystemStartOptions.

When the I/O manager kernel subsystem loads device drivers that HKLM\SYSTEM\CurrentControlSet\Services specifies, the I/O manager executes the function IopLoadDriver. When the Plug and Play manager detects a new device and wants to dynamically load the device driver for the detected device, the Plug and Play manager executes the function PipCallDriverAddDevice. Both these functions call the function IopSafebootDriverLoad before they load the driver in question. IopSafebootDriverLoad checks the value of InitSafeBootMode and determines whether the driver should load. For example, if the system boots in standard safe mode, IopSafebootDriverLoad looks for the driver’s group, if the driver has one, under the Minimal subkey. If IopSafebootDriverLoad finds the driver’s group listed, IopSafebootDriverLoad indicates to its caller that the driver can load. Otherwise, IopSafebootDriverLoad looks for the driver’s name under the Minimal subkey. If the driver’s name is listed as a subkey, the driver can load. If IopSafebootDriverLoad can’t find the driver group or driver name subkeys, the driver can’t load. If the system boots in networkingenabled safe mode, IopSafebootDriverLoad performs the searches on the Network subkey. If the system doesn’t boot in safe mode, IopSafebootDriverLoad lets all drivers load.

An exception exists regarding the drivers that safe mode excludes from a boot: Winload, rather than the kernel, loads any drivers with a Start value of 0 in their registry key, which specifies loading the drivers at boot time. Winload doesn’t check the SafeBoot registry key because it assumes that any driver with a Start value of 0 is required for the system to boot successfully. Because Winload doesn’t check the SafeBoot registry key to identify which drivers to load, Winload loads all boot-start drivers (and later Ntoskrnl starts them).

Source of Information : Microsoft Press Windows Internals 5th Edition
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Windows | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Windows 7 Shortcut Keys
    Longtime users of Windows have probably grown accustomed to navigating around the Windows user interface using the keyboard. This especially...
  • Windows on Mac: Virtualization Solutions
    If you’d prefer to join the ever-increasing ranks of Mac switchers—you traitor, you—you can still run Windows and, more important, Windows a...
  • Customizing Library Folders in Windows 7
    In your library folders, you can customize view options based on the contents. In the toolbar of the Pictures and Music library folders, Win...
  • Windows 7 BitLocker Drive Encryption
    In Windows Vista, you had the BitLocker Drive Encryption feature that allowed you to encrypt the content of entire volumes. In Windows 7, Mi...
  • Using Windows 7’s Performance Options
    While all the performance tools are available individually throughout the system, Windows 7 introduces a nice list of available tools, if yo...
  • Windows 7 - Installing and Configuring a Printer
    If your printer is already installed and operational at this point, you can skip this section and skim ahead for others that may be of inter...
  • Considering Centralized versus Group Sharing
    One of the most important preparation steps for your server is determining how to store the data you create. The two common methods are cent...
  • Berkeley Motes
    The Berkeley motes are a family of embedded sensor nodes sharing roughly the same architecture. Let us take the MICA mote as an example. The...
  • Using Windows 7 Ease of Access Tools
    If you have difficulty using a mouse or typing, have slightly impaired vision, or are deaf or hard of hearing, you can adjust the appearance...
  • Troubleshooting Boot and Startup Problems - Driver Loading in Safe Mode
    How does Windows know which device drivers and services are part of standard and networking-enabled safe mode? The answer lies in the HKLM\S...

Categories

  • Access 2010
  • BlackBerr
  • BlackBerry
  • Computer Science
  • Cyber Security
  • Exchange Server 2010
  • File Utilities
  • Foursquare
  • Google
  • Hardware
  • Internet
  • iPad
  • Linux
  • Lync Server
  • Microsoft Virtualization
  • Mobile Web
  • Networking
  • News
  • Security
  • Server Architectures
  • Smartphone
  • Ubuntu Linux
  • Windows
  • Windows 7
  • Windows Home Server
  • Windows Security
  • Windows Server 2008
  • Windows Server 2008 Hyper-V
  • Windows XP
  • Wireless

Blog Archive

  • ►  2012 (66)
    • ►  August (5)
    • ►  July (9)
    • ►  June (9)
    • ►  May (8)
    • ►  April (9)
    • ►  March (9)
    • ►  February (8)
    • ►  January (9)
  • ►  2011 (85)
    • ►  December (5)
    • ►  November (6)
    • ►  October (7)
    • ►  September (8)
    • ►  August (9)
    • ►  July (9)
    • ►  June (7)
    • ►  May (7)
    • ►  April (4)
    • ►  March (6)
    • ►  February (8)
    • ►  January (9)
  • ▼  2010 (230)
    • ►  December (13)
    • ►  November (3)
    • ►  October (2)
    • ►  September (10)
    • ▼  August (31)
      • Configuring Small Memory Dump Files
      • Memory Dump Files
      • Types of Stop Errors
      • Stop Messages
      • Stop Message - Identifying the Stop Error
      • Stop Message - Identifying the Stop Error
      • Single, Centralized System Cache and The Memory Ma...
      • Cache Manager
      • Shutdown
      • Windows Resource Protection
      • Solving Common Boot Problems “Part II”
      • Solving Common Boot Problems “Part I”
      • Boot Status File
      • Troubleshooting Boot and Startup Problems – Window...
      • Troubleshooting Boot and Startup Problems – Boot L...
      • Troubleshooting Boot and Startup Problems - Safe-M...
      • Troubleshooting Boot and Startup Problems - Driver...
      • Troubleshooting Boot and Startup Problems - Safe Mode
      • Troubleshooting Boot and Startup Problems - Last K...
      • Images That Start Automatically
      • ReadyBoot
      • Smss, Csrss, and Wininit
      • Initializing the Kernel and Executive Subsystems
      • The EFI Boot Process
      • The BIOS Boot Sector and Bootmgr
      • BIOS Preboot
      • Understanding how WSRM works and what you gain fro...
      • Working with the Windows System Resource Manager (...
      • Understanding Domains
      • Working with Peer Name Resolution Protocol
      • Considering Centralized versus Group Sharing
    • ►  July (32)
    • ►  June (23)
    • ►  May (2)
    • ►  April (21)
    • ►  March (32)
    • ►  February (28)
    • ►  January (33)
  • ►  2009 (119)
    • ►  December (33)
    • ►  November (31)
    • ►  October (35)
    • ►  September (20)
Powered by Blogger.

About Me

Unknown
View my complete profile