*BSD News Article 2535


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!mips!mips!swrinde!news.dell.com!james
From: james@raid.dell.com (James Van Artsdalen)
Newsgroups: comp.unix.bsd
Subject: Re: 386BSD 0.1: pccons.c bug
Message-ID: <1992Jul26.212059.29490@raid.dell.com>
Date: 26 Jul 92 21:20:59 GMT
References: <1992Jul26.061759.13547@raid.dell.com>
Reply-To: james@raid.cactus.org (James Van Artsdalen)
Organization: Dell Computer Co
Lines: 35

In <1992Jul26.061759.13547@raid.dell.com>, james@raid.dell.com (me) wrote:

Sigh.  Obviously I hadn't tested this.  The second while loop needs to
wait for the output buffer bit to go high, not wait for it to go low.

Is there a PS/2 mouse driver (lots of Compaqs and Dells have
PS/2-style mice)?  If so, much of the code in pccons.c will have to
change to avoid race conditions.  The keyboard LED update code needs
to know that the next byte coming from the 8042 might be a keyboard or
mouse data byte, and not an ACK for the LED command.

	I haven't tested this change.  I found the bug by inspection.
	
	*** pccons.c.~1~	Sun Jul 26 01:12:26 1992
	--- pccons.c	Sun Jul 26 01:13:36 1992
	***************
	*** 155,161 ****
	  	
	  	while (inb(KBSTATP)&KBS_IBF);
	  	if (val) outb(KBOUTP, val);
	! 	while (inb(KBSTATP)&KBS_IBF);
	  	return (inb(KBDATAP));
	  }
	  
	--- 155,161 ----
	  	
	  	while (inb(KBSTATP)&KBS_IBF);
	  	if (val) outb(KBOUTP, val);
	! 	while (inb(KBSTATP)&KBS_DIB);
	  	return (inb(KBDATAP));
	  }
-- 
-- 
James R. Van Artsdalen          james@bigtex.cactus.org   "Live Free or Die"
Dell Computer Co    9505 Arboretum Blvd Austin TX 78759         512-338-8789