Extended memory

Last updated

Extended memory is located above 1 MB. IBM PC Memory areas.svg
Extended memory is located above 1 MB.

In DOS memory management, extended memory refers to memory above the first megabyte (220 bytes) of address space in an IBM PC or compatible with an 80286 or later processor. The term is mainly used under the DOS and Windows operating systems. DOS programs, running in real mode or virtual x86 mode, cannot directly access this memory, but are able to do so through an application programming interface called the Extended Memory Specification (XMS). This API is implemented by a driver (such as HIMEM.SYS) or the operating system, which takes care of memory management and copying memory between conventional and extended memory, by temporarily switching the processor into protected mode. In this context, the term "extended memory" may refer to either the whole of the extended memory or only the portion available through this API.

Contents

Extended memory can also be accessed directly by DOS programs running in protected mode using VCPI or DPMI, two (different and incompatible) methods of using protected mode under DOS.

Extended memory should not be confused with expanded memory (EMS), an earlier method for expanding the IBM PC's memory capacity beyond 640 kB (655,360 bytes) using an expansion card with bank switched memory modules. Because of the available support for expanded memory in popular applications, device drivers were developed that emulated expanded memory using extended memory. Later two additional methods were developed allowing direct access to a small portion of extended memory from real mode. These memory areas are referred to as the high memory area (HMA) and the upper memory area (UMA; also referred to as upper memory blocks or UMBs).

Overview

On x86-based PCs, extended memory is only available with an Intel 80286 processor or higher. Only these chips can address more than 1 megabyte of RAM. The earlier 8086/8088 processors can make use of more than 1 MB of RAM if one employs special hardware to make selectable parts of it appear at addresses below 1 MB.

On a 286 or better PC equipped with more than 640 kB of RAM, the additional memory would generally be re-mapped above the 1 MB boundary, since the IBM PC architecture reserves addresses between 640 kB and 1 MB for system ROM and peripherals.

Extended memory is not accessible in real mode (except for a small portion called the high memory area). Only applications executing in protected mode can use extended memory directly. A supervising protected-mode operating system such as Microsoft Windows manages application programs' access to memory. The processor makes this memory available through the Global Descriptor Table (GDT) and one or more Local Descriptor Tables (LDTs). The memory is "protected" in the sense that memory segments assigned a local descriptor cannot be accessed by another program because that program uses a different LDT, and memory segments assigned a global descriptor can have their access rights restricted, causing a processor exception (e.g., a general protection fault or GPF) on violation. This prevents programs running in protected mode from interfering with each other's memory.

A protected-mode operating system such as Microsoft Windows can also run real-mode programs and provide expanded memory to them. The DOS Protected Mode Interface (DPMI) is Microsoft's prescribed method for an DOS program to access extended memory under a multitasking environment.

Extended Memory Specification (XMS)

The Extended Memory Specification (XMS) is the specification describing the use of IBM PC extended memory in real mode for storing data (but not for running executable code in it). Memory is made available by extended memory manager (XMM) software such as HIMEM.SYS. The XMM functions are accessible through software interrupt 2Fh function 4310h.

XMS version 2.0, released in July 1988, allowed for up to 64 MB of memory, with XMS version 3.0 this increased to 4 GB (232 bytes). To differentiate between the possibly different amount of memory that might be available to applications, depending on which version of the specification they were developed to, the latter may be referred to as super extended memory (SXMS).

The extended memory manager is also responsible for managing allocations in the high memory area (HMA) and the upper memory area (UMA; also referred to as upper memory blocks or UMBs). In practice the upper memory area will be provided by the expanded memory manager (EMM), after which DOS will try to allocate them all and manage them itself.

See also

Related Research Articles

A terminate-and-stay-resident program is a computer program running under DOS that uses a system call to return control to DOS as though it has finished, but remains in computer memory so it can be reactivated later. This technique partially overcame DOS's limitation of executing only one program, or task, at a time. TSRs are used only in DOS, not in Windows.

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20-bit segmented memory address space and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. Real mode provides no support for memory protection, multitasking, or code privilege levels.

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as virtual memory, paging and safe multi-tasking designed to increase an operating system's control over application software.

<span class="mw-page-title-main">A20 line</span> Signal in the system bus of an x86-based computer system

The A20, or address line 20, is one of the electrical lines that make up the system bus of an x86-based computer system. The A20 line in particular is used to transmit the 21st bit on the address bus.

<span class="mw-page-title-main">Bank switching</span> A technique to increase the amount of usable memory

Bank switching is a technique used in computer design to increase the amount of usable memory beyond the amount directly addressable by the processor instructions. It can be used to configure a system differently at different times; for example, a ROM required to start a system from diskette could be switched out when no longer needed. In video game systems, bank switching allowed larger games to be developed for play on existing consoles.

<span class="mw-page-title-main">DOS memory management</span>

