The A+ Certification & PC Repair Handbook (Charles River Media Networking/Security)

In Chapter 17, you were introduced to the basic DOS memory model and concepts. You should recall that conventional memory is used primarily for programs and applications. Conventional memory encompasses the first 640K of memory used in the DOS memory structure. Expanded Memory Specification (EMS) is extended or reserved memory that emulates conventional memory. It ranges from the top of the 640K barrier to 1024K. The High Memory Area (HMA) utilizes the top 384K of expanded memory in the DOS memory model. The Extended Memory Specification (XMS) is above the HMA. It includes all the memory addresses over 1088K. If you need more information about this structure, refer to Chapter 17 for a refresher.

Several DOS memory management utilities and software drivers organize and make better use of available memory.

Virtual Memory and Swap Files

A portion of a hard disk that is set aside for a certain range of memory address is referred to as virtual memory. This space on the hard drive acts as a sort of overflow buffer for RAM, or ‘real memory’ as more memory is needed. A process called memory paging is used to create and swap memory addresses in and out of the hard drive’s allocated virtual memory space. The main purpose of virtual memory is to allow the CPU to use hard drive space as memory. The virtual memory manager controls virtual memory. If the virtual memory manager cannot allocate memory requested by a specific application in Windows 9x, a page fault will occur.

Virtual memory space is allocated on a hard drive in two ways: as a temporary swap file and as a permanent swap file.

The procedures for changing virtual memory settings in Windows 9x, Me, NT, 2000, and Windows XP are discussed in their respective chapters (i.e., Chapters 24, 25, 26, 27, and 28).

The Virtual Machine

When you start a DOS session or go to the command prompt from within Windows, the OS actually creates a separate memory space for your session to run in. This is called a Virtual Machine (VM). It was evident in Windows 3x that multitasking was occurring, because the user could open several ‘DOS windows’ or VMs at once.

The most important thing to realize about VMs is that they run in their own protected memory space. This means that if one program running in its own VM fails, other programs running in separate VMs are not affected. In other words, you can open multiple DOS or command prompt sessions. If one of the sessions fails, the other sessions will not be affected. This explains why the core components of an operating system, such as KERNEL.EXE, GDI.EXE, and USER.EXE, are designed to run in a protected memory space—so that they are protected from other programs that may fail.

In Windows 3x, we used Program Information Files (PIFs) to allocate specific amounts of memory to our separate DOS VMs. In newer operating systems, you can still create PIF files and assign properties to VMs.

To display the assigned properties of the MS-DOS prompt in Windows 95, click Start > Programs, right-click the MS-DOS prompt, and left-click Properties. You will see the following tabs: General, Program, Font, Memory, Screen, and Misc. If you click the Memory tab, you will see the conventional, expanded, and extended memory assigned to the DOS VM. If you click the Program tab and select Advanced, the window shown in Figure 23.5 will display. If you are trying to run a DOS application in a Windows 95 environment and receive the message “This Program cannot be run in Windows,” you should make sure that the “Prevent MS-DOS-based programs from detecting Windows” box (also shown in Figure 23.5) is checked for the advanced properties of the DOS prompt properties associated with the application. Click OK twice and run your DOS application again.

Figure 23.5: MS-DOS prompt advanced program settings.

Категории