--- arch/i386/boot/setup.S.12p5	Tue Dec  5 15:19:10 2000
+++ arch/i386/boot/setup.S	Tue Dec  5 15:22:13 2000
@@ -636,6 +636,7 @@
 # First, try the "fast A20 gate".
 #
 	inb	$0x92,%al
+	movb	%al,%dl
 	orb	$0x02,%al			# Fast A20 on
 	andb	$0xfe,%al			# Don't reset CPU!
 	outb	%al,$0x92
@@ -648,9 +649,17 @@
 # did the trick and stop its probing at that stage; but subsequent ones
 # must not do so.
 #
+	pushw	%dx
 	movb	$0x01,%dl			# A20-sensitive
 	call	empty_8042
+	popw	%dx
 	jnz	a20_wait			# A20 already on?
+
+# If A20 is still off, we need to go to the KBC.  Set the
+# "fast A20 gate" to its original value, since some smartass
+# manufacturers have apparently decided to use A20M# as a GPIO!
+	movb	%dl,%al
+	outb	%al,$0x92
 
 	movb	$0xD1, %al			# command write
 	outb	%al, $0x64
