Extended memory

Last updated

Extended memory is located above 1 MB, includes the high memory area, and ends at 16 MB on the Intel 286 and at 4 GB on the Intel 386DX and later. IBM PC Memory areas.svg
Extended memory is located above 1 MB, includes the high memory area, and ends at 16 MB on the Intel 286 and at 4 GB on the Intel 386DX and later.

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 (API) called the Extended Memory Specification (XMS). This API is implemented by a driver (such as HIMEM.SYS) or the operating system kernel, 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 small portions of additional memory above 640 KB from real mode. One of these is referred to as the high memory area (HMA), consisting of the first nearly 64 KB of extended memory, and the other is referred to as the upper memory area (UMA; also referred to as upper memory blocks or UMBs), located in the address range between 640 KB and 1 MB which the IBM PC designates for hardware adapters and ROM.

Overview

On x86-based PCs, extended memory is only available with an Intel 80286 processor or higher. Only these chips can directly 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. [1]

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 a DOS program to access extended memory under a multitasking environment. [1]

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 by direct calls to a variable address that can be found through software interrupt 2Fh function 4310h.

XMS version 2.0, released in July 1988, allowed for up to 64 MB of memory. [2] With XMS version 3.0 this increased to 4 GB (232 bytes). [3] The difference is a direct result of the sizes of the values used to report the amounts of total and unallocated (free) extended memory in 1 KB (1024-byte) units: XMS 2.0 uses 16-bit unsigned integers, capable of representing a maximum of (65535 * 1 KB) = 64 MB, while XMS 3.0 adds new alternate functions that use 32-bit unsigned integers, capable of representing (4 G * 1 KB) = 4 TB (4 terabytes) but limited by the specification to 4 GB. [2] [3] (4 GB is the address range of the 80386 and the 80486, the only 32-bit Intel x86 CPUs that existed when XMS 3.0 was published in 1991.) XMS 3.0 retains the original XMS 2.0 API functions with their original 64 MB limit but adds new "super extended memory" functions that support 4 GB of extended memory (minus the first 1 MB) and can be called only with a 32-bit CPU (since these "super" functions use 32-bit CPU registers to pass values). [3] 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.[ clarification needed ][ citation needed ]

See also

Related Research Articles

x86 Family of instruction set architectures

x86 is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. The 8086 was introduced in 1978 as a fully 16-bit extension of 8-bit Intel's 8080 microprocessor, with memory segmentation as a solution for addressing more memory than can be covered by a plain 16-bit address. The term "x86" came into being because the names of several successors to Intel's 8086 processor end in "86", including the 80186, 80286, 80386 and 80486. Colloquially, their names were "186", "286", "386" and "486".

<span class="mw-page-title-main">IBM PC–compatible</span> Computers similar to the IBM PC and its derivatives

"IBM PC–compatible" refers to a class of computers that are technically compatible with the 1981 IBM PC and subsequent XT and AT models from computer giant IBM. Like the original IBM PC, they use an Intel x86 central processing unit and are capable of using interchangeable commodity hardware, such as expansion cards. Initially such computers were referred to as PC clones, IBM clones or IBM PC clones, but the term "IBM PC compatible" is now a historical description only, as the vast majority of microcomputers produced since the 1990s are IBM compatible. IBM itself no longer sells personal computers, having sold its division to Lenovo in 2005. "Wintel" is a similar description that is more commonly used for modern computers.

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.

The Intel x86 computer instruction set architecture has supported memory segmentation since the original Intel 8086 in 1978. It allows programs to address more than 64 KB (65,536 bytes) of memory, the limit in earlier 80xx processors. In 1982, the Intel 80286 added support for virtual memory and memory protection; the original mode was renamed real mode, and the new version was named protected mode. The x86-64 architecture, introduced in 2003, has largely dropped support for segmentation in 64-bit mode.

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 segmentation, virtual memory, paging and safe multi-tasking designed to increase an operating system's control over application software.

x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.

<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">DESQview</span> Text mode multitasking operating environment

DESQview (DV) is a text mode multitasking operating environment developed by Quarterdeck Office Systems which enjoyed modest popularity in the late 1980s and early 1990s. Running on top of DOS, it allows users to run multiple programs concurrently in multiple windows.

<span class="mw-page-title-main">DOS memory management</span> Techniques employed to give applications access to more than 640 kibibytes

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.

<span class="mw-page-title-main">Expanded memory</span> System of bank switching in DOS memory management

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 640 KB 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.

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.

INT 13h is shorthand for BIOS interrupt call 13hex, the 20th interrupt vector in an x86-based computer system. The BIOS typically sets up a real mode interrupt handler at this vector that provides sector-based hard disk and floppy disk read and write services using cylinder-head-sector (CHS) addressing. Modern PC BIOSes also include INT 13h extension functions, originated by IBM and Microsoft in 1992, that provide those same disk access services using 64-bit LBA addressing; with minor additions, these were quasi-standardized by Phoenix Technologies and others as the EDD BIOS extensions.

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.

DOS Protected Mode Services (DPMS) is a set of extended DOS memory management services to allow DPMS-enabled DOS drivers to load and execute in extended memory and protected mode.

References

Specifications
  1. 1 2 This article is based on material taken from extended+memory at the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.
  2. 1 2 Microsoft, Lotus, Intel, and AST Research (1988-07-19). eXtended Memory Specification (XMS), version 2.0
  3. 1 2 3 Microsoft, Lotus, Intel, and AST Research (January 1991). eXtended Memory Specification (XMS), version 3.0
Microsoft Knowledge Base