<s>
In	O
DOS	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
,	O
the	O
high	B-Device
memory	I-Device
area	I-Device
(	O
HMA	O
)	O
is	O
the	O
RAM	B-Architecture
area	O
consisting	O
of	O
the	O
first	O
65520	O
bytes	B-Application
above	O
the	O
one	O
megabyte	O
in	O
an	O
IBM	B-Operating_System
AT	I-Operating_System
or	O
compatible	O
computer	O
.	O
</s>
<s>
In	O
real	B-Application
mode	I-Application
,	O
the	O
segmentation	B-Device
architecture	I-Device
of	O
the	O
Intel	B-General_Concept
8086	I-General_Concept
and	O
subsequent	O
processors	O
identifies	O
memory	O
locations	O
with	O
a	O
16-bit	O
segment	O
and	O
a	O
16-bit	O
offset	O
,	O
which	O
is	O
resolved	O
into	O
a	O
physical	O
address	O
via	O
(	O
segment	O
)	O
×	O
16	O
+	O
(	O
offset	O
)	O
.	O
</s>
<s>
Although	O
intended	O
to	O
address	O
only	O
1Megabyte	O
(	O
MB	O
)	O
(	O
220	O
bytes	B-Application
)	O
of	O
memory	O
,	O
segment:offset	B-Device
addresses	O
at	B-Operating_System
FFFF:0010	O
and	O
beyond	O
reference	O
memory	O
beyond	O
1MB	O
(	O
FFFF0	O
+	O
0010	O
=	O
100000	O
)	O
.	O
</s>
<s>
So	O
,	O
on	O
an	O
80286	B-General_Concept
and	O
subsequent	O
processors	O
,	O
this	O
mode	O
can	O
actually	O
address	O
the	O
first	O
65520bytes	O
of	O
extended	B-Device
memory	I-Device
as	O
part	O
of	O
the	O
64KB	O
range	O
starting	O
16bytes	O
before	O
the	O
1MB	O
mark	O
—	O
FFFF:0000	O
(	O
0xFFFF0	O
)	O
to	O
FFFF:FFFF	O
(	O
0x10FFEF	O
)	O
.	O
</s>
<s>
The	O
Intel	B-General_Concept
8086	I-General_Concept
and	O
8088	B-Device
processors	O
,	O
with	O
only	O
1MB	O
of	O
memory	O
and	O
only	O
20address	O
lines	O
,	O
wrapped	O
around	O
at	B-Operating_System
the	O
20th	O
bit	O
,	O
so	O
that	O
address	O
FFFF:0010	O
was	O
equivalent	O
to	O
0000:0000	O
.	O
</s>
<s>
To	O
allow	O
running	O
existing	O
DOS	B-Device
programs	O
which	O
relied	O
on	O
this	O
feature	O
to	O
access	O
low	B-Device
memory	I-Device
on	O
their	O
newer	O
IBM	B-Operating_System
PC	I-Operating_System
AT	I-Operating_System
computers	O
,	O
IBM	O
added	O
special	O
circuitry	O
on	O
the	O
motherboard	B-Device
to	O
simulate	O
the	O
wrapping	O
around	O
.	O
</s>
<s>
This	O
circuit	O
was	O
a	O
simple	O
logic	O
gate	O
which	O
could	O
disconnect	O
the	O
microprocessor	O
's	O
21st	O
addressing	O
line	O
,	O
A20	B-Device
,	O
from	O
the	O
rest	O
of	O
the	O
motherboard	B-Device
.	O
</s>
<s>
This	O
gate	O
could	O
be	O
controlled	O
,	O
initially	O
through	O
the	O
keyboard	B-Device
controller	I-Device
,	O
to	O
allow	O
running	O
programs	O
which	O
wanted	O
to	O
access	O
the	O
entire	O
RAM	B-Architecture
.	O
</s>
<s>
So-called	O
A20	B-Device
handlers	O
could	O
control	O
the	O
addressing	O
mode	O
dynamically	O
,	O
thereby	O
allowing	O
programs	O
to	O
load	O
themselves	O
into	O
the	O
1024	O
–	O
1088KB	O
region	O
and	O
run	O
in	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
Code	O
suitable	O
to	O
be	O
executed	O
in	O
the	O
HMA	O
must	O
either	O
be	O
coded	O
to	O
be	O
position-independent	B-Operating_System
(	O
using	O
only	O
relative	O
references	O
)	O
,	O
be	O
compiled	O
to	O
work	O
at	B-Operating_System
the	O
specific	O
addresses	O
in	O
the	O
HMA	O
(	O
typically	O
allowing	O
only	O
one	O
or	O
at	B-Operating_System
most	O
two	O
pieces	O
of	O
code	O
to	O
share	B-Application
the	O
HMA	O
)	O
,	O
or	O
it	O
must	O
be	O
designed	O
to	O
be	O
paragraph	O
boundary	O
or	O
even	O
offset	O
relocatable	O
(	O
with	O
all	O
addresses	O
being	O
fixed	O
up	O
during	O
load	O
)	O
.	O
</s>
<s>
This	O
requires	O
that	O
any	O
such	O
requests	O
are	O
tunneled	O
through	O
a	O
stub	O
remaining	O
in	O
memory	O
outside	O
the	O
HMA	O
,	O
which	O
would	O
invoke	O
the	O
A20	B-Device
handler	O
in	O
order	O
to	O
(	O
temporarily	O
)	O
enable	O
the	O
A20	B-Device
gate	O
.	O
</s>
<s>
If	O
the	O
driver	O
does	O
not	O
exhibit	O
any	O
public	O
data	O
structures	O
and	O
only	O
uses	O
interrupts	O
or	O
calls	O
already	O
controlled	O
by	O
the	O
underlying	O
operating	O
system	O
,	O
it	O
might	O
be	O
possible	O
to	O
register	O
the	O
driver	O
with	O
the	O
system	O
in	O
a	O
way	O
so	O
that	O
the	O
system	O
will	O
take	O
care	O
of	O
A20	B-Device
itself	O
thereby	O
eliminating	O
the	O
need	O
for	O
a	O
separate	O
stub	O
.	O
</s>
<s>
Starting	O
in	O
1990	O
with	O
Digital	O
Research	O
's	O
DR	O
DOS	B-Device
5.0	O
(	O
via	O
HIDOS.SYS	O
/BDOS	O
=	O
FFFF	O
and	O
CONFIG.SYS	B-Device
HIDOS	B-Device
=	O
ON	O
)	O
and	O
since	O
1991	O
with	O
MS-DOS	B-Application
5.0	O
(	O
via	O
DOS	B-Device
=	O
HIGH	O
)	O
,	O
parts	O
of	O
the	O
operating	O
system	O
's	O
BIOS	O
and	O
kernel	O
could	O
be	O
loaded	O
into	O
the	O
HMA	O
as	O
well	O
,	O
freeing	O
up	O
to	O
46KB	O
of	O
conventional	B-Device
memory	I-Device
.	O
</s>
<s>
Other	O
components	O
,	O
such	O
as	O
device	O
drivers	O
and	O
terminate-and-stay-resident	O
programs	O
(	O
TSRs	O
)	O
,	O
could	O
at	B-Operating_System
least	O
be	O
loaded	O
into	O
the	O
upper	B-Device
memory	I-Device
area	I-Device
(	O
UMA	B-Device
)	O
,	O
but	O
not	O
into	O
the	O
HMA	O
.	O
</s>
<s>
Under	O
DOS	B-Device
5.0	O
and	O
higher	O
,	O
with	O
DOS	B-Device
=	O
HIGH	O
,	O
the	O
system	O
additionally	O
attempted	O
to	O
move	O
the	O
disk	O
buffers	B-Device
into	O
the	O
HMA	O
.	O
</s>
<s>
Under	O
DR	O
DOS	B-Device
6.0	O
(	O
1991	O
)	O
and	O
higher	O
,	O
the	O
disk	O
buffers	B-Device
(	O
via	O
HIBUFFERS	B-Device
,	O
and	O
later	O
also	O
BUFFERSHIGH	B-Device
)	O
,	O
parts	O
of	O
the	O
command	O
processor	O
COMMAND.COM	B-Operating_System
as	O
well	O
as	O
several	O
special	O
self-relocating	O
drivers	O
like	O
KEYB	O
,	O
NLSFUNC	O
and	O
SHARE	B-Application
could	O
load	O
into	O
the	O
HMA	O
as	O
well	O
(	O
using	O
their	O
/MH	O
option	O
)	O
,	O
thereby	O
freeing	O
up	O
even	O
more	O
conventional	B-Device
memory	I-Device
and	O
upper	B-Device
memory	I-Device
for	O
conventional	O
DOS	B-Device
software	O
to	O
work	O
with	O
.	O
</s>
<s>
Novell	O
's	O
NLCACHE	O
from	O
NetWare	B-Application
Lite	I-Application
and	O
early	O
versions	O
of	O
NWCACHE	O
from	O
Personal	B-Application
NetWare	I-Application
and	O
Novell	O
DOS	B-Device
7	O
could	O
utilize	O
the	O
HMA	O
as	O
well	O
.	O
</s>
<s>
Under	O
MS-DOS/PCDOS	O
,	O
a	O
ca	O
.	O
</s>
<s>
2KB	O
shared	O
portion	O
of	O
COMMAND.COM	B-Operating_System
can	O
be	O
relocated	O
into	O
the	O
HMA	O
,	O
as	O
well	O
as	O
DISPLAY.SYS	O
bitmaps	O
for	O
prepared	O
codepages	B-Device
.	O
</s>
<s>
Under	O
MS-DOS	B-Application
6.2	O
(	O
1993	O
)	O
and	O
higher	O
,	O
a	O
ca	O
.	O
</s>
<s>
5KB	O
portion	O
of	O
DBLSPACE.BIN/DRVSPACE.BIN	O
can	O
coexist	O
with	O
DOS	B-Device
in	O
the	O
HMA	O
(	O
unless	O
DBLSPACE/DRVSPACE	O
/NOHMA	O
is	O
invoked	O
)	O
.	O
</s>
<s>
Under	O
PC	O
DOS	B-Device
7.0	O
(	O
1995	O
)	O
and	O
2000	O
,	O
DOSKEY	B-Device
loads	O
into	O
the	O
HMA	O
(	O
if	O
available	O
)	O
,	O
and	O
SHARE	B-Application
can	O
be	O
loaded	O
into	O
the	O
HMA	O
as	O
well	O
(	O
unless	O
its	O
/NOHMA	O
option	O
is	O
given	O
)	O
.	O
</s>
<s>
Under	O
MS-DOS	B-Application
7.0	I-Application
(	O
1995	O
)	O
to	O
8.0	O
(	O
2000	O
)	O
,	O
parts	O
of	O
the	O
HMA	O
are	O
also	O
used	O
as	O
a	O
scratchpad	O
to	O
hold	O
a	O
growing	O
data	O
structure	O
recording	O
various	O
properties	O
of	O
the	O
loaded	O
real-mode	B-Application
drivers	O
.	O
</s>
