Conventional storage

from Wikipedia, the free encyclopedia

The first 640 KiB (1 KiB = 1024 bytes) of working memory of an IBM PC-compatible computer is called conventional memory .

The 640 KiB limit

At the beginning of the 1980s, when designing the architecture of the IBM PC, an address space of 640 KiB was provided for main memory, as this was felt to be sufficient for the typical user - it was ten times the address space of most other small computers on the market at the time - and that The first PC model, the IBM 5150 , was initially delivered with a maximum of 64 KiB (65536 bytes) of actually installed memory. In addition, the Intel 8088 processor used only allowed a maximum address space of 1024 KiB; the upper 384 KiB were reserved for ROM and memory mapped I / O , leaving 640 KiB of address space for the RAM main memory. Back then, nobody expected that the IBM PC architecture would last until this limit was exhausted; Most of the other computer architectures of the time disappeared from the market after a few years.

However, the PC architecture survived, and as time went on, this limit became more of an obstacle, as it persisted when the PCs had more RAM. With the Intel 80286 processor of the IBM AT from 1984, an address space of 16 MiB (1 MiB = 1024 KiB) could be addressed in Protected Mode , but the PC architecture had to retain the original memory allocation for reasons of compatibility . The RAM memory at addresses A0000 hex to FFFFF hex could therefore not be used without further ado. Some PC chipsets support what is known as remapping for this purpose , which displays this memory at higher addresses. Like the entire memory area above the 1 MiB limit, such a relocated memory could not be used in real mode (with the exception of the first 65520 bytes, the so-called high memory area ). A change from Real Mode to Protected Mode changed the behavior of the CPU so much that there was no longer any compatibility; The MS-DOS operating system, which was popular at the time, as well as its imitators and the applications executed under it, therefore had to continue to run in real mode. DOS, however, offered special functions to address this memory at least as a data memory (see XMS ); for this, the processor was temporarily switched to protected mode by the operating system and then a data block was copied from the conventional memory to the area over 1 MiB or vice versa, followed by a switch back to real mode. Real-mode program code could thus be temporarily stored in the XMS memory, but could not be executed there directly.

Starting with the 386 processor, there was a third operating mode, the Virtual 8086 Mode , which made it possible to use the virtual memory management of the Protected Mode to overcome the division of the physical address space prescribed by the PC architecture and the entire 1 MiB address space, which is defined by DOS was visible from, to be mapped to physically available RAM, but in contrast to normal protected mode, compatibility with real mode was maintained. This meant that those parts of the area between the 640 KiB limit and the 1 MiB limit that were not required for addressing hardware could be used for program and data storage. In MS-DOS there were again separate memory management functions for this (see Upper Memory Block ). However, since normal DOS programs rarely made use of this, this area was mainly used by the DOS kernel itself and by loadable device drivers. These no longer occupy the scarce and thus valuable memory area below the 640 KiB limit, so that there was more free for the application programs.

Storage optimization

The upper 384 KiB of the address space of the 8086 CPU reserved for system purposes, unlike the 640 KiB for user programs, turned out to be oversized; they were hardly ever fully used, mostly between 128 and 256 KiB of them remained free. In this starting position, the idea developed to use the unused part of the 384 KiB for device drivers, for example, which became possible from 1990 with the publication of MS-DOS 5.0 .

By loading device drivers or TSR programs into this so-called upper memory block (or, if unnecessary, removing them completely from the memory), the memory space required by these drivers / programs is available again as conventional memory, i.e. H. of the 640 KiB more memory is left for application programs. To simplify the process, batch files or boot disks containing the required drivers and settings can be created. The information required for this was in the (game) documentation. In later versions of MS-DOS a tool called MemMaker (RamBoost in PC DOS ) was included that could partially automate this optimization.

DOS Protected Mode Interface

With the help of so-called DOS extenders , the 640 KiB memory limit can be bypassed. One of the first computer games to use this technique was Doom by id Software .

Situation with 32/64-bit operating systems

Windows 9x only boots if there is enough conventional memory free, after that the conventional memory (except when DOS applications are started) no longer plays a role. With modern 32/64-bit operating systems, such as Microsoft Windows NT- based operating systems, the 640 KiB memory limit is no longer relevant for applications, since memory access is always in protected mode . Although there is still a “hole” in the memory area between 640 KiB and 1024 KiB on the lowest level of physical addresses, only bootloaders and operating system programmers need to be aware of this, as it is invisible to application programs. However, this 384 KiB RAM cannot be used, which is negligible with modern computers.

Modern equivalent problem

When using 4 GiB (1 GiB = 1024 MiB) or more memory, the basic problem returns in the form of a 4 GB limit : the maximum addressable address space of 32 bits is 4 GiB, in which hardware registers must appear in addition to the RAM . The division of the address space into system RAM and address areas for additional hardware is dynamic and depends on the chipset on the motherboard and the additional hardware, such as PCI cards. With a 4 GiB memory expansion, the usable main memory varies between a maximum of approx. 2.75 to 3.5 GiB memory.

If the BIOS and the chipset support this, the main memory, which is covered by hardware resources, can be remapped to addresses beyond the 4 GiB limit. If both the operating system and the processor master PAE , this memory can be accessed beyond the 4 GiB limit.

However, in all 32-bit operating systems, the address space that can be used per process without “tricks” is fundamentally limited to 4 GiB, of which 1 to 2 GiB are required for the operating system itself, depending on the system, so that a maximum of 2 to 3 GiB memory is really per process are usable. This also applies to 32-bit applications that are executed in a 64-bit operating system (see e.g. WOW64 ).

See also