[lkml]   [2002]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: IO delay, port 0x80, and BIOS POST codes
On Thu, 14 Mar 2002, Pedro M. Rodrigues wrote:

> This piece of code is taken from an old Minix source code tree, the file being
> boothead.s . Notice the port 0xED usage and the comment.
> ! Enable (ah = 0xDF) or disable (ah = 0xDD) the A20 address line.
> gate_A20:
> call kb_wait
> movb al, #0xD1 ! Tell keyboard that a command is coming
> outb 0x64
> call kb_wait
> movb al, ah ! Enable or disable code
> outb 0x60
> call kb_wait
> mov ax, #25 ! 25 microsec delay for slow keyboard chip
> 0: out 0xED ! Write to an unused port (1us)
> dec ax
> jne 0b
> ret
> kb_wait:
> inb 0x64
> testb al, #0x02 ! Keyboard input buffer full?
> jnz kb_wait ! If so, wait
> ret
> /Pedro

Well I see the comment. Writing to IO Space where there are no devices
is basically a no-op. The ISA/PC/AT bus is asynchronous, it is not
clocked. If there's is no contention due to bus activity from some
hardware read, it's just some address lines and data bits that are
eventually sinked by the bus capacity. The CPU isn't forced to wait
for anything. Since it's in I/O space, you don't even get the delay
from a cache-line reload. No thanks, it's bogus as a delay mechanism.

Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

Windows-2000/Professional isn't.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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