Chapter 3: Troubleshooting Windows

Microsoft Windows 3.1 is a sophisticated operating environment that employs MS-DOS for basic file services. Windows 3.1 is not yet an independent O/S; it runs on top of DOS to provide an array of graphics-based functionality to PCs.

The Primary Function of Windows

! Protected Mode Operation - Windows supports the DPMI (DOS Protected Mode Interface) and XMS memory. This enables Windows and Windows applications to access virtually unlimited physical RAM.

! GUI (Graphics User Interface) provides a consistent user interface between Windows applications. File, print, and other standard functions are identical in almost every Windows application.

! Multi-tasking is provided via task switching or true concurrent multi-tasking. (Cooperative multi-tasking in Windows like UN. 286's set aside a protected segment of memory. Scheduler in DOS gives pre-emptive multi-tasking.)

! Data Interchange between applications is accomplished wit the clipboard, Dynamic Data Exchange (DDE), and Object Linking and Embedding (OLE). (Needs 16 MB Ram minimum)

! System Resource Management - applications share access to the standard Windows system hardware resources including disk drives, serial and parallel ports, and hardware interrupts.

! Graphical Display Management - with a manufacturer supplied driver, super-VGA display adapters support high resolutions (1270 x 1024), large video displays, and accelerated graphics co-processing.

! Printing Support - Windows provide comprehensive printing services. It manages fonts, graphics, print stream formatting, printer access, and handshaking. Windows provides print drivers for hundreds of popular printers and plotters.

! True-Type Fonts are an industry standard fast, intelligent, scaleable, WYSIWYG font technology supported by Windows on video displays and printers. (16 bit Win apps run cooperative multi-tasking; 32 bit Win versions run pre-emptive multi-tasking.)

The Elements of Windows

Windows is best understood by examining its individual elements.

The Kernel

! The nucleus of Windows. (One for standard mode; one for enhanced mode.)

! Contains the graphics engine for fonts and drawing.

! Provides System management features like memory and I/O port management.

! Contains the Scheduler-Window's multi-tasking mechanism which allocates CPU cycles and system resources to the current active systems tasks and application programs.

SYSTEM.INI Drivers

! Windows' equivalent to CONFIG.SYS is SYSTEM.INI. With hundreds of possible commands and entries, SYSTEM.INI reflects the underlying complexity of Windows.

! Windows supplies several dozen default drivers. Internal drivers are part of the Kernel and designated with * as the first characters (reinstall Windows). External drivers are separate files that have a valid DOS file name.

! Most standard DOS and BIOS drivers are replaced by external Windows drivers (protected mode).

! VGA adapter manufacturers provide several Windows drivers to support various combinations of screen resolutions and maximum number of simultaneous colors.

! VL-Bus and PCI-Bus adapters Windows drivers to support 32-bit mode and accelerated graphics processing. (Only use local bus.)

ProgMan: The Program Manager

! ProgMan is the default Windows Shell. It's automatically started when Windows is booted.

! It's main function is to provide a means to manage the Windows Desktop, create program icons and program groups, and launch applications programs.

! There are many third-party ProgMan replacements. They support a much more sophisticated Desktop and provide advanced management features. However, they have also suffered from compatibility problems.

The Task Manager

! An internal Windows application, it's automatically loaded when Windows is booted.

! Activated by clicking on the bar in upper, left corner of the screen.

! The TaskMan pull-down menu is used to manipulate the size of the window, switch the window between the current tasks, and tile the current tasks on one screen.

! The CoolSwitch supports fast-tab-switching by using Alt-Tab is rotate through the current activate tasks.

The Clipboard

! An internal Windows application accessed through the Edit Menu of any application.

! The simplest form of Windows data exchange.

! Supports Cut, Copy, and Paste operations.

! Supports text, graphics, and sound data.

The Windows Help Engine

! A windows application which enables Windows and other applications to create hyper-text linked help systems with text and graphics.

! Most applications help systems are so comprehensive that a hard-copy manual is rarely needed.

! Windows help authoring systems enable technical support staff to create custom help systems with an identical look and feel to standard Windows help systems.

The Control Panel

! A Windows utility program which has 12 functions.

! Windows management utilities may add additional CPL applets to the Control Panel.

! Set the appearance of the Desktop.

! Adjust Mouse and Keyboard characteristics.

! Select Default Printer and Printer Options.

! Set serial Port Parameters.

! Set system Fonts and Colors.

! Load multi-media Drivers.

The File Manager

! The WINFILE.EXE Windows utility program.

! Used to view/modify directory structures.

! Find, Copy, move, delete files and set file attributes.

! Format and copy diskettes.

! Specific operations may be suppressed by placing entries in the Winfile INI file. (Restrictions can be set here.)

! Supports third-party add-on extensions to the File Manager menu, such as DriveSpace or Stacker pull-down menus.

The Print Manager

! A Windows utility Program. (Super Print for Windows works fast; works best with Color Inkjet.)

! Manages print queue operations.

! Works in the background, which enables applications to quickly return to supporting user input.

! Pint operations are generally slower with the Print Manager. Many standalone PC users elect to disable Print Manager, it's always disabled for network print operations.

! Many third-parties provide faster and more flexible print manager replacements.

The INI Files

! The .INI extension signifies a Windows systems or application initialization file.

! INI files are written in pure ASCII code. They can be edited in any ASCII text editor.

! They are divided into several sections. Each section is designated by a section name enclosed in square brackets; e.g. [386enh].

! A statement consists of one line, terminated with a hard return (CR-LF).

! Each statement begins with a keyword (a recognized command) followed by an equal sign and an argument; e.g. display.drv=viper_08.drv.

! Keywords are not case sensitive, although some arguments may be. To make keywords more easily readable, it's common practice to intermix cases; e.g. SystemROMBreakPoint=False.

! Each statement must reside in the proper section.

! The remark character is a semicolon (;). text following a semicolon is ignored.

! Settings that require a Boolean value may use: True or False 1 or 0, On or Off, Yes or No.

SYSTEM.INI

! To implement protected mode and 32-bit operation, Windows attempts to bypass DOS and BIOS and converse directly with the system hardware.

! SYSTEM.INI provides the drivers and defines the environment that enables Windows to directly interface with the hardware.

! Each SYSTEM.INI file is unique to a specific hardware implementation: CUP, RAM, disk drive, display adapter, pointing device, and network.

! The [386enh] section specifies drivers that are used when Windows runs in the 386 enhanced mode. This most advanced (and popular) mode of Windows operation exploits the memory management and virtual machine (VM) mode of the 80386 and later microprocessors. (Real mode multi-tasking/bluescreen of death)

! A missing or corrupt driver in SYSTEM.INI results in a Windows hang-up or boot failure.

WIN.INI

! Contains options that affect the "look and feel" of Windows. The focus of WIN.INI is display and printing capabilities.

! True-Type display/print fonts are installed.

! The setup programs of many applications modify WIN.INI and create their own section within WIN.INI.

! In the absence of WIN.INI, Windows asserts default system values.

! Incorrect or corrupt WI.INI entries (fonts) may cause Windows to hang or no run properly.

Enhanced Mode

! Exploits the memory management and multi-tasking features of the 80386 architecture.

! The maximum amount of physical RAM is dictated by the system board design; usually 64Mb; 256 Mb for graphics.

! Supports an optional virtual memory swap file to augment physical RAM. However, swap files are many times slower than physical RAM.

! A Permanent swap file provides the fastest mechanism by enabling Windows to by-pass the FAT and directly access the hard disk sectors.

! Enforces memory protection to ensure that applications do not access the same areas in RAM.

! Employs the 8086-VM mode of the 80386 processor to enable multi-tasking of both Windows and DOS applications.

! Each simultaneous process is given its own virtual machine: CPU, memory, and I/O ports. Writes to physical memory and I/O ports are intercepted and handled by the Kernel.

! In most cases, an unstable application only hangs its own virtual machine, not the physical microprocessor or the Kernel.

! The CPU maintains state information for each task, and the Scheduler distributes CPU cycles between the VMs.

! Each time the Scheduler touches a DOS-VM, the memory is mapped between its physical address in XMS memory and the logical address of the 640-Kbyte Real-Mode virtual machine.

! Provides UMB support for Windows buffers to ensure that the maximum amount of conventional memory is available for DOS applications.

Standard Mode

! Enables 80286-based PCs to run Windows.

! Protected Mode operation provides access to a maximum of 16-Mb of RAM.

! No virtual memory support.

! No memory protection enforcement between application programs.

! Multi-tasking support for Windows applications, but only task switching for DOS applications.

! No VM mode. One unstable application may hang the entire system.

! No UMBs Support-Windows translation buffers must be placed in conventional memory.

! Because of its lower overhead, Standard Mode may provide better performance than Enhanced Mode when multi-tasking, VM support, and memory/port protection are not required.

! Used to troubleshoot Windows Enhanced mode faults. If Win runs in Standard Mode but not in Enhanced, the problem is in [386 enhanced].

Windows Memory Usage

! Requires a minimum of 256-Kbyte of conventional memory. To provide fastest Windows operation ensure that system has at least 512-Kbyte of conventional memory.

! Fills unused UMBs with RAM for various buffers. If UMB space is unavailable, Windows will use conventional memory for buffers.

! Windows and Windows-specific programs utilize XMS memory which is normally supplied by HIMEM.SYS or a third-party memory manager.

! Versions of EMM386 prior to DOS 6 don't pool XMS & EMS memory. Memory assigned to EMS is subtracted from XMS memory.

! Every device driver and TSR in the DOS real-mode machine must be replicated in every DOS VM.

! Each DOS program running under Windows is limited to the amount of free conventional memory available to Windows.

! A small swap file and 4-Mb of RAM is usually sufficient to support two major Windows applications and a 512-Kbyte disk cache.

! Disk cache programs provide diminishing returns because they compete with Windows for XMS memory. The faster the disk drive, the less benefit it derives from a software cache.

! 8-Mbyte of RAM and no swap file provides the best performance for an average Windows user.

! Ensure that PIF files are properly tuned and specify the minimum required RAM.

! Examine AUTOEXEC.BAT and eliminate any unnecessary DOS TSRs.

! Third-Party memory managers (such as QEMM and 386-Max) create the greatest amount of High RAM, automate memory optimization, and pool EMS/XMS memory.

! If you don't need EMS memory, disable the Page Frame to gain an additional 64-Kbyte of UMB space. (Go into Pdx PIF spec EMS mem needed. VxD are 32 bit Virtual Device Drivers loaded in extended memory. Windows only needs XMS memory.)

Windows Start-Up Command Line Options

The Windows Boot Loader - WIN.COM

! Determines the type of computer and amount of available memory.

! Establishes Windows mode: Standard or Enhanced.

! Switches the display from text to standard VGA graphics mode.

! Displays the Windows advertising logo screen.

! Loads the Windows Standard (KRN286.EXE) or Enhanced (KRN386.EXE & WIN386.EXE) mode executables. (Then calls System.INI.)

Making Your Own Windows Advertising Logo

! WIN.CNF is the part of .WIN.COM that detects the system hardware configuration.

! VGALOGO.LGO switches the PC into the VGA graphics mode.

! VGALOGO.RLE is the default Windows Advertising Screen graphics.

! The Windows start-up logo graphics file must be in a bit-mapped RLE (run length encoded) format. Shareware WinFig and many Windows graphics programs will convert bit-mapped images into a RLE format.

! Create your new Windows advertising graphics and convert it to RLE format.

! Assume that the name of the new advertising logo graphics file is R&H.RLE.

! Instead of writing over the original WIN.COM file, use a new boot loader file name such as NEW_WIN.COM.

! The DOS copy command with the /b (binary) option will concatenate the three files into a new Windows boot loader. The following command is issued from the Windows directory and assumes that all three files also reside there:

copy /b win.cnf+vgalogo.lgo+r&h.rle new_win.com

! Executing NEW_WIN will display your Windows advertising screen and then start Windows.

WIN.COM Command Line Switches:

WIN [:] [[/s or /2]or[/e or /3]] [/b] [/d:[f][s][v][x]] [filename]

Standard Options:

[:] Skips the Windows advertising screen.

[/2 or /2] Forces Windows to start in Standard mode.

[/e or /3] Forces Windows to attempt to start in Enhanced mode.

[/b] Creates (or appends to an existing) boot log file in the Windows directory. BOOTLOG.TXT sequentially lists each device driver and file that Windows loads as it starts and the completion status of each operation.

Debug Options:

Each debug option corresponds to a critical entry in SYSTEM.INI. Debug is used to quickly isolate Windows start-up problems without editing SYSTEM.INI.

[/d:f] 32BitDiskAccess=Off disables the Windows 32-bit, protected mode FastDisk driver for WD1003 register-compatible hard drive controllers. This driver speed-up disk operations but may be incompatible with certain disk and system configurations.

[/d:s] Sets SystemROMBreakPoint=Off disables the BIOS ROM breakpoint routines. Required setting for third-party memory managers like QEMM and 386-MAX.

[/d:v] VirtualHDIrq=Off prevents Windows from directly servicing hard disk interrupts. Setting to Off compensates for certain disk caching programs, game programs, and hard cards at the expense of disk speed.

[/d:x] EMMExclude=A000-FFFF prevents Windows from mapping RAM buffers into the upper portion of the system memory space.

Troubleshooting Windows

Windows is a demanding (and often fragile) complex interaction of hardware and software. These troubleshooting sections provide a standard list of checks and actions to aid you in isolating common Windows programs. (WFWG doesn't use FAT or DOS. File Access turn on Virtual file driver. WIN /n turns off network support.)

Windows Won't Start

! Attempt starting Windows in Standard Mode. If it starts, then use the Debug start-up options to pinpoint the enhanced mode failure.

! Ensure that no programs are automatically started. Remove Load=, Run=, and hold down Shift Key when Windows is loading to keep programs in the Start-up Group from executing.

! To isolate the problem to WIN.INI rename it and enable Windows to create a default WIN.INI.

! Verify file system integrity with ScanDisk, NDD, or PC Tool's Disk Fix.

! Execute Win /B and examine Bootlog.Txt to determine if a driver is causing Windows to hang or abort.

! Verify the Shell=Program.Exe entry in the [boot] section of SYSTEM.INI.

! Verify that a minimum of 2-Mb of free disk space for Windows temporary files. The DOS environmental variable TEMP= specifies the drive and directory for temporary files.

! Verify that the TEMP environmental variable in AUTOEXEC.BAT points to a local (not network), un-compressed hard drive. It's best to create a specific TEMP directory instead of using the DOS directory.

! Run Setup and install the generic VGA driver. This will determine if a third-party video driver has been corrupted or erased.

! Search the directories in the DOS path for a WIN.BAT file which may have entries that are causing the problem. Or simply change to the Windows directory and then execute Win.Com.

! Search for WINSTART.BAT a special Enhanced mode batch file used to start Windows with DOS TSRs. If found, remark out any statements and then attempt to execute Windows.

! Check SYSTEM.INI for extraneous spaces in each section heading.

! Reinstall Windows in the existing directory with Setup and Custom Setup. This preserves existing INI files isolating the fault to Windows programs or DLLs.

! If the previous step doesn't work install a new copy of Windows in a different directory. Change to the new directory and run Windows. This checks for a conflict between Windows applications programs.

Examine the DOS Environment

! Execute DOS MEM /C to ensure that there is 512-Kb of free conventional memory and a minimum of 1-Mb of free XMS memory.

! Insufficient XMS memory may be due to large disk caches, RAM drives, or too much RAM assigned to EMM386 for EMS 4.0 memory.

! Verify that a minimum of 50 file handles are reserved in CONFIG.SYS.

! Remove any Include statements from EMS memory managers.

! Disable QEMM's Stealth technology as indicated by the ST:M or ST:F switches and then re-run Optimize.

! Use the correct OEM version of DOS. Examples: COMPAQ DOS, TOSHIBA DOS, IBM'S PC-DOS.

! Exclude the monochrome display buffer memory space: B000-B7FF or the entire display buffer/Video ROM space: A000-C7FF.

! Exclude statements should be placed on the EMS memory manager device=line in CONFIG.SYS as X={address range} and in the [386Enh] section of SYSTEM.INI in the form of EMMExclude={address range}.

! Ensure that the Windows directory is in the DOS Path. Previous to DOS 6 verify the Path statement is a maximum of 127 characters.

! Disable disk caching software, never use EMS memory for the disk cache, and don't cache the logical volume of compressed drives.

! Use double-buffering caching with SCSI disk drives to create a small DMA buffer in conventional memory. If Setup determines that double-buffering is needed it modifies it adds the /Double_Buffer switch to the SmartDrive command line.

! Boot the system from the Rescue Diskette or a Vanilla Boot Diskette with minimal CONFIG.SYS and AUTOEXEC.BAT files.

! Undo recent modifications to system files or revert to back-ups of those files.

WinSense 2.0

WinSense, from SoftLogic Solutions, is an inexpensive, easy-to-use Windows optimization and technical reference program.

! Provides automatic Windows option setting recommendations. Via a User Profile Screen, WinSense analyzes the system hardware and software, then suggests changes to INI files to provide optimum performance and stability.

! Manual assisted, safe and easy Windows option setting and INI file editing. INI editing is accessed by: subject, program, INI file/section, and keyword search.

! Automatic INI file backups and restoration, and comparison and restore for modified INI files.

! Perhaps the most useful feature of WinSense is a comprehensive Windows Knowledge Base and on-line help system. It provides an excellent structure in which to become an expert Windows tuner and troubleshooter.

Norton Utilities 8.0 Windows Utilities

The Norton Windows Utilities cooperatively function to provide a comprehensive Windows optimization, editing, and tracking system.

INI Advisor

! A simpler rendering of WinSense-like functions, which are tightly bound to the four main Norton Windows programs.

! Views INI file by file, section, or statement.

! Provides Edit, Set, and Tips functions.

! Especially useful when accessed through the INI Tuner, list-by-setting view.

! In addition to performance and appearance tips, INI Advisor has a comprehensive Windows Troubleshooting section.

! A pop-up menu is activated with the right-mouse button. It provides direct jumps to INI Adviser sections and other Norton Windows utilities.

INI Tuner

! Provides detailed listings of Windows INI files and entries.

! INI files can be viewed as: an alphabetical list of detailed information, groups of icons similar to Control Panel, or as a list of icons with a name and long description.

! Open and manually edit INI files.

INI Editor

! A structured INI file editor with ToolBar providing access to all of Norton's Windows tools.

File Compare

! View and compare changes between current and previous versions of files; including INI files.

! Special INI mode that enables the direct comparison of INI files to determine which lines were added, deleted, or moved. Great for determining how the installation of specific software modifies the INI files.

INI Tracker

! Takes "Snapshots" of critical system files and creates an "audit trail." Typically used to track: CONFIG.SYS, AUTOEXEC.BAT, SYSTEM.INI, WIN.INI.

! Works with File Compare to examine file modifications and reinstate snapshots.

! INITRAKD.EXE is a DOS-based INI tracking program. When changes to systems files keep Windows from booting, INITRAKD is executed from the DOS command line to reinstate a previous snapshot.

! INITRAKD /B is placed in AUTOEXEC.BAT ensure that a snapshot is taken each time the system is booted.

System Watch

Not an INI related utility. System Watch monitors Windows resources.

! Memory: Physical, Virtual, and DOS (conventional) Memory.

! CPU utilization.

! GDI (Graphic Display Interface) module provides graphics output to display devices. It's usually the first Window's resource to be depleted.

! User Resources module manages window operations and direct input to the applications from the input devices.

! System Handles are equated with the global memory handles or selectors used in managing memory.

! The total number of DOS and Windows open files. Maximum number is 127.

! Cache Hit Ratio for SmartDrive and Norton disk cache drivers.

! Free hard drive Disk Space. (Uninstaller 3.0)

Windows WinSense and Norton Lab:

Objective:

Execute Windows with the boot-log option to practice start-up troubleshooting problems. Use WinSense and the Norton Utilities Ver 8.0 to tune and stabilize Windows operation, examine the technical aspects of Windows, and make snapshots of key system files.

Loaded Software:

DOS versions 5.0 or 6.2

Windows 3.1 or 3.11

WinSense 2.0

Norton Utilities ver 8.0

Procedures:

1. The Windows Boot-Log File

a. Change to the Windows directory and delete any existing BOOTLOG.TXT file.

b. Boot Windows with the WIN /B option.

c. Execute the Notepad editor in the Accessories Group and examine the file bootlog.txt in the Windows directory.

d. What do you think would happen if the file shell.dll was deleted?

e. Exit Windows and copy SHELL.DLL from the C:\Windows\SYSTEM directory into C:\TEMP. Then delete SHELL.DLL from the C:\Windows\SYSTEM directory.

f. Execute WIN /B. What is the error message? (Cannot find Shell.DLL) Run DOS EDIT to examine BOOTLOG.TXT. Does it agree with the error that you experienced? Exit the DOS Editor. (No! Load success=shell.dll on Appended failure code is 02.

g. Copy SHELL.DLL from C:\TEMP to C:\WINDOWS\SYSTEM. Reboot Windows to ensure that it now functions.

h. Desktop Users: Optional Advanced Technique.

i. The IDE-Bus Controller in your system uses a device driver that's not compatible with Windows 32-bit disk access.

ii. To enable 32-bit disk access: Open Control Panel, 386 Enhanced, Virtual Memory, Change, click Use 32-bit Disk Access, OK, Yes, Yes, Restart Windows.

iii. What happens when you attempt to run Windows? Will Windows run in the Standard mode. Why? (Insufficient memory or addresses space quit applications.)

iv. Use the appropriate /d: /f debug option to troubleshoot and fix this problem.

2. Winsense

a. Run Windows

b. Open the WinSense Group and double-click on the WinSense Icon.

c. Click the Profile Button

i. Complete a profile for a typical Windows installation at your company. Click OK, Make New Recommendations-Yes.

ii. On the Recommendations screen double-click the Advise... button and examine the advice that WinSense is making.

iii. Use the Explain button to understand a specific statement.

iv. Click Cancel to not implement the changes and return to the main menu.

v. Repeat this process for several different profiles.

d. Click the Explore Button

i. Explore contains a vast, hyper-text data base of Windows technical, troubleshooting, and tuning information.

ii. Take a few minutes to tour this extensive collection of Windows information.

3. The Norton Windows Utilities

a. Open the Norton Windows Group

b. Execute the Windows version of Disk Doctor and Speed Disk. Notice how slowly they operate? It's simply not practical to run these types of programs from within Windows.

c. Execute System Watch, Sensor-Enable All.

i. Examine the features of System Watch.

d. Execute each of the four Norton INI program.

i. Notice how each of the INI programs are tightly bound.

e. Execute INI Tracker to take a snapshot of the system files.

f. Use file compare to examine the differences between the snapshots of SYSTEM.INI.