The System Logical Memory Layout


The original PC had a total of 1MB of addressable memory, and the top 384KB of that was reserved for use by the system. Placing this reserved space at the top (between 640KB and 1024KB instead of at the bottom, between 0KB and 640KB) led to what is often called the conventional memory barrier. The constant pressures on system and peripheral manufacturers to maintain compatibility by never breaking from the original memory scheme of the first PC has resulted in a system memory structure that is (to put it kindly) a mess. Almost two decades after the first PC was introduced, even the newest Pentium 4based systems are limited in many important ways by the memory map of the first PCs.

What we end up with is a PC with a split personality. There are two primary modes of operation that are very different from each other. The original PC used an Intel 8088 processor that could run only 16-bit instructions or code, which ran in what was called the real mode of the processor. These early processors had only enough address lines to access up to 1MB of memory, and the last 384KB of that was reserved for use by the video card as video RAM, other adapters (for on-card ROM BIOS or RAM buffers), and finally the motherboard ROM BIOS.

The 286 processor brought more address lines, enough to allow up to 16MB of RAM to be used, and a new mode called protected mode that you had to be in to use it. Unfortunately, all the operating systems software at the time was designed to run only within the first 1MB, so extender programs were added and other tricks performed to eventually allow DOS and Windows 3.x access up to the first 16MB. One area of confusion was that RAM was now noncontiguous; that is, the operating system could use the first 640KB and the last 15MB, but not the 384KB of system reserved area that sat in between.

