[Alug] Kernel Dumping garbage to Port 80h

Wayne Stallwood wayne.stallwood at btinternet.com
Sun Sep 22 12:10:02 BST 2002

For reasons I won't go into to much, the kernel dumping stuff to port 80 is 
causing me problems as I use port 80 for something else (some homebrew 
hardware plugged into my PCI bus)

Generally port 80 is only used by the post code in the Bios to output 
debugging information. When I built my hardware I assumed that after post was 
complete nothing would be written to 0x80 so it was safe for me to use.
Well with any other OS that is true, but Linus has done a dirty hack to fix 
I/O timing in the kernel.

I love having the kernel source :o)
Found this gem in /usr/src/linux/include/asm/io.h

 * Thanks to James van Artsdalen for a better timing-fix than
 * the two short jumps: using outb's to a nonexistent port seems
 * to guarantee better timings even on fast machines.
 * On the other hand, I'd like to be sure of a non-existent port:
 * I feel a bit unsafe about using 0x80 (should be safe, though)
 *              Linus

#define __SLOW_DOWN_IO "\njmp 1f\n1:\tjmp 1f\n1:"
#define __SLOW_DOWN_IO "\noutb %%al,$0x80"


Can any of you think of any other port I can get the kernel to write this to 
that would have the same effect of slowing down I/O but wouldn't be used by 
any other hardware ?

I've got to re-compile the kernel anyway (to sort out ATM support once and for 
all on my machine) and I want to add the preemptive patch as well

Of course the "better" way would be to fix my hardware, but the only way I can 
do that is to recode the PIC (microcontroller) I am using but at the moment I 
can't find the PIC source and it would take me a long time to rewrite.


More information about the main mailing list