Misplaced Pages

Expanded memory

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
#277722

65-522: 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). Expanded memory is an umbrella term for several incompatible technology variants. The most widely used variant was the Expanded Memory Specification ( EMS ), which was developed jointly by Lotus Software , Intel , and Microsoft , so that this specification

130-498: A kludge ! … But we're going to do it". The companies planned to launch the standard at the Spring 1985 COMDEX , with many expansion-card and software companies announcing their support. The first public version of the EMS standard, called EMS 3.0 was released in 1985; EMS 3.0, however, saw almost no hardware implementations before being superseded by EMS 3.2. EMS 3.2 used a 64 KiB region in

195-479: A MMIO memory hole (15 MiB to 16 MiB) for some ISA devices. The A20 handler is software controlling access to the high memory area. Extended memory managers usually provide this functionality. In DOS, high memory area managers, such as HIMEM.SYS had the extra task of managing A20 and provided an API for opening/closing A20. DOS itself could utilize the area for some of its storage needs, thereby freeing up more conventional memory for programs. This functionality

260-518: A XMA2EMS.SYS driver provided EMS emulation for XMA boards. XMA boards were first introduced for the 1986 (revamped) models of the 3270 PC . This insertion of a memory window into the peripheral address space could originally be accomplished only through specific expansion boards, plugged into the ISA expansion bus of the computer. Famous 1980s expanded memory boards were AST RAMpage, IBM PS/2 80286 Memory Expansion Option, AT&T Expanded Memory Adapter and

325-497: A bit in port 92h to control the A20 line. Disconnecting A20 would not wrap all memory accesses above 1 MiB, just those in the 1 MiB, 3 MiB, 5 MiB, etc. ranges. Real mode software only cared about the area slightly above 1 MiB, so Gate A20 was enough. Virtual 8086 mode , introduced with the Intel 80386 , allows the A20 wrap-around to be simulated by using the virtual memory facilities of

390-458: A defined value that endures after power is interrupted to the system. On reset or power up, the CPU loads the address from the system ROM and then jumps to a defined ROM location to begin executing the system power-on self-test , and eventually load an operating system. Since an expansion card such as a video adapter, hard drive controller , or network adapter could use allocations of memory in many of

455-415: A driver program) the expanded memory board to map that part of memory into the processor's address space. Although applications could use expanded memory with relative freedom, many other software components such as drivers and terminate-and-stay-resident programs (TSRs) were still normally constrained to reside within the 640K "conventional memory" area, which soon became a critically scarce resource. When

520-458: A hardware peripheral, needed a software device driver , which exported its services. Such a device driver was called expanded-memory manager . Its name was variable; the previously mentioned boards used REMM.SYS (AST), PS2EMM.SYS (IBM), AEMM.SYS (AT&T) and EMM.SYS (Intel) respectively. Later, the expression became associated with software-only solutions requiring the Intel 80386 processor, for example Quarterdeck 's QEMM , Qualitas ' 386 or

585-430: A megabyte, or more, of expanded memory, with logic on the board to make that memory accessible to the processor in defined parts of the 8088 address space. Allocation and use of expanded memory was not transparent to application programs. The application had to keep track of which bank of expanded memory contained a particular piece of data, and when access to that data was required, the application had to request (through

650-403: A memory manager might involve hours of experimentation with options, repeatedly rebooting the machine, and testing the results. But conventional memory was so valuable that PC owners felt that such time was well-spent if the result was to free up 30 or 40 KiB of conventional memory space. In the context of IBM PC-compatible computers, extended memory refers to memory in the address space of

715-413: A monochrome display adapter was used, the address space between 0xA0000 and 0xAFFFF could be used for RAM, which would be contiguous with the conventional memory. The system BIOS ROMs must be at the upper end of the address space because the CPU starting address is fixed by the design of the processor. The starting address is loaded into the program counter of the CPU after a hardware reset and must have

SECTION 10

#1732852425278

780-585: A multitasking manager) were still thus constrained. With the release of Windows 95 , it became less relevant still, as this version of Windows provides much of the functionality of the DOS device drivers to DOS applications running under Windows, such as CD, network and sound support; the memory map of Windows 95 DOS boxes was automatically optimised. However, not all DOS programs could execute in this environment. Specifically, programs that tried to directly switch from real mode to protected mode would not work as this