When Intel released the first 32-bit processor in 1985 (the 386DX), the memory architecture of the system changed dramatically. There were now enough address lines for the processor to use 4GB of memory, but this was accessible only in a new 32-bit protected mode in which only 32-bit instructions or code could run. This mode was designed for newer, more advanced operating systems, such as Windows 9x, NT, 2000, XP, OS/2, Linux, Unix, and so forth. With the 386 came a whole new memory architecture in which this new 32-bit software could run. Unfortunately, it took 10 years for the mainstream user to upgrade to 32-bit operating systems and applications, which shows how stubborn we are! From a software instruction perspective, all the 32-bit processors since the 386 are really just faster versions of the same. Other than the more recent additions of MMX and SSE (or AMD's 3DNow) instructions to the processor, for all intents and purposes, a Pentium 4 or Athlon is just a "turbo" 386. Even more advanced server-oriented, 64-bit instruction set processors such as the Intel Itanium and AMD Opteron processors fit into this category because they can also run 32-bit software.

The real problem now is that the 32-bit processors have two distinctly different modes, with different memory architectures in each. For backward compatibility, you could still run the 32-bit processors in real mode, but only 16-bit software could run in that mode, and such software could access only the first 1MB or 16MB, depending on how it was written. For example, 16-bit drivers could load into and access only the first 1MB. Also, it is worth noting that the system ROM BIOS, including the POST, BIOS configuration, boot code, and all the internal drivers, is virtually all 16-bit software. This is because all Intel-compatible PC processors begin operation in 16-bit real mode when they are powered on. When a 32-bit operating system loads, it is that operating system code that instructs the processor to switch into 32-bit protected mode.

When an operating system such as Windows is loaded, the processor is switched into 32-bit protected mode early in the loading sequence. Then, 32-bit drivers for all the hardware can be loaded, and then the rest of the operating system can load. In 32-bit protected mode, the operating systems and applications can access all the memory in the system, up to the maximum limit of the processor (64GB for most of the Pentium II and later chips).

Unfortunately, one problem with protected mode is just that: It is protected. The name comes from the fact that only driver programs are allowed to talk directly to the hardware in this mode; programs loaded by the operating system, such as by clicking an icon in Windows, are not allowed to access memory or other hardware directly. This protection is provided so that a single program can't crash the machine by doing something illegal. You might have seen the error message in Windows indicating this, and that the program will be shut down.

Diagnostics software by nature must talk to the hardware directly. This means that little intensive diagnostics testing can be done while a protected mode operating system such as Windows 9x, NT, 2000, XP, Linux, and so forth is running. For system testing, you usually have to boot from a DOS floppy or interrupt the loading of Windows (press the F8 key when Starting Windows appears during the boot process) and select Command Prompt Only, which boots you into DOS. In Windows 9x (but not Me), you can execute a shutdown and select Restart the Computer in MS-DOS mode. Many of the higher-end hardware diagnostics programs include their own special limited 16-bit operating systems so they can more easily access memory areas even DOS would use. With Windows 2000 and XP, you can format a floppy disk with MS-DOS startup files by selecting that option from the Format menu in My Computer.

For example, when you boot from a Windows 9x startup disk, you are running 16-bit DOS, and if you want to access your CD-ROM drive to install Windows, you must load a 16-bit CD-ROM driver program from that disk as well. In this mode, you can do things such as partition and format your hard disk, install Windows, or test the system completely. OEM versions of Windows 98 and all versions of Windows Me and newer come on bootable CDs, so if your system supports booting from a CD-ROM drive, be sure to set that option in the BIOS Setup to eliminate the need for a formatted floppy disk.

The point of all this is that although you might not be running DOS very much these days, at least for system configuration and installation, as well as for high-level hardware diagnostics testing, data recovery, and so forth, you might still have to boot to a 16-bit OS occasionally. When you are in that mode, the system's architecture changes, less memory is accessible, and some of the software you are running (16-bit drivers and most application code) must fight over the first 1MB or even 640KB for space.

The system memory areas discussed in this chapter, including the 384KB at the top of the first megabyte, which is used for video, adapter BIOS, and motherboard BIOS, as well as the remaining extended memory, are all part of the PC hardware design. They exist whether you are running 16-bit or 32-bit software; however, the limitations on their use in 16-bit (real) mode are much more severe. Because most people run 32-bit operating systems, such as Windows 9x, 2000, XP, Linux, and so on, these operating systems automatically manage the use of RAM, meaning you don't have to interact with and manage this memory yourself as you often did with the 16-bit operating systems.

The following sections are intended to give you an understanding of the PC hardware memory layout, which is consistent no matter which operating system you use. The only things that change are how your operating system uses these areas and how they are managed by the OS.

The following sections detail the various types of memory installed on a modern PC. The kinds of memory covered in the following sections include

  • Conventional (base) memory

  • Upper memory area (UMA)

  • High memory area (HMA)

  • Extended memory (XMS)

  • Expanded memory (obsolete)

  • Video RAM memory (part of UMA)

  • Adapter ROM and special-purpose RAM (part of UMA)

  • Motherboard ROM BIOS (part of UMA)

Figure 6.22 shows the logical address locations for a 16-bit or higher system. If the processor is running in real mode, only the first megabyte is accessible. If the processor is in protected mode, the full 16MB, 4096MB, or 65536MB are accessible. Each symbol is equal to 1KB of memory, and each line or segment is 64KB. This map shows the first two megabytes of system memory.

Figure 6.22. The logical memory map of the first 2MB.


See "Processor Modes," p. 47.


Note

To save space, this map stops after the end of the second megabyte. In reality, this map continues to the maximum of addressable memory.


Conventional (Base) Memory

The original PC/XT-type system was designed to use 1MB of RAM. This 1MB of RAM is divided into several sections, some of which have special uses. DOS can read and write to the entire megabyte but can manage the loading of programs only in the portion of RAM space called conventional memory, which was 512KB at the time the first PC was introduced. The other 512KB was reserved for use by the system, including the motherboard and adapter boards plugged into the system slots.

After introducing the system, IBM decided that only 384KB was needed for these reserved uses, and the company began marketing PCs with 640KB of user memory. Therefore, 640KB became the standard for memory that can be used by DOS for running programs and often is termed the 640KB memory barrier. The remaining memory after 640KB was reserved for use by the graphics boards, other adapters, and the motherboard ROM BIOS.

This barrier largely affects 16-bit software, such as DOS and Windows 3.1, and is much less of a factor with 32-bit software and operating systems, such as Windows 9x, NT/2000/XP, and so on.

Upper Memory Area

The term Upper Memory Area (UMA) describes the reserved 384KB at the top of the first megabyte of system memory on a PC/XT and the first megabyte on an AT-type system. This memory has the addresses from A0000 through FFFFF. The way the 384KB of upper memory is used breaks down as follows:

  • The first 128KB after conventional memory is called video RAM. It is reserved for use by video adapters. When text and graphics are displayed onscreen, the data bits that make up those images reside in this space. Video RAM is allotted the address range A0000BFFFF.

  • The next 128KB is reserved for the adapter BIOS that resides in read-only memory chips on some adapter boards plugged into the bus slots. Most VGA-compatible video adapters use the first 32KB of this area for their onboard BIOS. Any other adapters installed can use the rest. For example, SCSI, ATA RAID, and SATA adapters with onboard BIOS chips use a portion of this area to store their BIOSes. Many network adapters also use this area for special-purpose RAM called shared memory. Adapter ROM and special-purpose RAM is allotted the address range C0000DFFFF.

  • The last 128KB of memory is reserved for motherboard BIOS (the basic input/output system, which is stored in read-only RAM chips or ROM). The POST and bootstrap loader, which handles your system at boot-up until the operating system takes over, also reside in this space. Most systems use only the last 64KB (or less) of this space, leaving the first 64KB or more free for remapping with memory managers. Some systems also include the CMOS Setup program in this area. The motherboard BIOS is allotted the address range E0000FFFFF.

Not all the 384KB of reserved memory is fully used on most 16-bit and higher systems. For example, according to the PC standard, reserved video RAM begins at address A0000, which is right at the 640KB boundary. Normally, it is used for VGA graphics modes, whereas the monochrome and color text modes use B0000B7FFF and B8000BFFFF, respectively. Older non-VGA adapters used memory only in the B0000 segment. Different video adapters use varying amounts of RAM for their operations, depending mainly on the mode they are in. To the processor, however, it always appears as the same 128KB area, no matter how much RAM is really on the video card. This is managed by bank switching areas of memory on the card in and out of the A0000BFFFF segments.

Although the top 384KB of the first megabyte was originally termed reserved memory, it is possible to use previously unused regions of this memory to load 16-bit device drivers (such as the ANSI.SYS screen driver that comes with DOS) and memory-resident programs (such as MOUSE.COM, the DOS mouse driver), which frees up the conventional memory they would otherwise require. Note that this does not affect 32-bit device drivers such as those used with Windows 9x, NT/2000/XP, and so forth because they load into extended memory with no restrictions. The amount of free UMA space varies from system to system, depending mostly on the adapter cards installed on the system. For example, most video adapters, SCSI adapters, and some network adapters require some of this area for built-in ROMs or special-purpose RAM use.

Segment Addresses and Linear Addresses

See the "General Troubleshooting and Diagnostics," section in the Technical Reference section of the disc accompanying this book for a discussion of segment and linear addressing.

Video RAM Memory

A video adapter installed in your system uses a portion of your system's first megabyte of memory to hold graphics or character information for display, but this typically is used or active only when in basic VGA mode.

Note that even though a modern video card can have 256MB or more of onboard memory, only 128KB of this memory appears available to the system in the video RAM area. The rest of the memory is accessible only by the video processor (on the video card) directly, or by your system processor via a memory aperture positioned near the 4GB top of the system address space. Because this aperture can be configured differently by various cards, you should consult the technical documentation for your card or video chipset for more information. Most motherboard ROM have BIOS Setup options for controlling the video card memory aperture (used primarily with AGP video cards), but unless you are experiencing some type of problem related to the video card, it is best to leave those options to their default settings.

When in basic VGA mode, such as when at a DOS prompt or when running in Windows safe mode, your processor can directly access up to 128KB of the video RAM from address A0000BFFFFh. All modern video cards also have onboard BIOS normally addressed at C0000C7FFFh, which is part of the memory space reserved for adapter card BIOS. Generally, the higher the resolution and color capabilities of the video adapter, the more system memory the video adapter uses, but again, that additional memory (past 128KB) is not usually accessible by the processor. Instead, the system tells the video chip what should be displayed, and the video chip generates the picture by putting data directly into the video RAM on the card.

In the standard system-memory map, a total of 128KB is reserved for use by the video card to store currently displayed information when in basic VGA modes. The reserved video memory is located in segments A000 and B000. The video adapter ROM uses additional upper memory space in segment C000. Even with the new multiple monitor feature in Windows 98 and later, only one video card (the primary video card) is in the memory map; all others use no low system memory.

Note

The location of video adapter RAM is responsible for the infamous 640KB DOS conventional memory barrier. DOS can use all available contiguous memory in the first megabyte of memory up to the point where the video adapter RAM is encountered. The use of ancient video adapters, such as the MDA and CGA, can enable DOS access to more than 640KB of system memory. For more information, see Chapter 5 of Upgrading and Repairing PCs, 10th Anniversary Edition, included on the disc.

To learn how the older video adapters use the system's memory, see "Obsolete Video Adapter Types," also in Chapter 5 of the 10th Edition.


Video Graphics Array Memory

All VGA-compatible cards, including those running in PCI, PCI Express, or AGP slots, use all 128KB of the system allocated video RAM from A0000BFFFF, but not all at once. This video RAM area is used depending on the mode the card is in. Figure 6.23 shows the VGA adapter memory map.

Figure 6.23. The VGA adapter memory map.


You can see that the typical VGA card uses a full 32KB of space for the onboard ROM containing driver code. Some VGA cards might use slightly less, but this is rare. The video RAM areas are active only when the adapter is in the particular mode designated. In other words, when a VGA adapter is in graphics mode, only segment A000 is used; when it is in color text mode, only the last half of segment B000 is used. Because the VGA adapter is almost never run in monochrome text mode, the first half of segment B000 remains unused (B0000B7FFF). Figure 6.23 shows the standard motherboard ROM BIOS so that you can get an idea of how the entire UMA is laid out with this adapter.

Some systems incorporate the video adapter into the motherboard or even directly in the motherboard chipset. In these systems, even though the video BIOS and motherboard BIOS might be from the same manufacturer, they are always set up to emulate a standard VGA-type adapter card. In other words, the video BIOS appears in the first 32KB of segment C000 just as though a standalone VGA-type card were plugged into a slot. The built-in video circuit in these systems can in many cases be disabled with a switch or jumper or sometimes by simply plugging in a video card. By having the built-in VGA act exactly as though it were a separate card, disabling it allows a new adapter to be installed with no compatibility problems that might arise if the video drivers had been incorporated into the motherboard BIOS.

Adapter ROM and Special-Purpose RAM Memory

The second 128KB of upper memory beginning at segment C000 is reserved for the software programs, or BIOS, on the adapter boards plugged into the system slots. These BIOS programs are stored on special chips known as ROM. Most adapters today use EEPROM or Flash ROM, which can be erased and reprogrammed right in the system without removing the chip or card. Updating the Flash ROM is as simple as running the update program you get from the manufacturer and following the directions onscreen. It pays to check periodically with your card manufacturers to see whether they have Flash ROM updates for their cards.

ROM is useful for semipermanent programs that must always be present while the system is running, and especially for booting. Graphics boards, hard disk controllers, communications boards, and expanded memory boards, for example, are adapter boards that might have adapter ROM. These adapter ROMs are in an area of memory separate from the VGA video RAM and motherboard ROM areas.

On systems based on the 386 CPU chip or higher, memory managers that are included with DOS 6 or third-party programs can load device drivers and memory-resident programs into unused regions in the UMA.

To actually move the RAM usage on any given adapter requires that you consult the documentation for the card. Most ISA cards require that specific switches or jumpers be changed, and the settings will probably not be obvious without the manual. Plug and Play cards allow these settings to be changed by software that comes with the card or the Device Manager program included in Windows.

Video Adapter BIOS

The video adapter ROM BIOS controls the video card during the boot sequence and anytime the system is in basic VGA modes (such as when running DOS). You also are using the video ROM BIOS code whenever you are running Windows in safe mode. All modern video adapters (even AGP cards) use 32KB for their onboard BIOS, from addresses C0000C7FFF.

Depending on the basic VGA mode selected (color text, monochrome text, or VGA graphics), the video card uses some or all of the 128KB of upper memory beginning at segment C000. In addition, graphics cards can contain up to 64MB or more of onboard memory for use in their native high-resolution modes in which to store currently displayed data and more quickly fetch new screen data for display.

Hard Disk Controller and SCSI Host Adapter BIOS

The upper memory addresses C0000DFFFF are also used for the built-in BIOS contained on many hard drive and SCSI controllers. Table 6.22 lists the amount of memory and the addresses commonly used by the BIOS contained on hard drive adapter cards.

Table 6.22. Memory Addresses Used by Various Hard Drive Adapter Cards

Disk Adapter Type

Onboard BIOS Size

BIOS Address Range

Most XT-compatible controllers

8KB

C8000C9FFF

Most AT controllers

None

Drivers in motherboard BIOS

Most standard IDE adapters

None

Drivers in motherboard BIOS

Most enhanced IDE adapters

16KB

C8000CBFFF

Some SCSI host adapters

16KB

C8000CBFFF

Some SCSI host adapters

16KB

DC000DFFFF


The hard drive or SCSI adapter card used on a particular system might use a different amount of memory, but it is most likely to use the memory segment beginning at C800 because this address is considered part of the IBM standard for personal computers. Virtually all the disk controller or SCSI adapters today that have an onboard BIOS allow the BIOS starting address to be easily moved in the C000 and D000 segments. The locations listed in Table 6.22 are only the default addresses that most of these cards use. If the default address is already in use by another card, you have to consult the documentation for the new card to see how to change the BIOS starting address to avoid any conflicts.

Figure 6.24 shows a sample memory map for an Adaptec AHA-2940 SCSI adapter.

Figure 6.24. Adaptec AHA-2940U SCSI adapter default memory use.


Network Adapters

Network adapter cards can also use upper memory in segments C000 and D000. The exact amount of memory used and the starting address for each network card vary with the card's type and manufacturer. Some network cards do not use any memory at all. A network card might have two primary uses for memory. They are as follows:

  • IPL (Initial Program Load or Boot) ROM

  • Shared memory (RAM)

An IPL ROM is usually an 8KB ROM that contains a bootstrap loader program that enables the system to boot directly from a file server on the network. This enables the removal of all disk drives from the PC, creating a diskless workstation. Because no floppy or hard disk is in the system to boot from, the IPL ROM gives the system the instructions necessary to locate an image of the operating system on the file server and load it as though it were on an internal drive.

Shared memory refers to a small portion of RAM contained on the network card that is mapped into the PC's upper memory area. This region is used as a memory window onto the network and offers rapid data transfer from the network card to the system. IBM pioneered the use of shared memory for its first Token-Ring network adapters, and now shared memory is commonly used in other companies' network adapters. Shared memory first was devised by IBM because it found that transfers using the DMA channels were not fast enough in most systems. This mainly had to do with some quirks in the DMA controller and bus design, which especially affected 16-bit ISA bus systems. Network adapters that do not use shared memory use DMA or Programmed I/O (PIO) transfers to move data to and from the network adapter.

Although shared memory is faster than either DMA or PIO for ISA systems, it does require 16KB of UMA space to work. Most standard performance network adapters use PIO because it makes them easier to configure, and they require no free UMA space. However, most high-performance adapters use shared memory. The shared memory region on most network adapters that use one is usually 16KB in size and can be located at any user-selected 4KB increment of memory in segments C000 or D000.

Figure 6.25 shows the default memory addresses for the IPL ROM and shared memory of an IBM Token-Ring network adapter, although many other network adapters, such as Ethernet adapters, are similar. One thing to note is that most Ethernet adapters use either a DMA channel or standard PIO commands to send data to and from the network and don't use shared memory, as many Token-Ring cards do.

Figure 6.25. Network adapter default memory map.


I have also included the standard VGA video BIOS in Figure 6.25 because nearly every system would have a VGA-type video adapter as well. Note that these default addresses for the IPL ROM and the shared memory can easily be changed by reconfiguring the adapter. Most other network adapters are similar in that they also have an IPL ROM and a shared memory address, although the sizes of these areas and the default addresses might be different. Most network adapters that incorporate an IPL ROM option can disable the ROM and socket so that those addresses are not needed at all. This helps conserve UMA space and prevent possible future conflicts if you are never going to use the function.

Note that the Plug and Play feature in Win 9x, Me, 2000, and XP does not attempt to optimize memory use, only to resolve conflicts. Of course, with 32-bit drivers, the locations and sizes of free upper memory blocks don't really matter because 32-bit drivers are loaded into extended memory. If you are still occasionally running DOS-based programs, such as games, you could manually optimize the upper memory area configuration for maximum memory and performance, but for the most part it isn't worth the effort.

Motherboard BIOS Memory

The last 128KB of reserved memory is used by the motherboard BIOS. The BIOS programs in ROM control the system during the boot-up procedure and remain as drivers for various hardware in the system during normal operation. Because these programs must be available immediately, they can't be loaded from a device such as a disk drive.

See Chapter 5, "BIOS," p. 411.


Both segments E000 and F000 in the memory map are considered reserved for the motherboard BIOS, but only some systems actually use this entire area. Older 8-bit systems require only segment F000 and enable adapter card ROM or RAM to use segment E000. Most 16-bit or greater systems use all F000 for the BIOS and might decode but not use any of segment E000. By decoding an area, the motherboard essentially grabs control of the addresses, which precludes installing any other hardware in this region. In other words, configuring adapter cards to use this area isn't possible. That is why you will find that most adapters that use memory simply do not allow any choices for memory use in segment E000. Although this might seem like a waste of 64KB of memory space, any 386 or higher system can use the powerful MMU in the processor to map RAM from extended memory into segment E000 as an upper memory block. The system can subsequently load 16-bit driver software in this UMB if necessary. This is a nice solution to what otherwise would be wasted memory, although it is not important if you use 32-bit drivers.

Figure 6.26 shows the motherboard ROM BIOS memory use of most 16-bit or greater systems.

Figure 6.26. Motherboard ROM BIOS memory use of most systems.


Note that the standard system BIOS uses only segment F000 (64KB). In almost every case, the remainder of the BIOS area (segment E000) is completely free and can be used as UMA block space.

Extended Memory

As mentioned previously in this chapter, the memory map on a system based on the 286 or higher processor can extend beyond the 1MB boundary that exists when the processor is in real mode. On a 286 or 386SX system, the extended memory limit is 16MB (24-bit addressing); on a 386DX, 486, Pentium, or Pentium MMX system, the extended memory limit is 4GB (4,096MB using 32-bit addressing). Systems based on the Pentium Pro, Pentium II, and newer processors have a limit of 64GB (65,536MB using 36-bit addressing).

Note

36-bit memory addressing is enabled through a method called physical address extension (PAE). PAE is an Intel-provided memory address extension that enables support of up to 64GB of physical memory for applications running on most 32-bit Intel Pentium Pro and later processors. PAE enables the processor to expand the number of bits that can be used to address physical memory from 32 bits to 36 bits, but it requires operating system support as well. PAE support for more than 4GB is provided only in server-oriented operating systems such as Windows 2000 and later versions of the Advanced Server and Datacenter Server operating systems. Without PAE support, memory addressing is limited to 32 bits or 4GB of physical RAM.


For a system to address memory beyond the first megabyte, the processor must be in protected modethe native mode of 286 and higher processors. On a 286, only programs designed to run in protected mode can take advantage of extended memory; 386 and higher processors offer another mode, called virtual real mode, which enables extended memory to be, in effect, chopped into 1MB pieces (each its own real-mode session). Virtual real mode also enables several of these sessions to be running simultaneously in protected areas of memory. They can be seen as DOS prompt sessions or windows within Windows 9x/Me, NT, 2000, XP, or OS/2. Although several DOS programs can be running at once, each is still limited to a maximum of 640KB of memory because each session simulates a real-mode environment, right down to the BIOS and Upper Memory Area. Running several programs at once in virtual real mode, called multitasking, requires software that can manage each program and keep them from crashing into one another. OS/2; Windows 9x/Me; and Windows NT, 2000, and XP all do this.

The 286 and higher CPU chips also run in what is termed real mode, which enables full compatibility with the 8088 CPU chip installed on the PC/XT-type computer. Real mode enables you to run DOS programs one at a time on an AT-type system just as you would on a PC/XT. However, an AT-type system running in real mode, particularly a system based on the 386 through Pentium 4 or Athlon, is really functioning as little more than a turbo PC. In real mode, these processors can emulate the 8086 or 8088, but they can't operate in protected mode at the same time. For that reason, the 386 and above also provide a virtual real mode that operates under protected mode. This enables real-mode programs to execute under the control of a protected-mode operating system, such as Win9x/Me or NT/2000/XP.

Note

Extended memory is basically all memory past the first megabyte, which can be accessed only while the processor is in protected mode.


XMS Memory

Microsoft, Intel, AST Corp., and Lotus Development developed the extended memory specification (XMS) in 1987 to specify how programs would use extended memory. The XMS specification functions on systems based on the 286 or higher and enables real-mode programs (those designed to run in DOS) to use extended memory and another block of memory usually out of the reach of DOS.

Before XMS, there was no way to ensure cooperation between programs that switched the processor into protected mode and used extended memory. There was also no way for one program to know what another had been doing with the extended memory because none of them could see that memory while in real mode. HIMEM.SYS becomes an arbitrator of sorts that first grabs all the extended memory for itself and then doles it out to programs that know the XMS protocols. In this manner, several programs that use XMS memory can operate together under DOS on the same system, switching the processor into and out of protected mode to access the memory. XMS rules prevent one program from accessing memory that another has in use. Because Windows 3.x is a program manager that switches the system to and from protected mode in running several programs at once, it has been set up to require XMS memory to function. Windows 9x/Me operates mostly in protected mode, but still calls on real mode for access to many system components. Windows NT, 2000, and XP are true protected-mode operating systems, as is OS/2.

Extended memory can be made to conform to the XMS specification by installing a device driver in the CONFIG.SYS file. The most common XMS driver is HIMEM.SYS, which is included with Windows 3.x and later versions of DOS, starting with 4.0 and up. Windows 9x/Me and NT/2000/XP automatically allow XMS functions in DOS prompt sessions, and you can configure full-blown DOS-mode sessions to allow XMS functions as well.

Note

To learn more about the high memory area and expanded memory, see Chapter 5 of Upgrading and Repairing PCs, 10th Anniversary Edition, on the disc.


Preventing ROM BIOS Memory Conflicts and Overlap

As explained previously, C000 and D000 are reserved for use by adapter-board ROM and RAM. If two adapters have overlapping ROM or RAM addresses, usually neither board operates properly. Each board functions if you remove or disable the other one, but they do not work together.

With many adapter boards, you can change the actual memory locations to be used with jumpers, switches, or driver software, which might be necessary to allow two boards to coexist in one system. This type of conflict can cause problems for troubleshooters. You must read the documentation for each adapter to find out which memory addresses the adapter uses and how to change the addresses to allow coexistence with another adapter. Most of the time, you can work around these problems by reconfiguring the board or by changing jumpers, switch settings, or software-driver parameters. This change enables the two boards to coexist and stay out of each other's way.

Additionally, you must ensure that adapter boards do not use the same IRQ, DMA channel, or I/O port address. You can easily avoid adapter board memory, IRQ, DMA channel, and I/O port conflicts by creating a chart or template to mock up the system configuration by penciling on the template the resources already used by each installed adapter. You end up with a picture of the system resources and the relationship of each adapter to the others.

If you are running a Plug and Play operating system, such as Windows 9x/Me or 2000/XP, you can use the Device Manager to view and optionally print all the device settings. I highly recommend you use this to print out all the settings in your system before and after you make modifications to see what has been changed. This will help you anticipate conflicts and ensures that you configure each adapter board correctly the first time. The template also becomes important documentation when you consider new adapter purchases. New adapters must be configurable to use the available resources in your system.

See "System Resources," p. 381.


If your system has Plug and Play capabilities, and you use PnP adapters, it can resolve conflicts between the adapters by moving the memory usage on any conflict. Unfortunately, this routine is not always intelligent and might require human interventionthat is, manual specification of addresses to achieve the most optimum location for the adapter memory.

ROM Shadowing

Virtually all 386 and higher systems enable you to use what is termed shadow memory for the motherboard and possibly some adapter ROMs as well. Shadowing essentially moves the programming code from slow ROM chips into fast 32-bit system memory. Shadowing slower ROMs by copying their contents into RAM can greatly speed up these BIOS routinessometimes making them four to five times faster.

Note that shadowing ROMs is not very important when running a 32-bit operating system, such as Win9x/Me or NT/2000/XP. This is because those operating systems use the 16-bit BIOS driver code only during booting; then they load 32-bit replacement drivers into faster extended memory and use them. Therefore, shadowing normally affects only DOS or other 16-bit software and operating systems. Because of this, some people are tempted to turn off the Video BIOS shadowing feature in the BIOS setup. Unfortunately, it won't gain you any memory back (you've lost it anyway) and will make the system slightly slower to boot up and somewhat slower when in Windows safe mode. The 16-bit BIOS video driver code is used at those times.

