Preventing the blue screen of death in Windows requires different approaches depending on which version of Microsoft Windows you use. This writeup has two sections: one for Windows 95, Windows 98 (both editions) and Windows Millennium, and one for Windows NT, Windows 2000 and Windows XP.
Both approaches have a common theme, however: BSODs come from faults in device drivers, including virtual devices and software-only devices, or the kernel. While kernel bugs exist of course, nearly all BSODs on modern PCs come from device driver faults of one form or another (including faults caused by the device's own failure). Therefore, preventing the BSOD means preventing device driver faults.
- Use devices with the Designed for Windows 95/98/ME logo on the packaging.
Earning that logo means the designers tested their drivers thoroughly enough under "normal" conditions. You might be surprised to learn that the free virtual cd-rom software you installed was not thoroughly tested. You get what you pay for.
If a device or driver with this logo is at fault (see Safe Mode below), look for an update from the manufacturer's support web site, or look for a competitor's version of the device.
- Visit Windows Update for critical updates.
Windows Update has critical updates for IDE disk devices as well as other virtual device drivers. See the Windows Update node to learn how to prevent problems while using it.
- Remove or replace faulty hardware.
A BSOD reporting an error on a disk device (error on Drive C for instance) most likely means the device in question is about to fail. Removable drives, like floppy drives and CD-ROM drives may need cleaning. Hard drives causing this error are going to crash hard real soon now, so copy what you can and replace it. Windows should identify the name of the driver driving other devices, such as digital cameras, so you can tell which device is failing.
- Check your system drive (usually C:) for errors.
Windows should automatically do this for you (in Win95 OSR2 and 98/ME) if it crashes to a BSOD and restarts. An error in the file system, notably in the paging file or swap file, can cause a BSOD. If Windows doesn't do this automatically, you can run Scandisk manually. In Windows ME you may have to do this from Safe Mode to prevent Scandisk constantly restarting due to disk access by background programs.
- Update the drivers for your hardware.
If a certain display mode or game causes a BSOD, most likely it's trying to use features your video driver or audio driver has problems with. Replace the driver (use an older version if necessary) or replace the device.
- Uninstall the software gadgets.
If you have a systray loaded with icons, or a web browser loaded with toolbars, remove those using their uninstaller. While Windows NT/2K/XP prevents applications from messing with device driver space, Windows 95/98/ME has no such protection.1 Put them back, one at a time, and try to repeat whatever caused the BSOD. Replace them one at a time until you find the defective gadget, and repeat with the remaining gadgets.
- Update your anti-virus software if you use it.
Windows 95/98/ME anti-virus software typically uses virtual device drivers to intercept some kernel functions, so they can catch certain types of viruses. Bugs in anti-virus software will easily cause a BSOD.
- Avoid third-party network drivers if possible.
Specifically, avoid Wingate, EnterNet 300, and new.net. Also avoid other third-party network protocols, VPN software, "software firewalls" and so on. These are all virtual device drivers. You can replace most of these with a hardware firewall, which can act as a router, PPPoE client, Internet sharing device, firewall, VPN client and hub without installing any special software.
- Use Safe Mode to turn off third party drivers, and turn them back on one at a time.
This helps you pinpoint the troublesome driver. If you disable your video driver, Windows will start in basic VGA mode, so this is usually the first one you turn back on.
Mostly, all of the above with these notable exceptions:
- Don't blame an application.
Windows NT/2K/XP blocks applications from accessing kernel memory and will terminate the application if it attempts to do so.2 This includes games if they tickle bugs in a video driver; the video driver is at fault in this case. It is possible for a badly written application to crash Win95/98/ME but run fine, or crash without crashing the system, on NT/2K/XP.
- Use devices Designed for Windows NT/2K/XP.
Drivers for 2K and XP require greater testing, and are most often digitally signed by Microsoft after passing these tests. While many well-tested-yet-unsigned drivers exist, you should check unsigned drivers before you check signed ones. If your device came packaged with unsigned drivers, chances are you will find signed drivers on the manufacturer's support web site.
- Turn off Fast User Switching if you don't need it.
No application or gadget should crash Windows XP if it doesn't work with fast user switching, but if the gadget interacts with a device driver (such as a printer monitor) it could tickle a bug in the driver. This should not happen to devices Designed for Windows XP, but turning this feature off can also save precious memory, avoiding yet-undiscovered bugs in other, unrelated drivers.
- Perform your regular work as a Limited User.
Limited users can't "accidentally" install or remove device drivers, or otherwise mess with the operating system. Use an administrator account for maintenance, such as installing applications, patches and drivers, and use a limited user account for regular work. Create limited user accounts for each member of your household.
- If your computer supports ACPI, look for a firmware BIOS upgrade.
Advanced Configuration and Power Interface (ACPI) allows for interrupt sharing, more than sixteen interrupts on supported computers, standby and hibernate support among other things. ACPI is so critical to Windows 2000 and XP that it requires its own HAL driver set, and this is the lowest level of operation in Windows short of the kernel itself.
A system that ran fine with Win98 may hang or crash Win2K and XP, because 2K/XP requires a more accurate implementation of ACPI. These systems will also hang or crash an ACPI Linux operating system. Updated firmware might not provide complete ACPI support, but it can clearly indicate its capabilities to the operating system.
In a worst case, you can replace the ACPI HAL with a Standard PC HAL, by performing an in-place upgrade.3 While performing the in-place upgrade, press F5 while "Press F6 to install a third-party mass storage driver" appears and you will be able to choose the "Standard PC" HAL.
- KERNEL_DATA_INPAGE_ERROR means THE_HARD_DRIVE_IS_DYING.
Windows NT/2K/XP requires a paging file even if there is enough physical RAM free. If the system cannot read and write the paging file, the BSOD KERNEL_DATA_INPAGE_ERROR occurs.
If your system uses NTFS, which can tolerate file system errors better than FAT, chances are you will need to replace the hard drive. Copy what you can and replace it. If it still uses FAT, you could restart it and let the system run CHKDSK on it to fix any errors. Windows will recreate the paging file, if needed, afterward. Though if this happens more than once, you definitely should replace it.
Among hundreds of machines I work with regularly, the few BSODs that occur come from faulty devices or faulty device drivers. While it's impossible to avoid faulty devices because they can wear out over time, avoiding faulty device drivers ultimately avoids the BSOD.
1. Richter, Jeffrey. Advanced Windows, Third Edition page 119.
2. Richter, Jeffrey. Advanced Windows, Third Edition page 121.
3. Windows XP: http://support.microsoft.com/default.aspx?scid=kb;en-us;315341 Windows 2000: http://support.microsoft.com/default.aspx?scid=kb;en-us;292175
Thanks to the administration for moving this writeup to a proper home. Sorry for the trouble.