
In
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 was specific to the IBM P ...
, the high memory area (HMA) is the
RAM
Ram, ram, or RAM may refer to:
Animals
* A male sheep
* Ram cichlid, a freshwater tropical fish
People
* Ram (given name)
* Ram (surname)
* Ram (director) (Ramsubramaniam), an Indian Tamil film director
* RAM (musician) (born 1974), Dutch
...
area consisting of the first 65520
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
s above the one megabyte in an
IBM AT or compatible computer.
In
real mode
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 s ...
, the
segmentation architecture of the
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the devel ...
8086
The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus (allo ...
and subsequent processors identifies memory locations with a 16-bit segment and a 16-bit offset, which is resolved into a physical address via (segment) × 16 + (offset). Although intended to address only 1
Megabyte
The megabyte is a multiple of the unit byte for digital information. Its recommended unit symbol is MB. The unit prefix ''mega'' is a multiplier of (106) in the International System of Units (SI). Therefore, one megabyte is one million bytes o ...
(MB) (2
20 bytes) of memory, segment:offset addresses at
FFFF:0010
and beyond reference memory beyond 1 MB (
FFFF0 + 0010 = 100000
). So, on an
80286
The Intel 80286 (also marketed as the iAPX 286 and often called Intel 286) is a 16-bit microprocessor that was introduced on February 1, 1982. It was the first 8086-based CPU with separate, non- multiplexed address and data buses and also th ...
and subsequent processors, this mode can actually address the first 65520 bytes of extended memory as part of the 64 KB range starting 16 bytes before the 1 MB mark—
FFFF:0000 (0xFFFF0)
to
FFFF:FFFF (0x10FFEF)
. The Intel
8086
The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus (allo ...
and
8088
The Intel 8088 ("''eighty-eighty-eight''", also called iAPX 88) microprocessor is a variant of the Intel 8086. Introduced on June 1, 1979, the 8088 has an eight-bit external data bus instead of the 16-bit bus of the 8086. The 16-bit registers and ...
processors, with only 1 MB of memory and only 20
address line
In computer architecture, a bus (shortened form of the Latin ''omnibus'', and historically also called data highway or databus) is a communication system that transfers data between components inside a computer, or between computers. This ex ...
s, wrapped around at the 20th bit, so that address
FFFF:0010
was equivalent to
0000:0000
.
To allow running existing DOS programs which relied on this feature to access
low memory on their newer IBM
PC AT
The IBM Personal Computer/AT (model 5170, abbreviated as IBM AT or PC/AT) was released in 1984 as the fourth model in the IBM Personal Computer line, following the IBM PC/XT and its IBM Portable PC variant. It was designed around the Intel 8 ...
computers, IBM added special
circuitry
An electronic circuit is composed of individual electronic components, such as resistors, transistors, capacitors, inductors and diodes, connected by conductive wires or traces through which electric current can flow. It is a type of electrica ...
on the
motherboard
A motherboard (also called mainboard, main circuit board, mb, mboard, backplane board, base board, system board, logic board (only in Apple computers) or mobo) is the main printed circuit board (PCB) in general-purpose computers and other expand ...
to simulate the wrapping around. This circuit was a simple
logic gate
A logic gate is an idealized or physical device implementing a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic ga ...
which could disconnect the microprocessor's 21st addressing line,
A20, from the rest of the motherboard. This gate could be controlled, initially through the
keyboard controller, to allow running programs which wanted to access the entire RAM.
So-called
A20 handler
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.
A microprocessor typically has a number o ...
s could control the addressing mode dynamically,
thereby allowing programs to load themselves into the 1024–1088 KB region and run in real mode.
Code suitable to be executed in the HMA must either be coded to be
position-independent
In computing, position-independent code (PIC) or position-independent executable (PIE) is a body of machine code that, being placed somewhere in the primary memory, executes properly regardless of its absolute address. PIC is commonly used f ...
(using only relative references),
be compiled to work at the specific addresses in the HMA (typically allowing only one or at most two pieces of code to share the HMA), or it must be designed to be
paragraph boundary or even
offset relocatable (with all addresses being fixed up during load).
Before code (or data) in the HMA can be addressed by the CPU, the corresponding driver must ensure that the HMA is mapped in. This requires that any such requests are tunneled through a
stub remaining in memory outside the HMA, which would invoke the A20 handler in order to (temporarily) enable the
A20 gate
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.
A microprocessor typically has a number o ...
.
If the driver does not exhibit any public data structures and only uses interrupts or calls already controlled by the underlying operating system, it might be possible to register the driver with the system in a way so that the system will take care of A20 itself thereby eliminating the need for a separate stub.
The first user of the HMA among
Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
products was
Windows/286 2.1 in 1988, which introduced the
HIMEM.SYS device driver. Starting in 1990 with
Digital Research
Digital Research, Inc. (DR or DRI) was a company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser DOS, DOS Plus, DR DOS ...
's
DR DOS 5.0 (via
HIDOS.SYS / BDOS=FFFF and
CONFIG.SYS
CONFIG.SYS is the primary configuration file for the DOS and OS/2 operating systems. It is a special ASCII text file that contains user-accessible setup or configuration directives evaluated by the operating system's DOS BIOS (typically residin ...
HIDOS=ON) and since 1991 with
MS-DOS 5.0
MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few oper ...
(via
DOS=HIGH), parts of the operating system's
BIOS
In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the ...
and kernel could be loaded into the HMA as well,
freeing up to 46 KB of
conventional memory
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 ...
.
Other components, such as device drivers and
TSRs, could at least be loaded into the
upper memory area
In DOS memory management, the upper memory area (UMA) refers to 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 a ...
(UMA), but not into the HMA. Under DOS 5.0 and higher, with
DOS=HIGH, the system additionally attempted to move the disk buffers into the HMA.
Under
DR DOS 6.0 (1991) and higher, the disk buffers (via
HIBUFFERS, and later also
BUFFERSHIGH), parts of the command processor
COMMAND.COM
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init proc ...
as well as several special
self-relocating
In computer programming, a self-relocating program is a program that relocates its own address-dependent instructions and data when run, and is therefore capable of being loaded into memory at any address. In many cases, self-relocating code is a ...
drivers like
KEYB,
NLSFUNC and
SHARE could load into the HMA as well (using their
/MH option), thereby freeing up even more conventional memory and upper memory for conventional DOS software to work with.
TASKMAX seems to have relocated parts of itself into the HMA as well.
Novell
Novell, Inc. was an American software and services company headquartered in Provo, Utah, that existed from 1980 until 2014. Its most significant product was the multi- platform network operating system known as Novell NetWare.
Under the l ...
's
NLCACHE from
NetWare Lite and early versions of
NWCACHE
NetWare Lite and Personal NetWare are a series of discontinued peer-to-peer local area networks developed by Novell for DOS- and Windows-based personal computers aimed at personal users and small businesses in the 1990s.
NetWare Lite
In 19 ...
from
Personal NetWare
NetWare Lite and Personal NetWare are a series of discontinued peer-to-peer local area networks developed by Novell for DOS- and Windows-based personal computers aimed at personal users and small businesses in the 1990s.
NetWare Lite
In 1991, ...
and
Novell DOS 7
DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
could utilize the HMA as well.
Under MS-DOS/PC DOS, a ca. 2 KB shared portion of COMMAND.COM can be relocated into the HMA,
as well as
DISPLAY.SYS bitmaps for prepared
codepages.
Under
MS-DOS 6.2 (1993) and higher, a ca. 5 KB portion of
DBLSPACE.BIN
DriveSpace (initially known as DoubleSpace) is a disk compression utility supplied with MS-DOS starting from version 6.0 in 1993 and ending in 2000 with the release of Windows Me. The purpose of DriveSpace is to increase the amount of data the ...
/
DRVSPACE.BIN can coexist with DOS in the HMA (unless
DBLSPACE/
DRVSPACE /NOHMA is invoked).
Under
PC DOS 7.0 (1995) and
2000
File:2000 Events Collage.png, From left, clockwise: Protests against Bush v. Gore after the 2000 United States presidential election; Heads of state meet for the Millennium Summit; The International Space Station in its infant form as seen from ...
,
DOSKEY
DOSKEY is a command for DOS, IBM OS/2, Microsoft Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the command-line interpreters COMMAND.COM and cmd.exe.
History
The command was included as ...
loads into the HMA (if available),
and SHARE can be loaded into the HMA as well (unless its
/NOHMA option is given).
Under
MS-DOS 7.0
MS-DOS 7 is a real mode operating system for IBM PC compatibles. Unlike earlier versions of MS-DOS it was not released separately by Microsoft, but included in the Windows 9x family of operating systems. Windows 95 RTM reports to be MS-DOS 7.0, w ...
(1995) to
8.0 (2000), parts of the HMA are also used as a scratchpad to hold a growing data structure recording various properties of the loaded real-mode drivers.
See also
*
Low memory (the first 64 KB of memory)
*
Extended memory
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 ...
(XMS)
*
Expanded memory
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 t ...
(EMS)
*
Unreal mode
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 ...
*
Rebasing
*
Paragraph boundary relocation
*
Intra-segment offset relocation
*
SHELLHIGH (CONFIG.SYS directive) SIZE=xxxx parameter to override default HMA pre-allocation (DR-DOS 7.02 and higher only)
*
HMAREA (CONFIG.SYS directive) to specify the HMA segment (PTS-DOS only), similar to the DR DOS HIDOS.SYS /BDOS=xxxx parameter
*
Incomplete address decoding
Memory-mapped I/O (MMIO) and port-mapped I/O (PMIO) are two complementary methods of performing input/output (I/O) between the central processing unit (CPU) and peripheral devices in a computer. An alternative approach is using dedicated I/O pr ...
Notes
References
Further reading
*
*
*
{{DEFAULTSORT:High Memory Area
X86 memory management
DOS memory management