Note

To learn more about ROM shadowing, see Chapter 5 of Upgrading and Repairing PCs, 10th Anniversary Edition, on the disc accompanying this book.


Total Installed Memory Versus Total Usable Memory

Most people don't realize that not all the RAM you purchase and install in a system is available. Because of some quirks in system design, the system usually has to "throw away" up to 384KB of RAM to make way for the Upper Memory Area.

For example, most systems with 16MB of RAM (which is 16,384KB) installed show a total of only 16,000KB installed during the POST or when running Setup. This indicates that 16,384KB16,000KB = 384KB of missing memory! Some systems might show 16,256KB with the same 16MB installed, which works out to 16,384KB16,256KB = 128KB missing.

If you run your Setup program and check out your base and extended memory values, you will find more information than just the single figure for the total shown during the POST. In most systems with 4,096KB (4MB), you have 640KB base and 3,072KB extended. In some systems, Setup reports 640KB base and 3,328KB extended memory, which is a bonus. In other words, most systems come up 384KB short, but some come up only 128KB short.

This shortfall is not easy to explain, but it is consistent from system to system. Say that you have a 486 system with two installed 72-pin (32-bit) 16MB SIMMs. This results in a total installed memory of 32MB in two separate banks because the processor has a 32-bit data bus. Each SIMM is a single bank in this system. The first bank (or SIMM, in this case) starts at address 0000000h (the start of the first megabyte), and the second starts at 1000000 (the start of the seventeenth megabyte).

