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 4–based 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), 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 (64TB 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 here, 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 articles 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 articles detail the various types of memory installed on a modern PC. The kinds of memory covered in the following articles include:
-
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)
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.