From owner-freebsd-current@FreeBSD.ORG Sat Apr 29 18:05:11 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8FEB16A402 for ; Sat, 29 Apr 2006 18:05:11 +0000 (UTC) (envelope-from dominique.goncalves@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id D42B643D49 for ; Sat, 29 Apr 2006 18:05:10 +0000 (GMT) (envelope-from dominique.goncalves@gmail.com) Received: by nz-out-0102.google.com with SMTP id i28so2146220nzi for ; Sat, 29 Apr 2006 11:05:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S+SWxUDlAOTnxmq+tpsqs5ZMGULrUS+Il9UV3m6Gp+NU1ysfrs0aPYgbY+ClE/x1ifqlIudSpRTXe3+/rgvm4r4fPwwxpaN9XatrYIEGf2pQLtm7KLjRF0J5sE9Vu44x1a4qBs/BZt1C6Wa9So7HmZ6xo9jvOdi3e/0SoOZa93s= Received: by 10.37.20.3 with SMTP id x3mr3902278nzi; Sat, 29 Apr 2006 11:05:10 -0700 (PDT) Received: by 10.36.178.3 with HTTP; Sat, 29 Apr 2006 11:05:10 -0700 (PDT) Message-ID: <7daacbbe0604291105h1ad03c78w428dc770b38bc542@mail.gmail.com> Date: Sat, 29 Apr 2006 20:05:10 +0200 From: "Dominique Goncalves" To: "Maksim Yevmenkin" In-Reply-To: <44515720.8020908@savvis.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <44515720.8020908@savvis.net> Cc: freebsd-current@freebsd.org Subject: Re: [PATCH] kbdmux(4), atkbd(4) and ddb(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Apr 2006 18:05:12 -0000 Hi, On 4/28/06, Maksim Yevmenkin wrote: > dear hackers, > > there were many complains about atkbd(4) not working in ddb(4) with > kbdmux(4) enabled. > > i had a minute of free time and looked into this. it seems to me that > atkbd(4) is not dealing properly with "polled" mode. after looking at > the code, i came up with the attached patch. > > i did some very brief testing and the patch works for me. atkbd(4) now > works in ddb(4) and single user mode with kbdmux(4) enabled. > > the patch is rather ugly (imo), because it assumes that something will > call "poll" method repeatedly (which seems like we do it). also, ukbd(4) > has somewhat similar code. > > could someone (with atkbd(4), syscons(4) and ddb(4) fu) please review it > and tell me if its ok to commit. > > also, i would appreciate if someone would perform more extensive testing > to see if there are any regressions. > > thanks, > max > > > --- atkbd.c.orig Thu Apr 27 16:29:26 2006 > +++ atkbd.c Thu Apr 27 16:30:13 2006 > @@ -26,7 +26,7 @@ > */ > > #include > -__FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/dev/atkbdc/atkbd.c,v 1.47 20= 05/06/10 20:56:37 marius Exp $"); > +__FBSDID("$FreeBSD: src/sys/dev/atkbdc/atkbd.c,v 1.47 2005/06/10 20:56:3= 7 marius Exp $"); > > #include "opt_kbd.h" > #include "opt_atkbd.h" > @@ -1023,6 +1023,15 @@ > ++state->ks_polling; > else > --state->ks_polling; > + > + if (state->ks_polling) { > + if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) { > + (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE); > + if ((*kbdsw[kbd->kb_index]->check_char)(kbd)) > + (*kbdsw[kbd->kb_index]->intr)(kbd, NULL); > + } > + } > + > splx(s); > return 0; > } > With your patch, I can use my PS/2 keyboard when I enter into ddb (with default boot option) and it works also with 'safe mode' (tested on my p4 box). But on my p3 box in 'safe mode', some characters are dropped. I don't know if this a side effect of your patch. My p3 and p4 both use a Standard PS/2 keyboard. FreeBSD 7.0-CURRENT #1: Sat Apr 29 18:18:47 CEST 2006 root@djdomics.sceen.net:/usr/obj/share/src/FreeBSD/HEAD/src/sys/FREESBIE Let me know if you need more information. Regards. > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " > > -- There's this old saying: "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life."