[lkml]   [2000]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: That horrible hack from hell called A20

On Tue, 5 Dec 2000, H. Peter Anvin wrote:
> I might hack on using INT 15h to do the jump to protected mode, as ugly
> as it is, but I won't have time before my trip. It would require quite a
> bit of restructuring in setup.S, and would probably break LOADLIN.

Right now this is my interim patch (to clean test11). The thing to note is
that I decreased the keyboard controller timeout by a factor of about 167,
while making the "delay" a bit longer.

Now, if you don't have a keyboard controller, the bootup delay should be
on the order of 1.2 seconds or so (calling empty_8042 three times, each
around 0.4 seconds to time out). Which is acceptable. Especially as the
non-keyboard-controller machines that don't even emulate one are quite
rare. And it's still long enough that if the keyboard controller hasn't
emptied in 0.4 seconds, something else is badly wrong.

The non-keyboard-controller timeout used to be around three minutes
before. Which _definitely_ is excessive. Most people would assume that the
machine had hung.


--- v2.4.0-test11/linux/arch/i386/boot/setup.S Tue Oct 31 12:42:26 2000
+++ linux/arch/i386/boot/setup.S Tue Dec 5 17:31:53 2000
@@ -825,10 +825,18 @@
# Some machines have delusions that the keyboard buffer is always full
# with no keyboard attached...
+# If there is no keyboard controller, we will usually get 0xff
+# to all the reads. With each IO taking a microsecond and
+# a timeout of 100,000 iterations, this can take about half a
+# second ("delay" == outb to port 0x80). That should be ok,
+# and should also be plenty of time for a real keyboard controller
+# to empty.

pushl %ecx
- movl $0x00FFFFFF, %ecx
+ movl $100000, %ecx

decl %ecx
@@ -867,7 +875,7 @@

# Delay is needed after doing I/O
- jmp .+2 # jmp $+2
+ outb %al,$0x80

# Descriptor tables
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:51    [W:0.086 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site