This fix by Paul Anderson and Pontus Lidman. Fixes server hang on systems with no PS/2 controller. --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c 2001/08/06 20:51:11 3.20 +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c 2001/09/25 08:04:26 @@ -34,6 +34,8 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" +#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */ + void xf86SoundKbdBell(int loudness, int pitch, int duration) { @@ -140,6 +142,7 @@ #endif { int i; + int timeout; int value = 0x7f; /* Maximum delay with slowest rate */ #ifdef __sparc__ @@ -193,10 +196,18 @@ value |= i << 5; break; } + + timeout = KBC_TIMEOUT; + while (((inb(0x64) & 2) == 2) && --timeout) + usleep(1000); /* wait */ - while ((inb(0x64) & 2) == 2); /* wait */ + if (timeout == 0) + return; + outb(0x60, 0xf3); /* set typematic rate */ - while ((inb(0x64) & 2) == 2); /* wait */ + while (((inb(0x64) & 2) == 2) && --timeout) + usleep(1000); /* wait */ + usleep(10000); outb(0x60, value);