<s>
Real	B-Application
mode	I-Application
,	O
also	O
called	O
real	B-Application
address	I-Application
mode	I-Application
,	O
is	O
an	O
operating	O
mode	O
of	O
all	O
x86-compatible	O
CPUs	B-General_Concept
.	O
</s>
<s>
The	O
mode	O
gets	O
its	O
name	O
from	O
the	O
fact	O
that	O
addresses	O
in	O
real	B-Application
mode	I-Application
always	O
correspond	O
to	O
real	O
locations	O
in	O
memory	O
.	O
</s>
<s>
Real	B-Application
mode	I-Application
is	O
characterized	O
by	O
a	O
20-bit	O
segmented	O
memory	B-General_Concept
address	I-General_Concept
space	O
(	O
giving	O
1	O
MB	O
of	O
addressable	O
memory	O
)	O
and	O
unlimited	O
direct	O
software	O
access	O
to	O
all	O
addressable	O
memory	O
,	O
I/O	O
addresses	O
and	O
peripheral	O
hardware	O
.	O
</s>
<s>
Real	B-Application
mode	I-Application
provides	O
no	O
support	O
for	O
memory	O
protection	O
,	O
multitasking	O
,	O
or	O
code	O
privilege	O
levels	O
.	O
</s>
<s>
Before	O
the	O
release	O
of	O
the	O
80286	B-General_Concept
,	O
which	O
introduced	O
protected	B-Application
mode	I-Application
,	O
real	B-Application
mode	I-Application
was	O
the	O
only	O
available	O
mode	O
for	O
x86	B-Operating_System
CPUs	B-General_Concept
;	O
and	O
for	O
backward	B-General_Concept
compatibility	I-General_Concept
,	O
all	O
x86	B-Operating_System
CPUs	B-General_Concept
start	O
in	O
real	B-Application
mode	I-Application
when	O
reset	O
,	O
though	O
it	O
is	O
possible	O
to	O
emulate	O
real	B-Application
mode	I-Application
on	O
other	O
systems	O
when	O
starting	O
on	O
other	O
modes	O
.	O
</s>
<s>
The	O
286	B-General_Concept
architecture	O
introduced	O
protected	B-Application
mode	I-Application
,	O
allowing	O
for	O
(	O
among	O
other	O
things	O
)	O
hardware-level	O
memory	O
protection	O
.	O
</s>
<s>
Using	O
these	O
new	O
features	O
,	O
however	O
,	O
required	O
a	O
new	O
operating	B-General_Concept
system	I-General_Concept
that	O
was	O
specifically	O
designed	O
for	O
protected	B-Application
mode	I-Application
.	O
</s>
<s>
Since	O
a	O
primary	O
design	O
specification	O
of	O
x86	B-Operating_System
microprocessors	I-Operating_System
is	O
that	O
they	O
are	O
fully	O
backward	B-General_Concept
compatible	I-General_Concept
with	O
software	O
written	O
for	O
all	O
x86	B-Operating_System
chips	O
before	O
them	O
,	O
the	O
286	B-General_Concept
chip	O
was	O
made	O
to	O
start	O
in	O
'	O
real	B-Application
mode	I-Application
 '	O
