From owner-freebsd-current Thu Nov 14 08:20:05 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA04755 for current-outgoing; Thu, 14 Nov 1996 08:20:05 -0800 (PST) Received: from rocky.mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA04705 for ; Thu, 14 Nov 1996 08:19:57 -0800 (PST) Received: (from nate@localhost) by rocky.mt.sri.com (8.7.5/8.7.3) id JAA05621; Thu, 14 Nov 1996 09:19:43 -0700 (MST) Date: Thu, 14 Nov 1996 09:19:43 -0700 (MST) Message-Id: <199611141619.JAA05621@rocky.mt.sri.com> From: Nate Williams To: Ron Bolin Cc: freebsd-current@freebsd.org Subject: Re: New Syscons.c still gives PS/2 Mouse problems. Suggestions? In-Reply-To: <328A9413.794BDF32@mindspring.com> References: <328A9413.794BDF32@mindspring.com> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Ron Bolin writes: > I did a cvsup and got the 1.86 version of syscons.c, and am still > experiencing the wierd PS/2 mouse behavior. > > Any thoughts? S'ren hasn't yet applied the fixes that Bruce suggested. In the meantime, you can back out the following 'fix' which seems to be causing the problem. Nate --------------- Index: syscons.c =================================================================== RCS file: /home/CVS/src/sys/i386/isa/syscons.c,v retrieving revision 1.182 retrieving revision 1.183 diff -c -r1.182 -r1.183 *** syscons.c 1996/10/26 20:16:58 1.182 --- syscons.c 1996/11/04 21:01:08 1.183 *************** *** 25,31 **** * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ! * $Id: syscons.c,v 1.182 1996/10/26 20:16:58 sos Exp $ */ #include "sc.h" --- 25,31 ---- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ! * $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $ */ #include "sc.h" *************** *** 572,606 **** mark_all(cur_console); } ! c = scgetc(SCGETC_NONBLOCK); ! cur_tty = VIRTUAL_TTY(get_scr_num()); ! if (!(cur_tty->t_state & TS_ISOPEN)) ! if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN)) ! return; ! switch (c & 0xff00) { ! case 0x0000: /* normal key */ ! (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty); break; ! case NOKEY: /* nothing there */ ! return; ! case FKEY: /* function key, return string */ ! if (cp = get_fstr((u_int)c, (u_int *)&len)) { ! while (len-- > 0) ! (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty); } - break; - case MKEY: /* meta is active, prepend ESC */ - (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty); - (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty); - break; - case BKEY: /* backtab fixed sequence (esc [ Z) */ - (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty); - (*linesw[cur_tty->t_line].l_rint)('[', cur_tty); - (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty); - break; } if (cur_console->status & MOUSE_ENABLED) { cur_console->status &= ~MOUSE_VISIBLE; remove_mouse_image(cur_console); --- 572,611 ---- mark_all(cur_console); } ! /* ! * Loop while there is still input to get from the keyboard. ! * I don't think this is nessesary, and it doesn't fix ! * the Xaccel-2.1 keyboard hang, but it can't hurt. XXX ! */ ! while ((c = scgetc(SCGETC_NONBLOCK)) != NOKEY) { ! cur_tty = VIRTUAL_TTY(get_scr_num()); ! if (!(cur_tty->t_state & TS_ISOPEN)) ! if (!((cur_tty = CONSOLE_TTY)->t_state & TS_ISOPEN)) ! return; ! switch (c & 0xff00) { ! case 0x0000: /* normal key */ ! (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty); ! break; ! case FKEY: /* function key, return string */ ! if (cp = get_fstr((u_int)c, (u_int *)&len)) { ! while (len-- > 0) ! (*linesw[cur_tty->t_line].l_rint)(*cp++ & 0xFF, cur_tty); ! } break; ! case MKEY: /* meta is active, prepend ESC */ ! (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty); ! (*linesw[cur_tty->t_line].l_rint)(c & 0xFF, cur_tty); ! break; ! case BKEY: /* backtab fixed sequence (esc [ Z) */ ! (*linesw[cur_tty->t_line].l_rint)(0x1b, cur_tty); ! (*linesw[cur_tty->t_line].l_rint)('[', cur_tty); ! (*linesw[cur_tty->t_line].l_rint)('Z', cur_tty); ! break; } } + if (cur_console->status & MOUSE_ENABLED) { cur_console->status &= ~MOUSE_VISIBLE; remove_mouse_image(cur_console); *************** *** 1442,1447 **** --- 1447,1462 ---- scr_stat *scp = cur_console; int s = spltty(); + /* + * With release 2.1 of the Xaccel server, the keyboard is left + * hanging pretty often. Apparently the interrupt from the + * keyboard is lost, and I don't know why (yet). + * This Ugly hack calls scintr if input is ready and + * conveniently hides the problem. XXX + */ + if (inb(KB_STAT) & KB_BUF_FULL) + scintr(0); + /* should we just return ? */ if ((scp->status&UNKNOWN_MODE) || blink_in_progress || switch_in_progress) { timeout((timeout_func_t)scrn_timer, 0, hz/10); *************** *** 2462,2471 **** static u_int chr = 0; next_code: ! kbd_wait(); ! /* first see if there is something in the keyboard port */ ! if (inb(KB_STAT) & KB_BUF_FULL) scancode = inb(KB_DATA); else if (flags & SCGETC_NONBLOCK) return(NOKEY); else --- 2477,2487 ---- static u_int chr = 0; next_code: ! /* check if there is anything in the keyboard buffer */ ! if (inb(KB_STAT) & KB_BUF_FULL) { ! DELAY(25); scancode = inb(KB_DATA); + } else if (flags & SCGETC_NONBLOCK) return(NOKEY); else *************** *** 2830,2836 **** console[0]->smode.mode == VT_AUTO) switch_scr(cur_console, 0); Debugger("manual escape to debugger"); - return(NOKEY); #else printf("No debugger in kernel\n"); #endif --- 2846,2851 ----