One of the cardinal rules of memory is that you absolutely cannot have two hardware devices wired to the same address. This means that 384KB of the first memory bank in this system would be in direct conflict with the video RAM (segments A000 and B000), any adapter card ROMs (segments C000 and D000), and of course the motherboard ROM (segments E000 and F000). This means all SIMM RAM that occupies these addresses must be shut off; otherwise, the system will not function! Actually, a motherboard designer can do three things with the SIMM memory that would overlap from A0000FFFFF:

  • Use the faster RAM to hold a copy of any slow ROMs (shadowing), disabling the ROM in the process

  • Turn off any RAM not used for shadowing, eliminating any UMA conflicts

  • Remap any RAM not used for shadowing, adding to the stack of currently installed extended memory

Most systems shadow the motherboard ROM (usually 64KB) and the video ROM (32KB) and simply turn off the rest. Some motherboard ROMs allow additional shadowing to be selected between C8000 and DFFFF, usually in 16KB increments.

Note

You can shadow only ROM, never RAM, so if any card (such as a network card) has a RAM buffer in the C8000DFFFF area, you must not shadow the RAM buffer addresses; otherwise, the card will not function. For the same reason, you can't shadow the A0000BFFFF area because it is the video adapter RAM buffer.


Most motherboards do not do any remapping, which means that any of the 384KB not shadowed is simply turned off. That is why enabling shadowing does not seem to use any memory. The memory used for shadowing would otherwise be discarded in most systems. These systems would appear to be short by 384KB compared to what is physically installed in the system. For example, in a system with 32MB, no remapping would result in 640KB of base memory and 31,744KB of extended memory, for a total of 32,384KB of usable RAM384KB short of the total (32,768KB384KB).