–	O
that	O
is	O
,	O
in	O
a	O
mode	O
which	O
turned	O
off	O
the	O
new	O
memory	O
protection	O
features	O
,	O
so	O
that	O
it	O
could	O
run	O
operating	B-General_Concept
systems	I-General_Concept
written	O
for	O
the	O
8086	B-General_Concept
and	O
the	O
8088	B-Device
.	O
</s>
<s>
As	O
of	O
2018	O
,	O
current	O
x86	B-Operating_System
CPUs	B-General_Concept
(	O
including	O
x86-64	B-Device
CPUs	B-General_Concept
)	O
are	O
able	O
to	O
boot	O
real	B-Application
mode	I-Application
operating	B-General_Concept
systems	I-General_Concept
and	O
can	O
run	O
software	O
written	O
for	O
almost	O
any	O
previous	O
x86	B-Operating_System
chip	O
without	O
emulation	O
or	O
virtualization	O
.	O
</s>
<s>
The	O
PC	B-Operating_System
BIOS	I-Operating_System
which	O
IBM	O
introduced	O
operates	O
in	O
real	B-Application
mode	I-Application
,	O
as	O
do	O
the	O
DOS	B-Device
operating	B-General_Concept
systems	I-General_Concept
(	O
MS-DOS	B-Application
,	O
DR-DOS	B-Application
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
Early	O
versions	O
of	O
Microsoft	B-Application
Windows	I-Application
ran	O
in	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
Windows/386	O
made	O
it	O
possible	O
to	O
make	O
some	O
use	O
of	O
protected	B-Application
mode	I-Application
,	O
and	O
this	O
was	O
more	O
fully	O
realized	O
in	O
Windows	B-Application
3.0	I-Application
,	O
which	O
could	O
run	O
in	O
either	O
real	B-Application
mode	I-Application
or	O
make	O
use	O
of	O
protected	B-Application
mode	I-Application
in	O
the	O
manner	O
of	O
Windows/386	O
.	O
</s>
<s>
Windows	B-Application
3.0	I-Application
actually	O
had	O
several	O
modes	O
:	O
"	O
real	B-Application
mode	I-Application
"	O
,	O
"	O
standard	O
mode	O
"	O
and	O
"	O
386-enhanced	O
mode	O
"	O
;	O
the	O
latter	O
required	O
some	O
of	O
the	O
virtualization	O
features	O
of	O
the	O
80386	B-General_Concept
processor	O
,	O
and	O
thus	O
would	O
not	O
run	O
on	O
an	O
80286	B-General_Concept
.	O
</s>
<s>
Windows	B-Application
3.1	I-Application
removed	O
support	O
for	O
real	B-Application
mode	I-Application
,	O
and	O
it	O
was	O
the	O
first	O
mainstream	O
operating	O
environment	O
which	O
required	O
at	O
least	O
an	O
80286	B-General_Concept
processor	O
.	O
</s>
<s>
None	O
of	O
these	O
versions	O
could	O
be	O
considered	O
a	O
modern	O
x86	B-Operating_System
operating	B-General_Concept
system	I-General_Concept
,	O
since	O
they	O
switched	O
to	O
protected	B-Application
mode	I-Application
only	O
for	O
certain	O
functions	O
.	O
</s>
<s>
Unix	B-Application
,	O
Linux	B-Application
,	O
OS/2	B-Application
,	O
Windows	B-Device
NT	I-Device
are	O
considered	O
modern	O
OS	O
's	O
as	O
they	O
switch	O
the	O
CPU	O
into	O
protected	B-Application
mode	I-Application
at	O
startup	O
,	O
never	O
return	O
to	O
real	B-Application
mode	I-Application
and	O
provide	O
all	O
of	O
the	O
benefits	O
of	O
protected	B-Application
mode	I-Application
all	O
of	O
the	O
time	O
.	O
</s>
<s>
64-bit	O
operating	B-General_Concept
systems	I-General_Concept
use	O
real	B-Application
mode	I-Application
only	O
at	O
startup	O
stage	O
,	O
and	O
the	O
OS	O
kernel	O
will	O
switch	O
the	O
CPU	O
into	O
long	B-Application
mode	I-Application
.	O
</s>
<s>
Notably	O
,	O
the	O
protected	B-Application
mode	I-Application
of	O
the	O
80286	B-General_Concept
is	O
considerably	O
more	O
primitive	O
than	O
the	O
improved	O
protected	B-Application
mode	I-Application
introduced	O
with	O
the	O
80386	B-General_Concept
;	O
the	O
latter	O
is	O
sometimes	O
called	O
386	B-General_Concept
protected	B-Application
mode	I-Application
,	O
and	O
is	O
the	O
mode	O
modern	O
32-bit	B-Device
x86	I-Device
operating	B-General_Concept
systems	I-General_Concept
run	O
in	O
.	O
</s>
<s>
The	O
8086	B-General_Concept
,	O
8088	B-Device
,	O
and	O
80186	O
have	O
a	O
20-bit	O
address	O
bus	O
,	O
but	O
the	O
unusual	O
segmented	O
addressing	O
scheme	O
Intel	O
chose	O
for	O
these	O
processors	O
actually	O
produces	O
effective	O
addresses	O
which	O
can	O
have	O
21	O
significant	O
bits	O
.	O
</s>
<s>
On	O
the	O
8086	B-General_Concept
,	O
8088	B-Device
,	O
and	O
80186	O
,	O
the	O
result	O
of	O
an	O
effective	O
address	O
that	O
overflows	O
20	O
bits	O
is	O
that	O
the	O
address	O
"	O
wraps	O
around	O
"	O
to	O
the	O
zero	O
end	O
of	O
the	O
address	O
range	O
,	O
i.e.	O
</s>
<s>
However	O
,	O
the	O
80286	B-General_Concept
has	O
24	O
address	O
bits	O
and	O
computes	O
effective	O
addresses	O
to	O
24	O
bits	O
even	O
in	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
Therefore	O
,	O
for	O
the	O
segment	O
0xFFFF	O
and	O
offset	O
greater	O
than	O
0x000F	O
,	O
the	O
80286	B-General_Concept
would	O
actually	O
make	O
an	O
access	O
into	O
the	O
beginning	O
of	O
the	O
second	O
megabyte	O
of	O
memory	O
,	O
whereas	O
the	O
80186	O
and	O
earlier	O
would	O
access	O
an	O
address	O
equal	O
to	O
[offset]-0x10,	O
which	O
is	O
at	O
the	O
beginning	O
of	O
the	O
first	O
megabyte	O
.	O
</s>
<s>
So	O
,	O
the	O
actual	O
amount	O
of	O
memory	O
addressable	O
by	O
the	O
80286	B-General_Concept
and	O
later	O
x86	B-Operating_System
CPUs	B-General_Concept
in	O
real	B-Application
mode	I-Application
is	O
1	O
MB	O
+	O
64	O
KB	O
–	O
16	O
B	B-Application
=	O
1,114,096	O
B	B-Application
.	O
</s>
<s>
Some	O
programs	O
predating	O
the	O
80286	B-General_Concept
were	O
designed	O
to	O
take	O
advantage	O
of	O
the	O
wrap-around	O
(	O
modulo	O
)	O
memory	B-General_Concept
addressing	I-General_Concept
behavior	O
,	O
so	O
the	O
80286	B-General_Concept
presented	O
a	O
problem	O
for	O
backward	B-General_Concept
compatibility	I-General_Concept
.	O
</s>
<s>
Forcing	O
the	O
21st	O
address	O
line	O
(	O
the	O
actual	O
logic	O
signal	O
wire	O
coming	O
out	O
of	O
the	O
chip	O
)	O
to	O
a	O
logic	O
low	O
,	O
representing	O
a	O
zero	O
,	O
results	O
in	O
a	O
modulo-2	O
^20	O
effect	O
to	O
match	O
the	O
earlier	O
processors	O
 '	O
address	O
arithmetic	O
,	O
but	O
the	O
80286	B-General_Concept
has	O
no	O
internal	O
capability	O
to	O
perform	O
this	O
function	O
.	O
</s>
<s>
When	O
IBM	O
used	O
the	O
80286	B-General_Concept
in	O
their	O
IBM	B-Operating_System
PC/AT	I-Operating_System
,	O
they	O
solved	O
this	O
problem	O
by	O
including	O
a	O
software-settable	O
gate	O
to	O
enable	O
or	O
disable	O
(	O
force	O
to	O
zero	O
)	O
the	O
A20	O
address	O
line	O
,	O
between	O
the	O
A20	O
pin	O
on	O
the	O
80286	B-General_Concept
and	O
the	O
system	O
bus	O
;	O
this	O
is	O
known	O
as	O
Gate-A20	O
(	O
the	O
A20	O
gate	O
)	O
,	O
and	O
it	O
is	O
still	O
implemented	O
in	O
PC	O
chipsets	O
to	O
this	O
day	O
.	O
</s>
<s>
Most	O
versions	O
of	O
the	O
HIMEM.SYS	O
extended	O
memory	O
driver	O
for	O
IBM-/MS	O
-DOS	O
famously	O
displayed	O
upon	O
loading	O
a	O
message	O
that	O
they	O
had	O
installed	O
an	O
"	O
A20	O
handler	O
"	O
,	O
a	O
piece	O
of	O
software	O
to	O
control	O
Gate-A20	O
and	O
coordinate	O
it	O
to	O
the	O
needs	O
of	O
programs	O
.	O
</s>
<s>
In	O
protected	B-Application
mode	I-Application
the	O
A20	O
line	O
needs	O
to	O
be	O
enabled	O
,	O
or	O
else	O
physical	O
addressing	O
errors	O
will	O
occur	O
,	O
likely	O
leading	O
to	O
a	O
system	O
crash	O
.	O
</s>
<s>
Modern	O
legacy	O
boot	B-Application
loaders	I-Application
(	O
such	O
as	O
GNU	B-Application
GRUB	I-Application
)	O
use	O
A20	O
line	O
.	O
</s>
<s>
Intel	O
introduced	O
protected	B-Application
mode	I-Application
into	O
the	O
x86	B-Operating_System
family	O
with	O
the	O
intention	O
that	O
operating	B-General_Concept
systems	I-General_Concept
which	O
used	O
it	O
would	O
run	O
entirely	O
in	O
the	O
new	O
mode	O
and	O
that	O
all	O
programs	O
running	O
under	O
a	O
protected	B-Application
mode	I-Application
operating	B-General_Concept
system	I-General_Concept
would	O
run	O
in	O
protected	B-Application
mode	I-Application
as	O
well	O
.	O
</s>
<s>
Because	O
of	O
the	O
substantial	O
differences	O
between	O
real	B-Application
mode	I-Application
and	O
even	O
the	O
rather	O
limited	O
286	B-Application
protected	I-Application
mode	I-Application
,	O
programs	O
written	O
for	O
real	B-Application
mode	I-Application
cannot	O
run	O
in	O
protected	B-Application
mode	I-Application
without	O
being	O
rewritten	O
.	O
</s>
<s>
Therefore	O
,	O
with	O
a	O
wide	O
base	O
of	O
existing	O
real	B-Application
mode	I-Application
applications	O
which	O
users	O
depended	O
on	O
,	O
abandoning	O
real	B-Application
mode	I-Application
posed	O
problems	O
for	O
the	O
industry	O
,	O
and	O
programmers	O
sought	O
a	O
way	O
to	O
switch	O
between	O
the	O
modes	O
at	O
will	O
.	O
</s>
<s>
However	O
,	O
Intel	O
,	O
consistent	O
with	O
their	O
intentions	O
for	O
the	O
processor	O
's	O
usage	O
,	O
provided	O
an	O
easy	O
way	O
to	O
switch	O
into	O
protected	B-Application
mode	I-Application
on	O
the	O
80286	B-General_Concept
but	O
no	O
easy	O
way	O
to	O
switch	O
back	O
to	O
real	B-Application
mode	I-Application
.	O
</s>
<s>
Before	O
the	O
386	B-General_Concept
the	O
only	O
way	O
to	O
switch	O
from	O
protected	B-Application
mode	I-Application
back	O
to	O
real	B-Application
mode	I-Application
was	O
to	O
reset	O
the	O
processor	O
;	O
after	O
a	O
reset	O
it	O
always	O
starts	O
up	O
in	O
real	B-Application
mode	I-Application
to	O
be	O
compatible	O
with	O
earlier	O
x86	B-Operating_System
CPUs	B-General_Concept
back	O
to	O
the	O
8086	B-General_Concept
.	O
</s>
<s>
From	O
protected	B-Application
mode	I-Application
,	O
the	O
processor	O
's	O
state	O
is	O
saved	O
in	O
memory	O
,	O
then	O
the	O
processor	O
is	O
reset	O
,	O
restarts	O
in	O
real	B-Application
mode	I-Application
,	O
and	O
executes	O
some	O
real	B-Application
mode	I-Application
code	O
to	O
restore	O
the	O
saved	O
state	O
from	O
memory	O
.	O
</s>
<s>
It	O
can	O
then	O
run	O
other	O
real	B-Application
mode	I-Application
code	O
until	O
the	O
program	O
is	O
ready	O
to	O
switch	O
back	O
to	O
protected	B-Application
mode	I-Application
.	O
</s>
<s>
The	O
switch	O
to	O
real	B-Application
mode	I-Application
is	O
costly	O
in	O
terms	O
of	O
time	O
,	O
but	O
this	O
technique	O
allows	O
protected	B-Application
mode	I-Application
programs	O
to	O
use	O
services	O
such	O
as	O
BIOS	B-Operating_System
,	O
which	O
runs	O
entirely	O
in	O
real	B-Application
mode	I-Application
(	O
having	O
been	O
designed	O
originally	O
for	O
the	O
8088-based	O
IBM	B-Device
Personal	I-Device
Computer	I-Device
model	O
(	O
machine	O
type	O
)	O
5150	O
)	O
.	O
</s>
<s>
This	O
mode-switching	O
technique	O
is	O
also	O
the	O
one	O
used	O
by	O
DPMI	O
(	O
under	O
real	O
,	O
not	O
emulated	O
,	O
DOS	B-Device
)	O
and	O
DOS	B-Device
extenders	I-Device
like	O
DOS/4GW	B-Application
to	O
allow	O
protected	B-Application
mode	I-Application
programs	O
to	O
run	O
under	O
DOS	B-Device
;	O
the	O
DPMI	O
system	O
or	O
DOS	B-Device
extender	I-Device
switches	O
to	O
real	B-Application
mode	I-Application
to	O
invoke	O
DOS	B-Device
or	O
BIOS	B-Operating_System
calls	O
,	O
then	O
switches	O
back	O
to	O
return	O
to	O
the	O
application	O
program	O
which	O
runs	O
in	O
protected	B-Application
mode	I-Application
.	O
</s>
<s>
The	O
changing	O
towards	O
the	O
NT	O
kernel	O
resulted	O
in	O
the	O
operating	B-General_Concept
system	I-General_Concept
not	O
needing	O
DOS	B-Device
to	O
boot	O
the	O
computer	O
as	O
well	O
as	O
being	O
unable	O
to	O
use	O
it	O
.	O
</s>
<s>
The	O
need	O
to	O
restart	O
the	O
computer	O
in	O
real	B-Application
mode	I-Application
MS-DOS	B-Application
declined	O
after	O
Windows	B-Application
3.1x	I-Application
until	O
it	O
was	O
no	O
longer	O
supported	O
in	O
Windows	B-Device
ME	I-Device
.	O
</s>
<s>
The	O
only	O
way	O
of	O
currently	O
running	O
DOS	B-Device
applications	O
that	O
require	O
real	B-Application
mode	I-Application
from	O
within	O
newer	O
versions	O
of	O
Windows	O
is	O
by	O
using	O
emulators	O
such	O
as	O
DOSBox	B-Application
or	O
x86	B-General_Concept
virtualization	I-General_Concept
products	O
.	O
</s>
