[Previous] [Contents] [Next]


Microsoft Windows

Microsoft Windows 3.1 is not, in itself, an operating system. Windows 3.1 is an operating environment that uses MS-DOS as its foundation. Unlike Windows 3.1, Windows 95 is an operating system that incorporates MS-DOS. The purpose of Windows 3.1 was to make the computer more user-friendly by providing a GUI (graphical user interface). The GUI uses icons or pictures to display command information, rather than requiring the user to type a command. Windows is designed to be used extensively with a mouse or other pointing device (it can be used entirely with a keyboard-but that's not recommended).

Windows did not get off to a fast start. In fact, it was not generally accepted until the release of version 3.0. The first version, 1.0, was released in 1985, followed by version 2.0 in 1987. Version 1.0 provided a graphical interface and little else. Version 2.0 was used predominantly by the engineering, design, and graphics/desktop publishing communities. It wasn't until the release of version 3.0 in the early 1990s that this operating environment became popular. This jump in popularity can be attributed to an increasing software base with applications that overwhelmed the features in the MS-DOS environment-faster graphics cards, and improved memory management. The best-known and most-used 16-bit version of Windows is 3.11, released in the spring of 1992.

All applications written to Windows standards provide a common user interface:

  • The menu system offers the same basic commands.
  • Selecting text or objects is done in a similar manner.
  • Clicking and dragging mouse functions are the same.

This commonality shortens the user's learning curve for unfamiliar applications. On a programming level, application developers have access to a toolbox of Windows routines, so they do not have to reinvent the wheel every time they want to invoke a menu or dialog box.

Windows uses a sophisticated memory-management system that makes better use of memory and allows the user to run multiple applications concurrently. This form of multitasking allows the user to have more than one application open and switch between them, even cutting and pasting data from one open window to another. One of the restrictions of DOS is that it was designed to run on an 8086 machine, with a conventional memory limit of 640 KB of RAM. Windows overcomes this restriction by implementing new modes of memory utilization.

Operating Modes

With the release of the 80286 processors, the CPU was able to address more than 1 MB of RAM, thus breaking the DOS barrier. This was good, but the market was still dominated by MS-DOS-based programs that worked within this limit. The release of Windows solved this problem by allowing it to operate in several modes-thus accommodating both the old and new worlds-and fostering a whole new market for memory managers to help overcome the hurdles in configuring them.

Real Mode

The original intention of Microsoft Windows was to provide an MS-DOS-based GUI. The first versions did not include memory-management functions and did not multitask. They were designed only for starting programs and managing files while operating within the MS-DOS limit of 1 MB of RAM. Later versions, however, moved outside the 1-MB limit but continued to support this MS-DOS mode until version 3.1 appeared. This MS-DOS mode is called real mode and is now virtually obsolete. However, some older MS-DOS applications and hardware still require the use of real mode. Support of real-mode applications and hardware is part of downward compatibility. Even in the Windows 95 environment, you will encounter terms such as "real-mode driver," which refers to operating at this level.

NOTE
If any real-mode drivers are loaded in Windows 95, the system will be forced into the same mode: compatibility mode. This will slow down the machine and limit memory utilization. In general, you should stay in 32-bit mode.

Standard Mode

Windows 2.0 broke out of the MS-DOS 1-MB barrier by making use of 286-level protected mode of operation. Protected-mode Windows could address up to 16 MB of RAM. Although MS-DOS programs could run only in the first megabyte of memory, specialized programs were written that would run in (and only in) the extended memory controlled by Windows. The term "protected mode" refers to using protected memory. (Standard mode is run with the processor in protected mode.) Along with Windows protected mode came the now-famous "GPF" (General Protection Fault). Encountering this error generally means that some portion of the Windows protected mode has been violated (for example, the program is trying to write data outside the portion of memory allocated to it).

Microsoft expanded the concept behind Windows by adding support for standardized graphics, fonts, I/O devices, and memory mapping; together these are known as resources. Windows is a resource manager. In the MS-DOS environment, applications developers handled these tasks themselves. Because Windows has these resources built in, it is an easy environment for writing programs. By breaking the MS-DOS barrier (engaging 286 protected mode), Windows running in standard mode takes control of many the hardware functions. This means that programs do not have to write the code directly to control devices, only to ask Windows to use them.

MS-DOS programs can run only in real mode. Running 286 protected mode worked well for the special programs, but once in protected mode, it was not possible to return to real mode without resetting the CPU (only the CPU-not the computer). The MS-DOS program would unload when you switched back to Windows. These versions (1.0 and 2.0) of Windows could run only one MS-DOS program at a time.

Windows Runtime Version

Certain applications (like Aldus PageMaker) could be purchased with a "runtime" version of Windows. This allowed a program that required a Windows environment to run on computers that did not have the full version of Windows installed.

386 Enhanced Mode

The 386 protected mode can address up to 4 GB of memory, supports virtual memory, and allows multiple MS-DOS programs to run simultaneously. Beginning with Windows for Workgroups 3.11, only 386 enhanced mode is allowed in Windows for full operation. Real mode is still used in a limited way for advanced diagnostics and development.

As mentioned, Windows is a resource manager. It treats everything in the computer as a resource. Resources include memory, video, serial ports, and sound. All resources are presented to Windows through device drivers. Device drivers are simply files that know how to talk to Windows. When loaded, they allow Windows and a device to communicate. Almost all device drivers are stored in the \Windows\System directory. These drivers can be easily identified by their file extensions, which are .DRV or .386. Drivers with the extension .DRV are designed to work in standard and enhanced mode. Drivers with the extension .386 work only in enhanced mode.

Just like MS-DOS, Windows consists of three core files: KRNL386.EXE, USER.EXE, and GDI.EXE. These programs allocate and keep track of all system resources requested by the applications. They use a number of 64-KB storage areas of extended memory (called heaps) to keep track of which application is using which resource. They also have some ability to take away or reallocate resources (mainly RAM) from one application to another.

Applications are resource consumers. They must request access to any resource using very standardized subroutines called the application programming interface (API). Another file called a dynamic-link library (DLL) can speak to the Windows core directly. These small files store subroutines that either come with the compiler that created the application, or are made by the programmer. DLL files always end with the extension .DLL. Loss or corruption of DLL files will cause an application to lock up or prevent it from loading.

NOTE
Some programs come with custom versions of DLLs that overwrite the standard DLL of the same name. If a problem occurs after loading a new application, installing a repair update of Windows might correct the problem, but can also render the new program useless. In such cases, you will need to consult with the program vendor or check the Microsoft Knowledge Base for more information on a fix.

When a program starts, it loads a small piece called a "stub" in conventional memory. This stub asks for RAM from KRNL386.EXE, which then allocates the amount of RAM as long as it is available. This area of RAM is known as a segment and its location is stored in a heap. Once loaded, a program can ask for resources as required. As long as there are resources to give, Windows will give them.

RAM is the most important resource that Windows must manage. As most users know, there never seems to be enough memory. Windows provides a way to gain memory when there is none. It uses virtual memory. Virtual memory means the ability to make something other than RAM chips hold data. Windows can create a special file (called a swap file) on the hard disk drive to act as a RAM chip. While running, Windows prioritizes programs and caches the lesser-used ones to the hard drive, thus allowing the most active program to use actual RAM.

To get around the problem of resetting the CPU in order to run an MS-DOS program, these later versions of Windows have the ability to run what is known as virtual 8086 mode. Virtual 8086 mode is an extension of 386 protected mode that allows for the creation of virtual 8086 machines. A virtual 8086 machine is a segment of RAM that operates as if it's an 8086 computer. Windows will run itself in one virtual machine (VM) and allocate another virtual machine to an MS-DOS program. Using several virtual machines, Windows can overcome the limitations of running only one MS-DOS program at a time.


[Previous] [Contents] [Next]