Michael Maardt: PC since 1984 • on the net since 1990.

Memory

Some of the following is rather technical and can be skipped. Memory is where the PC stores information. It uses two types of memory: RAM and ROM.

ROM (Read Only Memory) is not discussed in great detail in this guide. ROM is a fixed form of memory (built into electronic chips) that "remembers" certain parts of the operating system. Other ROM is in physical parts of the PC like the graphics adapter and the hard-disk controller.

RAM (Random Access Memory) is the volatile memory that?s available for calculations while the PC is switched on. The CPU (Central Processing Unit) uses and processes data in the RAM, where the contents are constantly changing.

First, something about the allocation of RAM in a PC, a complex subject, if the operating system is DOS. Computers, as we have noted, use the binary system. You will often come across numbers raised to the power of two: 2, 4, 8, 16, 32, 64, 128, 256, 512 bytes and so on. When you get to 1024 bytes, it is called 1 kilobyte (KB or K); thereafter you follow the same pattern of 2, 4 ... up to 1024 KB, which is equal to one MegaByte (MB), and so on until you reach 1024 MB = 1 GigaByte (GB).

When IBM built the first PC, they did not think that it would become the success it is and so they figured that 1 MB (1024 KB), with 640 KB set aside for programs, would be adequate memory for all purposes.

Let?s look at the first MB of RAM, the first 1024 KB. Imagine a giant bookshelf with lots of spaces for identical books. Each space is the space for one byte and has what is called an address. What follows describes how these areas are defined and treated.

The work of the CPU consists mainly of moving all these bytes around between the hard disk, itself, RAM, the monitor, etc. ? fast. Virtually all communication in a computer ? the transport of data between the different units (devices) ? has to go via the CPU. Monitor, keyboard, disk, and so on are physical devices, but other "logical" or abstract parts of a PC can also be "devices." As we shall see later, all devices must be controlled, or handled, by a special program called a device driver (or simply driver). It took me years to understand the strange concept of a device!

DOS, which was originally created for the old 8086 processor, can only "see" the first MB. When the processor runs in its most primitive mode, real mode, it can only "see" this area in RAM. DOS is a real-mode program. When you boot your PC, the processor "wakes up" in this real mode and looks around for its partner, DOS. That?s how it has been ever since DOS arrived on the scene.

If you want more from your PC than real mode and DOS, which can only use 1 MB, you have to build on these foundations.

So as not to exclude the 8086 and 80286 and other early PC versions, DOS 5 and 6 are still real-mode programs and are "backward compatible," which means that all programs written for earlier versions still work with newer versions.

To use RAM above 1 MB, you need a program that makes the processor run in what is called protected mode. Protected means stopping two programs that are using RAM simultaneously from trying to use the same areas of RAM. The 80286 was the first processor that was able to run in protected mode as well as in real mode.

The processor can only be in one mode at a time and it takes time to change between real and protected mode.

A CPU works at a certain speed, called its clock frequency, which is the number of pulses per second that the current flows (Hertz). This is typically a figure like 33, 40, 75, 90, 133 or higher, measured in MHz (millions of Hertz ? not a misprint, it really is millions of times a second!!).

Forms of memory

This section is rather technical, but helps you to understand what is going on before we get to the start files.

1024- extended

high=first 64 K

640-1024 upper
0-640 conventional

Conventional memory

The area in memory from 0-640 KB is called conventional memory or lower memory. This is where most of the work is done. DOS is the memory manager for conventional memory (it controls it).

Upper memory area


 

This section is included because it is important, when you use DOS 5 or higher. From DOS 5 onwards, it is possible to load certain programs into upper memory ? which is an address area. This frees more space in conventional memory to run DOS programs.

Don?t worry if you don?t understand a thing. I have not understood all the details myself yet but each time I write about it I understand a little more ? I hope ? and I have worked intensively with this for many months.

Sometimes I wonder how on earth sensible people could have constructed a PC with an operating system, memory, and so on as difficult as it is ? but they have. Part of the problem is that, regrettably, IBM couldn?t foresee the future many years ago!

IBM wisely reserved the address area from 640-1024 (384 KB) for system, technical and future purposes. This reserved address area in memory from 640-1024 KB is called, by most people, upper memory. IBM and Hewlett-Packard sometimes refer to it as reserved memory ? when the terms high and upper memory were introduced, the industry was in some confusion!

Upper memory area is the name for an address area. There are rules as to where in upper memory the different devices must place their data so that the CPU can have direct access to communicate with them ? the marked areas on the chart show where.

But the whole area is not occupied completely; the vacant space left amongst these addresses can be used for drivers and resident (TSR) programs. Resident means that the program is permanently in RAM and there is no need to call it from the hard disk every time it is used. Resident programs are also called TSR (Terminate and Stay Resident).

