That horrible thing from hell called A20... *again*...

H. Peter Anvin (hpa@zytor.com)
Fri, 10 Aug 2001 17:09:09 -0700


This is a multi-part message in MIME format.
--------------000905070603080905000000
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

It has come to my attention that the current 2.4 A20-enabling code still
has two problems: it doesn't work on machines for which the "fast A20
gate" bit has been hijacked for other uses (e.g. Olivetti); apparently
it doesn't work on some more modern "legacy free" systems either
(apparently the "Compaq 5Bw160" might be in this category - currently
unconfirmed.) I have ported the current A20 code from SYSLINUX (it has
been stable there since version 1.52) and I would really appreciate it
(PLEASE PLEASE PRETTY PLEASE) if people would try it out and see how it
works before sending it to Linus and Alan; I'd like to know any
combination of "works/doesn't work with the patch" and "works/doesn't
work without the patch..."

This version first tests for the A20 gate already being enabled (e.g.
"legacy free" systems), and secondly tries to use the BIOS function (int
15h, AX=2401h) if it exists. If not it tries the KBC and finally port 92h.

The patch is against 2.4.8-pre8; I have tried to test it as well as I
can, which is somewhat hard since I don't actually have any machines
which exhibit these pathologies; they do, however, support A20 unmasking
via the BIOS, so that part can be considered tested; and, of course, the
SYSLINUX code that was the porting basis has been in production use
since version 1.52, which was released over six months ago.

-hpa

--------------000905070603080905000000
Content-Type: text/plain;
name="a20-2.4.8-pre8-2.diff"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="a20-2.4.8-pre8-2.diff"

LS0tIGFyY2gvaTM4Ni9ib290L3NldHVwLlMub2xkCUZyaSBBdWcgMTAgMTU6MjA6NTEgMjAw
MQorKysgYXJjaC9pMzg2L2Jvb3Qvc2V0dXAuUwlGcmkgQXVnIDEwIDE3OjA1OjI3IDIwMDEK
QEAgLTI1Myw2ICsyNTMsNyBAQAogCWNhbGwJcHJ0c3RyCiAKIG5vX3NpZ19sb29wOgorCWhs
dAogCWptcAlub19zaWdfbG9vcAogCiBnb29kX3NpZzoKQEAgLTY0MSwxOCArNjQyLDQwIEBA
CiAJbW92dwklYXgsICVkcwogCW1vdncJJW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RhbnQKKwljbXB3CSVnczooQTIwX1RFU1RfQUREUisweDEwKSwgJWF4CisJbG9v
cGUJYTIwX3Rlc3Rfd2FpdAorCisJcG9wdwklZnM6KEEyMF9URVNUX0FERFIpCisJcG9wdwkl
YXgKKwlwb3B3CSVjeAorCXJldAkKIAogIyBUaGlzIHJvdXRpbmUgY2hlY2tzIHRoYXQgdGhl
IGtleWJvYXJkIGNvbW1hbmQgcXVldWUgaXMgZW1wdHkKICMgKGFmdGVyIGVtcHR5aW5nIHRo
ZSBvdXRwdXQgYnVmZmVycykK
--------------000905070603080905000000--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/