845-487: A program called MEMMAKER which was used to automatically optimize conventional memory by moving terminate-and-stay-resident (TSR) programs to the upper memory. For a period in the early 1990s, manual optimization of the DOS memory map became a highly prized skill, allowing for the largest applications to run on even the most complex PC configurations. The technique was to first create as many UMBs as possible, including remapping allocated but unused blocks of memory, such as

910-812: A utility for the Compaq Deskpro 386 . A popular and well-featured commercial solution was Quarterdeck's QEMM. A contender was Qualitas' 386 . Functionality was later incorporated into MS-DOS 4.01 in 1989 and into DR DOS 5.0 in 1990, as EMM386 . Software expanded-memory managers in general offered additional, but closely related functionality. Notably, they allowed using parts of the upper memory area (UMA) (the upper 384 KiB of real-mode address space) called upper memory blocks (UMBs) and provided tools for loading small programs, typically terminate-and-stay-resident programs inside ("LOADHI" or "LOADHIGH"). Interaction between extended memory , expanded-memory emulation and DOS extenders ended up being regulated by

975-517: The IBM PC/AT was introduced, the segmented memory architecture of the Intel family processors had the byproduct of allowing slightly more than 1 MiB of memory to be addressed in the "real" mode. Since the 80286 had more than 20 address lines, certain combinations of segment and offset could point into memory above the 0x0100000 (2 ) location. The 80286 could address up to 16 MiB of system memory, thus removing

1040-666: The Intel Above Board . Given the price of RAM during the period, up to several hundred dollars per MiB, and the quality and reputation of the above brand names, an expanded memory board was very expensive. Later, some motherboard chipsets of Intel 80286 -based computers implemented an expanded memory scheme that did not require add-on boards, notably the NEAT chipset . Typically, software switches determined how much memory should be used as expanded memory and how much should be used as extended memory . An expanded-memory board, being

1105-724: The Intel 8086 . The designers of the PC allocated the lower 640  KiB ( 655 360 bytes) of address space for read-write program memory (RAM), called conventional memory , and the remaining 384 KiB of memory space was reserved for uses such as the system BIOS , video memory, and memory on expansion peripheral boards. Even though the IBM PC AT , introduced in 1984, used the 80286 chip that could address up to 16 MiB of RAM as extended memory , it could only do so in protected mode . The scarcity of software compatible with protected mode (no standard DOS applications could run in it) meant that

1170-492: The high memory area (HMA). This occurred with the release of DR DOS 5.0 in 1990. DR DOS' built-in memory manager, EMM386.EXE , could perform most of the basic functionality of QEMM and comparable programs. The advantage of DR DOS 5.0 over the combination of an older DOS plus QEMM was that the DR ;DOS kernel itself and almost all of its data structures could be loaded into high memory. This left virtually all

