
In
DOS memory management, the high memory area (HMA) is the
RAM 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 un ...
s above the one megabyte in an
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
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, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
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 ...
(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 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 processors, with only 1 MB of memory and only 20
address lines, 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 802 ...
computers, IBM added special
circuitry on the
motherboard
A motherboard, also called a mainboard, a system board, a logic board, and informally a mobo (see #Nomenclature, "Nomenclature" section), is the main printed circuit board (PCB) in general-purpose computers and other expandable systems. It ho ...
to simulate the wrapping around. This circuit was a simple
logic gate
A logic gate is a device that performs 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 gate, one that has, for ...
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 handlers 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 (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.
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 and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
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 privately held American software 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 ...
's
DR DOS 5.0 (via
HIDOS.SYS / BDOS=FFFF and
CONFIG.SYS HIDOS=ON) and since 1991 with
MS-DOS 5.0 (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 a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
and kernel could be loaded into the HMA as well,
freeing up to 46 KB of
conventional memory.
Other components, such as device drivers and
terminate-and-stay-resident program
A terminate-and-stay-resident program (commonly TSR) 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 techni ...
s (TSRs), could at least be loaded into the
upper memory area
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 ...
(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 as well as several special
self-relocating 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 NetWare. Novell technolog ...
's
NLCACHE from
NetWare Lite and early versions of
NWCACHE from
Personal NetWare and
Novell DOS 7 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/
DRVSPACE.BIN can coexist with DOS in the HMA (unless
DBLSPACE/
DRVSPACE /NOHMA is invoked).
Under
PC DOS 7.0 (1995) and
2000
2000 was designated as the International Year for the Culture of Peace and the World Mathematics, Mathematical Year.
Popular culture holds the year 2000 as the first year of the 21st century and the 3rd millennium, because of a tende ...
,
DOSKEY
DOSKEY is a command in DOS, OS/2, Windows, and ReactOS that adds command history, macro functionality, and improved editing features to the COMMAND.COM and cmd.exe command-line interpreter shells.
History
The command was included as a termi ...
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 (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 (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 tech ...
(EMS)
*
Unreal mode
*
Rebasing
*
Paragraph boundary relocation
*
Intra-segment offset relocation
*
SHELLHIGH (CONFIG.SYS directive)
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 residi ...
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
Notes
References
Further reading
*
*
*
{{DEFAULTSORT:High Memory Area
X86 memory management
DOS memory management