Systems that show 384KB of "missing" memory do not do remapping. If you want to determine whether your system has any missing memory, all you need to know are three things. One is the total physical memory actually installed. Running your Setup program can discover the other two items. You want to know the total base and extended memory numbers recognized by the system. Then simply subtract the base and extended memory from the total installed to determine the missing memory. You usually will find that your system is missing 384KB, but you could be lucky and have a system that remaps 256KB of what is missing and thus shows only 128KB of memory missing.

Virtually all systems use some of the missing memory for shadowing ROMs, especially the motherboard and video BIOS, so what is missing is not completely wasted. Systems missing 128KB will find that it is being used to shadow your motherboard BIOS (64KB from F0000 to FFFFF) and video BIOS (32KB from C0000 to C8000). The remainder of segment C0000 (32KB from C8000 to CFFFF) is simply being turned off. All other segments (128KB from A0000 to BFFFF and 128KB from D0000 to EFFFF) are being remapped to the start of the fifth megabyte (40000043FFFF). Most systems simply disable these remaining segments rather than take the trouble to remap them.

Note that with the relatively large amount of memory in modern PCs, losing a paltry 384KB hardly has an impact on performance. Also, because shadowing has a performance benefit only when running under a 16-bit OS such as DOS, systems running Windows aren't affected by any changes to the shadowing settings. If these settings are present in your BIOS Setup, I usually recommend they be left at default settings.