The interesting thing is that the area lies within the reach of DOS and real mode. DOS can see and control/communicate with them, so DOS drivers and DOS resident programs can be run in this address area.

In recent years, methods have been developed to allow DOS to place some of its files in this address area. DOS does this using EMM386.EXE, which can provide this access ? this text does not deal with programs such as QEMM, 386MAX and Netroom.

The term upper memory area is not the same as Upper Memory Blocks (UMB), although these blocks ? if created, for example, by EMM386.EXE ? are from the memory point of view situated in upper memory?s address area. Upper memory is a name for an address area. UMB is real useable RAM in this area.

The memory manager for upper memory can be either HIMEM.SYS or DOS. In the early stages of the booting procedure, HIMEM.SYS is the memory manager. The usual thing though is for DOS to take over as memory manager via the command DOS=UMB inserted in CONFIG.SYS.

The illustration is an example of how upper memory can look on a PC, and can maybe help you if you begin to investigate where in this area different programs load themselves.

IBM PS/2 puts BIOS ROM in the two "top" areas, i.e. E and F page. VGA BIOS ROM is placed from E000-E7FF. This leaves the area C000-E000 free for UMBs.

Expanded and extended memory

It is important to distinguish between the physical RAM or memory and the abstract names (upper, extended, etc.) for the way physical RAM is used. If, for instance, you have 4 MB of physical RAM, you can use this in many different ways. This section deals with this. To specify the way in which it is used, you speak of configuring memory.

In the "old days," the use of memory above 1 MB started primarily with the Lotus spreadsheet Lotus 1-2-3, with users soon hit the ceiling of the 640 KB, which was the limit for DOS programs. Lotus, Intel and Microsoft developed rules for how their version of expanded memory should be used. This standard was called Expanded Memory Specification (EMS) or LIM EMS.

At this time, extra memory cards were manufactured to put in the PC. Primarily older programs are able to use this form of memory, though even many newer games need EMS memory (see Multiple Boots, page *) A memory manager for expanded memory is called an Expanded Memory Manager (EMM). DOS has one of these called EMM386.EXE.

Later, another standard for using memory over 1 MB was introduced: eXtended Memory Specifications (XMS). It is most unfortunate that the names are almost identical. This is more relevant to most users today as newer programs are primarily written to use extended memory, which also requires a memory manager, a so-called XMM. DOS has one, HIMEM.SYS.

These terms are the names given to the use of physical RAM. They are standardized rules. So RAM above 1 MB can be used as a combination of different forms of memory ? but not until the relevant memory manager is active and able to control how much to use and for what. Expanded memory is also called EMS memory, and when it is available, it is configured according to published standards.

High memory area (HMA)

The High Memory Area (HMA) is defined as the first 64 KB of extended memory, from 1024-1088 KB. Using a little trick, this area has become available as if it belonged to the first MB, so DOS can use it. Most people use this area to place parts of DOS using DOS=HIGH. Naturally, the memory manager for this area is HIMEM.SYS, as it handles all memory above 1 MB. So HIMEM.SYS controls both high memory (area) and extended memory.

MEM/A is the only DOS 6.x command that tells you how this area is being used. The switch is undocumented.

(A) HMA is apparently "a part" of extended memory ? yes and no: HMA is available to the processor in real mode while extended memory is only available to the processor in protected mode.

How upper and extended memory work together

(A)Upper Memory borrows the actual RAM from extended memory.

In the jargon, extended memory is mapped to upper memory?s address area, i.e. the CPU is led to believe that certain addresses are in a certain place, though physically they are somewhere else.

For example, if you want access to, say, 92 KB of upper memory, it is borrowed from extended memory, which therefore is 92 KB smaller. Try writing REM at the beginning of the line in CONFIG.SYS containing EMM386 and see the result of MEM. Delete the REM again, boot up and check MEM. The sum of upper memory + extended memory is the same!

Devices

All these forms of memory, except conventional memory, are "a device" in the same way as a monitor, keyboard, printer, etc., and so these forms of memory require a device driver in the same way that other devices do.

There are both purely physical and what I call logical, or abstract, devices. The monitor and the keyboard are in themselves not devices but the logical term con or console is a device that refers to the two physical objects, an input and an output object.

The term console comes from the days of the original mainframe computers. These had no monitor or separate keyboards but received input and wrote out their results through a kind of telex machine. This machine, called the console, was used for all input to and output from the computer.

Facebook Twitter Google LinkedIn Emailemail to friend

You are on michaelmaardt.com • © Michael Maardt 21. Jul. 2018