[ Team LiB ] Previous Section Next Section

Logical Organization

Some people fall into the egregious habit of thinking all memory is alike. Nefarious computer vendors are particular culprits. They are likely to lump together anything inside a computer involving memory chips as memory, implying that you can use it for running your programs. To them memory is memory, and that's that. But all memory is not the same. The random access memory used for running software gets divvied up among multiple functions inside your computer, putting it off-limits to your applications. You often end up with less usable memory than you might think you have inside your computer.

Some of your computer's RAM is compartmentalized for special functions. Computers with Intel microprocessors reserve a megabyte simply for getting started. Windows assigns other chunks for its own functions. Engineers describe this compartmentalization of RAM with a memory map, a graphic representation of the addresses of memory reserved for particular purposes.

In addition to RAM, most computers have other kinds of memory that's physically distinct and dedicated to specific purposes. This memory often is not within the contiguous addressing range of your computer's microprocessor. For example, the primary and secondary caches in your computer's microprocessor are chunks of memory, and each has its own dedicated purpose. High-performance interface cards may also include a megabyte or more of cache. The video systems of most computers also include a block of memory reserved as a frame buffer.

The result is that computers are stuck with a hierarchy of memory types, each with different capabilities and compatibilities—some useful to some applications, some useless to all but a few. Rather than improving with age, every advance adds more to the memory mix up. The classification of memory depends, in part, on the operating system that you run. Part of modern operating systems is memory management software that smoothes over the differences in memory type.

Real Mode Memory

The basic memory in any Intel-architecture computer is that which can be addressed by your computer's microprocessor while it is running in real mode—a special limited operating mode that's chiefly used today as your computer boots up. All Intel-architecture microprocessors start up in real mode.

For today's microprocessors based on the Intel design to be backward compatible and able to run other software, they must mimic the memory design of the original 8086 family. The hallmark of this design is the real operating mode in which they must begin their operation. Because of the original Intel 8086 microprocessor design, real mode only allows for 1MB of memory. Because it serves the host microprocessor operating in its real mode, this starting memory is termed real mode memory.

The address range used by real mode memory starts at the very beginning of the address range of Intel microprocessors—zero. The last address is one shy of a megabyte because counting starts at zero instead of one (that is 1,048,575 in decimal, expressed in hexadecimal as 0FFFFF). Because this memory occurs at the base or bottom of the microprocessor address range, it is also called base memory.

The first 640KB of real-mode memory is sometimes called lower memory or DOS memory, because only this small chunk was usable by programs running under DOS, the early personal computer operating system. The rest of the real mode addressing range above lower memory is called, logically enough, upper memory. In most computers, the top 32KB of upper memory addresses are occupied by the ROM holding the BIOS code of the system.

The BIOS uses the first kilobyte of space for remembering information about the system and the location of certain sections of code that are executed when specific software interrupts are made. Among other functions, this memory range holds data used by BIOS functions, and it is consequently called the BIOS data area.

A design quirk in Intel microprocessors allows them to address extra memory, a total of 64KB minus 16 bytes, above the real mode memory area. Called the high memory area, this memory cannot be used by ordinary DOS programs but was exploited by the operating system before today's versions of Windows (which run in protected mode) became popular.

Protected Mode Memory

The rest of the memory that can be addressed by modern microprocessors is termed protected mode memory. As the name implies, this memory can be addressed only when the microprocessor is running in its protected mode. The address range of protected mode memory stretches from the top of real mode memory to the addressing limit of your microprocessor. In other words, it starts at 1MB—1,048,576 or 100000(hex)—and extends to 16MB for 286 microprocessors, to 4GB for 386 through Pentium Pro and Celeron microprocessors, and to 64GB with the Pentium II, III, and 4 microprocessors (including the Xeon offshoots). Contrasted with base memory, protected mode memory is sometimes called extended memory.

Frame Buffer Memory

Computer video systems are memory mapped, which means the color of every pixel on your monitor gets stored in a memory location that your computer's microprocessor can directly alter, the same way it writes data into memory. Your computer holds a complete image frame in memory. Your video system scans the memory address by address to draw an image frame on your monitor screen. The memory that holds a complete image frame is termed a frame buffer.

Although the frame buffer in most video adapters is physically distinct from ordinary system RAM, it is usually mapped into a block of addresses in the range used by RAM. This mapping affords the microprocessor the fastest possible access to video memory.

A memory aperture is the address range used by computer peripherals for memory-mapped input/output operation and control, with one of the most common uses being to reach the frame buffer. That is, your computer sends data to the frame buffer by writing to the range of addresses in the aperture. The video controller picks up the data there, converts it to video, and passes it along to your monitor.

Unified Memory Architecture

Some computers do not use physically distinct frame buffers. Instead, they use a block of system RAM as the frame buffer, a design called Unified Memory Architecture, sometimes abbreviated as UMA. This design unifies the memory in a computer by moving the video frame buffer from its privileged position, connected through a bus to the video controller, to part of the main memory of the computer. In other words, part of the memory of the system gets allocated for storing video images. Because both the microprocessor and video controller have access to this memory, it is sometimes called shared memory architecture.

The chief attraction of this design is that it cuts the cost of a computer. Manufacturers no longer need to pay for video board memory. But because some of the memory in a UMA system must be given over to the video buffer, it is not available to your applications. Hence, a UMA system acts as if its has less memory than the specification sheet implies.

To the digital logic of your computer's microprocessor, the UMA design appears no different from a conventional video system. The frame buffer appears in the same logical location as always. If it did not, your applications would not be able to access it.

Shadow Memory

Although microprocessors used 64-bit data buses, most ROM chips allowed only an eight-bit connection. Consequently, microprocessors would slow down to about one-eighth speed to access code in ROM, which includes the system BIOS. Before Windows was widely adopted, the BIOS code was some of the most used by computer operations, so the slow access to ROM severely slowed system operations.

To break through this speed barrier, computer designers created shadow memory, a block of system RAM containing a copy of the contents of the eight-bit BIOS. The software controlling the shadow memory rerouted calls to the BIOS to the fast-memory copy, speeding up system operation. Although the BIOS is essentially ignored by all recent versions of Windows, most systems retain shadow memory capabilities. Most BIOS setup procedures allow you to switch on or off the shadowing of various memory ranges. Switching on shadowing brings no benefit when running Windows and can interfere with the operation of some programs. Consequently, shadow memory is best left off.

    [ Team LiB ] Previous Section Next Section