Adapter Memory Configuration and Optimization

Adapter boards use upper memory for their BIOS and as working RAM. If two boards attempt to use the same BIOS area or RAM area of upper memory, a conflict occurs that can keep your system from booting. In most cases, the plug-and-play software in the operating system ensures that such cards are automatically reconfigured so that they are not in conflict; however, sometimes problems can occur and you must step in and manually resolve a conflict. The following sections cover ways to avoid these potential unresolved conflicts and how to troubleshoot if they do occur. In addition, these sections discuss moving adapter memory to resolve conflicts and provide some ideas on optimizing adapter memory use.

How to Determine What Adapters Occupy the UMA

You can determine which adapters are using space in upper memory in the following two ways:

  • Study the documentation for each adapter on your system to determine the memory addresses they use.

  • Use a software utility or the Device Manager in your operating system to determine which upper memory areas your adapters are using.

The simplest way (although by no means always the most foolproof) is to use a software utility to determine the upper memory areas used by the adapters installed on your system. The Device Manager in the Windows 9x/Me and 2000/XP Control Panel supplies this information in great detail, as does the System Information utility (MSInfo32) that comes with Windows 98 and later. These utilities examine your system configuration and determine not only the upper memory used by your adapters, but also the IRQs used by each of these adapters.

True plug-and-play systems also shut down one of the cards involved in a conflict to prevent a total system lockup. This could cause Windows to boot in safe mode.

