Memory Allocation
Memory Layout
The original IBM PC (based on the Intel 8088 8-Bit processor) was only capable of addressing up to 1MB of system memory. The top 384KB (called the Upper Memory Area, or UMA) of memory was reserved for use by the system to communicate with the installed devices, such as the video card, and the system BIOS. This left us with 640KB of usable memory for the operating system, programs and device drivers. Any additional memory beyond this point was not addressable by any processor. This is commonly referred to as "The conventional memory barrier".
Older software could not run on later processors such as the Intel 286 that were not compatible with the older 8088. No software companies were willing to write all new software because it would break backwards compatibility with older systems, so what good was the ability to address 16MB of RAM if you could only take advantage of 1MB of it? For the sake of backwards compatibility with older software, the 286 could function in what became known as "Real Mode", in which it was essentially pretending (emulating) to be an 8088, with all the limitations of an 8088, including the 1MB memory limit.
It's a feature!
Early on, IBM programmers found a small bug in the 286 that left the A20 address line active, which caused problems with real mode operation. They developed a method to allow this to be turned on and off by using some unused control functions on the keyboard controller chip so that 286 and higher processors could correctly emulate the 8088 while still maintaining the ability to turn it back on for protected mode operation.
Microsoft realized that they could turn this bug into a "feature" and wrote the program "Himem.sys" to take control of the GateA20 line, opening up the 64K High memory area while still maintaining correct emulation of the 8088. This "free" memory could be used to control access to memory above 1MB without switching the processor to protected mode operation, and could even be used to store some programs, such as DOS. The problem was that there was no agreed upon standard for programs to use memory above 1MB, and the processor was unable to directly access this memory (since it was in Real Mode). In turn Microsoft created the "Expanded Memory Specification" (EMS). Himem.sys controlled the memory, and doled it out to programs that knew the EMS protocol. Only one memory segment could be worked on at a time, which made EMS very inefficient.