1235-404: The upper memory area ( UMA ) is the memory between the addresses of 640  KB and 1024 KB ( 0x A0000–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 . However, even with video RAM,

1300-581: The 386 supported 32-bit addresses, or 4  gigabytes (2) of RAM – 4096 times the addressable space of the original 8086. DOS itself did not directly support protected mode, but Microsoft eventually developed DPMI , and several DOS extenders were published based on it. DOS programs like Doom could use extenders like DOS/4G to run in protected mode while still using the DOS API . In the early 1990s new operating systems like Linux , Windows 9x , Windows NT , OS/2 , and BSD/OS supported protected mode "out of

1365-402: The 80286 and subsequent processors, beyond the 1 megabyte limit imposed by the 20 address lines of the 8088 and 8086. Such memory is not directly available to DOS applications running in the so-called "real mode" of the 80286 and subsequent processors. This memory is only accessible in the protected or virtual modes of 80286 and higher processors. Upper memory In DOS memory management ,

SECTION 20

#1732852425278

1430-518: The AT wrap around to low memory as they would have on an 8088 processor. This gate could be controlled, initially through the keyboard controller , to allow running programs which were designed for this to access an additional 65,520 bytes (64 KiB) of memory in real mode . At boot time, the BIOS first enables A20 when counting and testing all of the system's memory, and disables it before transferring control to

1495-508: The HMA among Microsoft products was Windows 2.0 in 1987, which introduced the HIMEM.SYS device driver. Starting with versions 5.0 of DR-DOS (1990) and of MS-DOS (1991), parts of the operating system could be loaded into HMA as well, freeing up to 46 KiB of conventional memory . Other components, such as device drivers and TSRs, could be loaded into the upper memory area (UMA). 80286 introduced

1560-592: The ROM BIOS , the Video BIOS , the Option ROMs , and I/O ports for peripherals, much of this 384 KB of address space was unused. As the 640 KB memory restriction became ever more of an obstacle, techniques were found to fill the empty areas with RAM. These areas were referred to as upper memory blocks ( UMBs ). The next stage in the evolution of DOS was for the operating system to use upper memory blocks (UMBs) and

1625-455: The XMS, Virtual Control Program Interface (VCPI), DOS Protected Mode Interface (DPMI) and DOS Protected Mode Services (DPMS) specifications. Certain emulation programs, colloquially known as LIMulators, did not rely on motherboard or 80386 features at all. Instead, they reserved 64 KiB of the base RAM for the expanded memory window, where they copied data to and from either extended memory or

1690-402: The address space up to 640 KiB was available for RAM. This part of the address space is called "conventional memory" since it is accessible to all versions of DOS automatically on startup. Segment 0, the first 64 KiB of conventional memory, is also called low memory area . Normally expansion memory is set to be contiguous in the address space with the memory on the motherboard. If there

1755-413: The base memory free, allowing configurations with up to 620 KB out of 640 KB free. Configuration was not automatic - free UMBs had to be identified by hand, manually included in the line that loaded EMM386 from CONFIG.SYS , and then drivers and so on had to be manually loaded into UMBs from CONFIG.SYS and AUTOEXEC.BAT . This configuration was not a trivial process. As it was largely automated by

1820-400: The behavior of memory addresses "wrapping around". Since the required address line now existed, the combination F800:8000 would no longer point to the physical address 0x0000000 but the correct address 0x00100000. As a result, some DOS programs would no longer work. To maintain compatibility with the PC and XT behavior, the AT included an A20 line gate (Gate A20) that made memory addresses on

1885-502: The box". These and similar developments rendered Expanded Memory an obsolete concept. Other platforms have implemented the same basic concept – additional memory outside of the main address space – but in technically incompatible ways: DOS memory management In IBM PC compatible computing, DOS memory management refers to software and techniques employed to give applications access to more than 640 kibibytes (640*1024 bytes) (KiB) of "conventional memory". The 640 KiB limit

1950-478: The bulk of the code for a driver or TSR into extended memory and replace it with a small fingerhold that was capable of accessing the extended-memory-resident code. They might analyze memory usage to detect drivers that required more RAM during startup than they did subsequently, and recover and reuse the memory that was no longer needed after startup. They might even remap areas of memory normally used for memory-mapped I/O. Many of these tricks involved assumptions about

2015-517: The default EMM386 in MS-DOS, PC DOS and DR-DOS. Beginning in 1986, the built-in memory management features of Intel 80386 processor freely modeled the address space when running legacy real-mode software, making hardware solutions unnecessary. Expanded memory could be simulated in software. The first software expanded-memory management (emulation) program was CEMM , available in September 1986 as

Expanded memory - Misplaced Pages Continue

2080-448: The expanded memory. A first attempt to use a bank switching technique was made by Tall Tree Systems with their JRAM boards, but these did not catch on. (Tall Tree Systems later made EMS-based boards using the same JRAM brand.) Lotus Development , Intel , and Microsoft cooperated to develop the EMS standard (aka LIM EMS). The first publicly available version of EMS, version 3.0 allowed access of up to 4 MiB of expanded memory. This

2145-421: The functioning of drivers and other components. In effect, memory managers might reverse-engineer and modify other vendors' code on the fly. As might be expected, such tricks did not always work. Therefore, memory managers also incorporated very elaborate systems of configurable options, and provisions for recovery should a selected option render the PC unbootable (a frequent occurrence). Installing and configuring

2210-567: The fundamental memory managers into conventional memory, and thereafter everything else into the UMA. Conventional memory glutton programs such as MSCDEX could also be loaded into the UMA in a similar fashion, hence freeing up a large amount of conventional memory. The increasing popularity of Windows 3.0 made the necessity of the upper memory area less relevant, as Windows applications were not directly affected by DOS' base memory limits, but DOS programs running under Windows (with Windows itself acting as

2275-491: The gate and must still deal with external peripherals (the chipset ) for that. Intel processors from the 386 onward allowed a virtual 8086 mode , which simplified the hardware required to implement expanded memory for DOS applications. Expanded memory managers such as Quarterdeck 's QEMM product and Microsoft's EMM386 supported the expanded memory standard without requirement for special memory boards. On 386 and subsequent processors, memory managers like QEMM might move

2340-504: The hard disk when application programs requested page switches. This was programmatically easy to implement, but performance was low. This technique was offered by AboveDisk from Above Software and by several shareware programs. It is also possible to emulate EMS by using XMS memory on 286 CPUs using 3rd party utilities like EMM286 (.SYS driver). Expanded Memory usage declined in the 1990s. The IBM AT Intel 80286 supported 24 bits of address space (16 MiB) in protected mode , and

2405-546: The installation program of QEMM, this program survived on the market; indeed, it worked well with DR DOS' own HMA and UMB support and went on to be one of the best-selling utilities for the PC. This functionality was copied by Microsoft with the release of MS-DOS 5.0 in June 1991. Eventually, even more DOS data structures were moved out of conventional memory, allowing up to 631 KB out of 640 KB to be left free. Starting from version 6.0 of MS-DOS, Microsoft even included

2470-447: The late 1980s through the mid-1990s, but its use declined as users switched from DOS to protected-mode operating systems such as Linux , IBM OS/2 , and Microsoft Windows . The 8088 processor of the IBM PC and IBM PC/XT could address one megabyte (MiB, or 2 bytes) of memory. It inherited this limit from the 20-bit external address bus (and overall memory addressing architecture) of

2535-448: The logic gate was a gate connected to the Intel 8042 keyboard controller. Controlling it was a relatively slow process. Other methods have since been added to allow for more efficient multitasking of programs which require this wrap-around with programs that access all of the system's memory. There was at first a variety of methods, but eventually the industry settled on the PS/2 method of using

2600-527: The market was still open for another solution. To make more memory accessible, a bank switching scheme was devised, where only selected parts of the additional memory would be accessible at any given time. Originally, a single 64 KiB (2 bytes) window of memory, called a page frame , was used; later this was made more flexible. Programs had to be written in a specific way to access expanded memory. The window between conventional memory and expanded memory could be adjusted to access different locations within

2665-471: The modules of most network stacks had to be loaded in a certain sequence, essentially working progressively up through the layers of the OSI model . A basic yet effective method used to optimize conventional memory was to load HIMEM.SYS as a device, thereafter loading EMM386.EXE as a device with the "RAM AUTO" option which allows access into the UMA by loading device drivers as devicehigh. This method effectively loads

Expanded memory - Misplaced Pages Continue

2730-543: The monochrome display area on colour machines. Then, DOS' many subcomponents had to be loaded into these UMBs in the correct sequence to use the blocks of memory as efficiently as possible. Some TSR programs required additional memory while loading, which was freed up again once loading was complete. Fortunately, there were few dependencies amongst these modules, so it was possible to load them in almost any sequence. Exceptions were that to successfully cache CD-ROMs, most disk caches had to be loaded after any CD-ROM drivers, and that

2795-485: The operating system. Enabling the A20 line is one of the first steps a protected mode x86 operating system does in the bootup process, often before control has been passed onto the kernel from the bootstrap (in the case of Linux, for example). The high memory area ( HMA ) is the RAM area consisting of the first 64 KiB, minus 16 bytes , of the extended memory on an IBM PC/AT or compatible microcomputer. Originally,

2860-501: 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. The 640 KiB limit imposed great complexity on hardware and software intended to circumvent it; the physical memory in a machine could be organised as a combination of base or conventional memory (including lower memory), upper memory, high memory (not

2925-556: The presence of an installed expanded memory manager (EMM) by checking for a device driver with the device name EMMXXXX0 . IBM developed their own memory standard called Expanded Memory Adapter (XMA); the IBM DOS driver for it was XMAEM.SYS. Unlike EMS, the IBM expansion boards could be addressed both using an expanded memory model and as extended memory . The expanded memory hardware interface used by XMA boards is, however, incompatible with EMS, but

2990-442: The processor's address space. The process was a form of bank switching . When extra RAM was needed, driver software would temporarily make a piece of expanded memory accessible to the processor; when the data in that piece of memory was updated, another part could be swapped into the processor's address space. For the IBM PC and IBM PC/XT , with only 20 address lines, special-purpose expanded memory cards were made containing perhaps

3055-475: The processor. As memory prices declined, application programs such as spreadsheets and computer-aided drafting were changed to take advantage of more and more physical memory in the system. Virtual memory in the 8088 and 8086 was not supported by the processor hardware, and disk technology of the time would make it too slow and cumbersome to be practical. Expanded memory was a system that allowed application programs to access more RAM than directly visible to

3120-422: The processor: physical memory may be mapped to multiple virtual addresses, thus allowing that the memory mapped at the first megabyte of virtual memory may be mapped again in the second megabyte of virtual memory. The operating system may intercept changes to Gate A20 and make corresponding changes to the virtual memory address space, which also makes irrelevant the efficiency of Gate-A20 toggling. The first user of

3185-459: The same as upper memory), extended memory, and expanded memory, all handled in different ways. The Intel 8088 processor used in the original IBM PC had 20 address lines and so could directly address 1 MiB (2 bytes) of memory. Different areas of this address space were allocated to different kinds of memory used for different purposes. Starting at the lowest end of the address space, the PC had read/write random access memory (RAM) installed, which

3250-404: The upper 384 KiB ( upper memory area) divided into four 16 KiB pages, which could be used to map portions of the expanded memory. In turn, EMS 3.2 was improved upon by a group of three other companies: AST Research, Quadram and Ashton-Tate, which created their own Enhanced EMS (EEMS) standard. EEMS allowed any 16 KiB region in lower RAM to be mapped to expanded memory, as long as it

3315-460: The upper memory areas, configuration of some combinations of cards required careful reading of documentation, or experimentation, to find card settings and memory mappings that worked. Mapping two devices to use the same physical memory addresses could result in a stalled or unstable system. Not all addresses in the upper memory area were used in a typical system; unused physical addresses would return undefined and system-dependent data if accessed by

SECTION 50

#1732852425278

3380-423: The upper memory blocks is specified in the eXtended Memory Specification . On many systems including modern ones it is possible to use memory reserved for shadowing expansion card ROM as upper memory. Many chipsets reserve up to 384 KB RAM for this purpose and since this RAM is generally unused it may be used as real mode upper memory with a custom device driver, such as UMBPCI. On IBM XT computers, it

3445-404: Was an unallocated gap between motherboard memory and the expansion memory, the memory would not be automatically detected as usable by DOS. The upper memory area (UMA) refers to the address space between 640 and 1024 KiB (0xA0000–0xFFFFF). The 128 KiB region between 0xA0000 and 0xBFFFF was reserved for VGA screen memory and legacy SMM. The 128 KiB region between 0xC0000 and 0xDFFFF

3510-494: Was developed by AST Research , Quadram and Ashton-Tate ("AQA"); it could map any area of the lower 1 MiB. EEMS ultimately was incorporated in LIM EMS 4.0, which supported up to 32 MiB of expanded memory and provided some support for DOS multitasking as well. IBM, however, created its own expanded-memory standard called XMA . The use of expanded memory became common with games and business programs such as Lotus 1-2-3 in

3575-494: Was enabled by the " DOS =HIGH" directive in the CONFIG.SYS configuration file. The Intel 80486 and Pentium added a special pin named A20M# , which when asserted low forces bit 20 of the physical address to be zero for all on-chip cache or external memory accesses. This was necessary since the 80486 introduced an on-chip cache, and therefore masking this bit in external logic was no longer possible. Software still needs to manipulate

3640-419: Was increased to 8 MiB with version 3.2 of the specification. The final version of EMS, version 4.0 increased the maximum amount of expanded memory to 32 MiB and supported additional functionality. Microsoft thought that bank switching was an inelegant and temporary, but necessary stopgap measure. Slamming his fist on the table during an interview Bill Gates said of expanded memory, "It's garbage! It's

3705-635: Was not allowed in the virtual 8086 mode it was running in. Also, programs that tried making the switch using the Virtual Control Program Interface (VCPI) API (which was introduced to allow DOS programs that needed protected mode to enter it from the virtual 8086 mode set up by a memory manager, as described above) didn't work in Windows ;95. Only the DOS Protected Mode Interface (DPMI) API for switching to protected mode

3770-429: Was not associated with interrupts or dedicated I/O memory such as network or video cards. Thus, entire programs could be switched in and out of the extra RAM. EEMS also added support for two sets of mapping registers. These features were used by early DOS multitasker software such as DESQview . Released in 1987, the LIM EMS 4.0 specification incorporated practically all features of EEMS. A new feature added in LIM EMS 4.0

3835-582: Was possible to add more memory to the motherboard and use a custom address decoder PROM to make it appear in the upper memory area. As with the 386-based upper memory described above, the extra RAM could be used to load TSR files, or as a RAM disk . The AllCard , an add-on memory management unit for XT-class computers, allowed normal memory to be mapped into the 0xA0000-EFFFF address range, giving up to 952 KB for DOS programs. Programs such as Lotus 1-2-3 , which accessed video memory directly, needed to be patched to handle this memory layout. Therefore,

3900-480: Was reserved for device Option ROMs , including Video BIOS . The 64 KiB of the address space from 0xE0000 to 0xEFFFF was reserved for the BIOS or Option ROMs . The IBM PC reserved the uppermost 64 KiB of the address space from 0xF0000 to 0xFFFFF for the BIOS and Cassette BASIC read-only memory (ROM). For example, the monochrome video adapter memory area ran from 704 to 736 KiB (0xB0000–0xB7FFF). If only

3965-411: Was sometimes referred to as " LIM EMS ". LIM EMS had three versions: 3.0, 3.2, and 4.0. The first widely implemented version was EMS 3.2, which supported up to 8 MiB of expanded memory and uses parts of the address space normally dedicated to communication with peripherals ( upper memory ) to map portions of the expanded memory. EEMS , an expanded-memory management standard competing with LIM EMS 3.x,

SECTION 60

#1732852425278

4030-676: 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

4095-401: Was supported. Upper memory blocks can be created by mapping extended memory into the upper memory area when running in virtual 8086 mode . This is similar to how expanded memory can be emulated using extended memory so this method of providing upper memory blocks is usually provided by the expanded memory manager (for example EMM386 ). The application programming interface for managing

4160-529: Was that EMS boards could have multiple sets of page-mapping registers (up to 64 sets). This allowed a primitive form of DOS multitasking . The caveat was, however, that the standard did not specify how many register sets a board should have, so there was great variability between hardware implementations in this respect. The Expanded Memory Specification (EMS) is the specification describing the use of expanded memory. EMS functions are accessible through software interrupt 67h. Programs using EMS must first establish

4225-411: Was used by DOS and application programs. The first part of this memory was installed on the motherboard of the system (in very early machines, 64 KiB, later revised to 256 KiB). Additional memory could be added with cards plugged into the expansion slots; each card contained straps or switches to control what part of the address space accesses memory and devices on that card. On the IBM PC, all

#277722