In IBM PC compatible computing, DOS memory management refers to software and techniques employed to give applications access to more than 640 kibibytes (KiB) of "conventional memory". The 640 KiB limit was specific to the IBM PC and close compatibles; other machines running MS-DOS had different limits, for example the Apricot PC could have up to 768 KiB and the Sirius Victor 9000, 896 KiB. Memory management on the IBM family was made complex by the need to maintain backward compatibility to the original PC design and real-mode DOS, while allowing computer users to take advantage of large amounts of low-cost memory and new generations of processors. Since DOS has given way to Microsoft Windows and other 32-bit operating systems not restricted by the original arbitrary 640 KiB limit of the IBM PC, managing the memory of a personal computer no longer requires the user to manually manipulate internal settings and parameters of the system.

In computing, the DOS Protected Mode Interface (DPMI) is a specification introduced in 1989 which allows a DOS program to run in protected mode, giving access to many features of the new PC processors of the time not available in real mode. It was initially developed by Microsoft for Windows 3.0, although Microsoft later turned control of the specification over to an industry committee with open membership. Almost all modern DOS extenders are based on DPMI and allow DOS programs to address all memory available in the PC and to run in protected mode.

<span class="mw-page-title-main">Expanded memory</span>

In DOS memory management, expanded memory is a system of bank switching that provided additional memory to DOS programs beyond the limit of conventional memory (640 KiB).

<span class="mw-page-title-main">Conventional memory</span> First 640K of RAM under DOS

In DOS memory management, conventional memory, also called base memory, is the first 640 kilobytes of the memory on IBM PC or compatible systems. It is the read-write memory directly addressable by the processor for use by the operating system and application programs. As memory prices rapidly declined, this design decision became a limitation in the use of large memory capacities until the introduction of operating systems and processors that made it irrelevant.

<span class="mw-page-title-main">High memory area</span>

In DOS memory management, the high memory area (HMA) is the RAM area consisting of the first 65520 bytes above the one megabyte in an IBM AT or compatible computer.

Quarterdeck Expanded Memory Manager (QEMM) is a memory manager produced by Quarterdeck Office Systems in the late 1980s through the late 1990s. It was the most popular third-party memory manager for the MS-DOS and other DOS operating systems.

In x86 computing, unreal mode, also big real mode, huge real mode, flat real mode, or voodoo mode is a variant of real mode, in which one or more segment descriptors has been loaded with non-standard values, like 32-bit limits allowing access to the entire memory. Contrary to its name, it is not a separate addressing mode that the x86 processors can operate in. It is used in the 80286 and later x86 processors.

A DOS extender is a computer software program running under DOS that enables software to run in a protected mode environment even though the host operating system is only capable of operating in real mode.

EMM386 is the expanded memory manager of Microsoft's MS-DOS, IBM's PC DOS, Digital Research's DR-DOS, and Datalight's ROM-DOS which is used to create expanded memory using extended memory on Intel 80386 CPUs. There also is an EMM386.EXE available in FreeDOS.

LOADALL is the common name for two different, undocumented machine instructions of Intel 80286 and Intel 80386 processors, which allow access to areas of the internal processor state that are normally outside of the IA-32 API scope, like descriptor cache registers. The LOADALL for 286 processors is encoded 0Fh 05h, while the LOADALL for 386 processors is 0Fh 07h.

<span class="mw-page-title-main">Upper memory area</span> Physical memory region on IBM PC compatibles

In DOS memory management, the upper memory area (UMA) is the memory between the addresses of 640 KB and 1024 KB (0xA0000–0xFFFFF) in an IBM PC or compatible. IBM reserved the uppermost 384 KB of the 8088 CPU's 1024 KB address space for BIOS ROM, Video BIOS, Option ROMs, video RAM, RAM on peripherals, memory-mapped I/O, and obsoleted ROM BASIC.

HIMEM.SYS is a DOS device driver which allows DOS programs to store data in extended memory according to the Extended Memory Specification (XMS). The memory beyond the first 1 MB of address space is required by Windows 9x/Me in order to load; therefore, these versions of Microsoft Windows require HIMEM.SYS to be loaded to be able to run.

In computing, the Virtual Control Program Interface (VCPI) is a specification published in 1989 by Phar Lap Software that allows a DOS program to run in protected mode, granting access to many features of the processor not available in real mode. It was supplanted by DOS Protected Mode Interface (DPMI) shortly after being introduced, due in large part to VCPI's inability to work in Windows 3.0's protected mode.

<span class="mw-page-title-main">DOS</span> Group of closely related IBM PC-compatible operating systems

DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of Microsoft's MS-DOS and a rebranded version, IBM PC DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

The maximum random access memory (RAM) installed in any computer system is limited by hardware, software and economic factors. The hardware may have a limited number of address bus bits, limited by the processor package or design of the system. Some of the address space may be shared between RAM, peripherals, and read-only memory. In the case of a microcontroller with no external RAM, the size of the RAM array is limited by the size of the integrated circuit die. In a packaged system, only enough RAM may be provided for the system's required functions, with no provision for addition of memory after manufacture.

References

Specifications
Microsoft Knowledge Base