[comp.sys.ibm.pc.hardware] What is A20 ?

boquist@cs.chalmers.se (Urban Boquist) (05/22/91)

I have a 386DX and when I boot I get a message saying
something like 'A20 handler active'.

I can turn it on or off in the setup, but what is it ?

I'm more of a software person, so if you please could
explain a bit...

Thanks,
  /Urban

--
boquist@cs.chalmers.se

smsmith@magnus.acs.ohio-state.edu (Stephen M Smith) (05/23/91)

>I have a 386DX and when I boot I get a message saying
>something like 'A20 handler active'.
>I can turn it on or off in the setup, but what is it ?
>--
>boquist@cs.chalmers.se

This is new to me too...I just found an explanation for it in
my Quarterdeck's Manifest document (p. 51):

"A20 is a hardware address line which can be enabled or disabled
under program control.  The A20 line is important in the
management of extended memory and the HMA [in this case the 
64k block of memory starting at 1024k].  Programs usually
enable the A20 line when using extended memory and the HMA and
disable it otherwise."

The way I understand this is that the 386 is able to use its
built-in hardware to handle or manage extended memory (memory
over 1024k), and it does this via the A20 address line
controlled by your e(X)tended (M)emory (S)pecification driver.

You people who have Manifest can read pp. 49-51 in the manual
and view your own system setup by choosing 'Extended' and
'XMS' while using Manifest.

Corrections and clarifications welcome!

Stephen M. Smith  \  +  / 
<smsmith@magnus.  \+++++/    " #*&<-[89s]*(k#$@-_=//a2$]'+=.(2_&*%>,,@
 acs.ohio-state.  \  +  /      {7%*@,..":27g)-=,#*:.#,/6&1*.4-,l@#9:-)  "
 edu>             \  +  / 
 BTW, WYSInaWYG   \  +  /                              --witty.saying.ARC 

dj@ctron.com (DJ Delorie) (05/23/91)

In article <1991May22.202206.3923@magnus.acs.ohio-state.edu>, smsmith@magnus.acs.ohio-state.edu (Stephen M Smith) writes:

> >I have a 386DX and when I boot I get a message saying
> >something like 'A20 handler active'.
> >I can turn it on or off in the setup, but what is it ?
> >--
> >boquist@cs.chalmers.se
> 
> This is new to me too...I just found an explanation for it in
> my Quarterdeck's Manifest document (p. 51):

Here's more "history" on the A20 line:

The 8088 (yes, this goes *way* back) had only 20 address lines, A0
through A19.  The segmentation method was "segment * 16 + offset",
which, given the right values, could generate addresses above 1 Meg
(0xffff * 16 + 0xffff = 0x10ffef).  On the 8088, the bits above A19
were stripped, leaving addresses that pointed to low RAM (0x0ffef, in
this example).

Some software actually took advantage of this!  When IBM came out with
the 286, which actually had those address lines, they decided that
they needed to add backwards compatibility, so they added Gate-A20.
What this does is mask off the A20 line coming out of the 286 so that
the addresses will appear to be wrapping to the hardware.  If you
wanted to actually use the memory above 1 Meg, you had to re-enable
the A20 line first.  The signal used to enable/disable is the GateA20
signal.

What they *should* have done is left A20 alone and said "screw the
folks who use this brain-damage", except that those folks were CP/M
and Microsoft.  Thus, we humble developers must contend with hardware
that handicaps the powerful CPU for "compatibility".

DJ
dj@ctron.com