After you run Device Manager, System Information, or another utility to determine your system's upper memory configuration, make a printout of the memory addresses used. Thereafter, you can quickly refer to the printout when you are adding a new adapter to ensure that the new board does not conflict with any devices already installed on your system.

Moving Adapter Memory to Resolve Conflicts

After you identify a conflict or potential conflict using one of the two methods discussed in the previous section, you might have to reconfigure one or more of your adapters to move the upper memory space used by a problem adapter.

Most non-PnP adapter boards make moving adapter memory a somewhat simple process, enabling you to change a few jumpers or switches to reconfigure the board. With plug-and-play cards, use the configuration program that comes with the board or the Windows Device Manager to make the changes. The following steps help you resolve most problems that arise because adapter boards conflict with one another:

1.

Determine the upper memory addresses currently used by your adapter boards and write them down.

2.

Determine whether any of these addresses are overlapping, which results in a conflict.

3.

Consult the documentation for your adapter boards to determine which boards can be reconfigured so that all adapters have access to unique memory addresses.

4.

Configure the affected adapter boards so that no conflict in memory addresses occurs.

For example, if one adapter uses the upper memory range C8000CBFFF and another adapter uses the range CA000CCFFF, you have a potential address conflict. One of them must be changed. Note that plug-and-play cards allow these changes to be made directly from the Windows Device Manager.




Upgrading and Repairing PCs
Upgrading and Repairing PCs (17th Edition)
ISBN: 0789734044
EAN: 2147483647
Year: 2006
Pages: 283
Authors: Scott Mueller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net