Re: writing to POST leds?

Linus Torvalds (torvalds@cs.helsinki.fi)
Mon, 9 Sep 1996 09:39:04 +0300 (EET DST)


On Sun, 8 Sep 1996, Edward Welbon wrote:
>
> > However, the SLOW_DOWN_IO code in
> > asm/io.h writes random values to port 0x80, which tends to obscure the values
> > written by users.
>
> Oh yeah... Darn. Is this necessary? Can I change these calls back to the
> jumps or maybe to another address?

It is necessary for the "generic" kernel, because 0x80 is the only safe
IO port I know of that is guaranteed to not be used for any device that
could be hurt by it.

However, for a custom kernel (and you'd want to make a custom kernel for
driver debugging anyway) there is nothing very sacred about the 0x80 number,
or even about the outb in general. On most machines you don't need to do any
slowdowns at all (note the /MOST/. That's why we need to have it in the
generic kernel).

> How about a read CPUID, that is
> synchronizing and should slow down things nicely (though it does change a
> register... uk, never mind)? Would a write back invalidate of the
> current instruction L1 cache line be OK? That should cause a nice slow
> down.

Note that the "outb 0x80" is not just a small slowdown. It's a _huge_
slowdown. It's on the order of 1us, because that is generally what is safe.

But for personal testing you should be able to just remove it altogether.
Don't worry too much (unless you start seeing problems with drivers).

Linus