From owner-freebsd-arch@FreeBSD.ORG Mon Mar 5 14:49:36 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8616716A408; Mon, 5 Mar 2007 14:49:36 +0000 (UTC) (envelope-from tshadwick+freebsd-arch.freebsd.org@oss-solutions.com) Received: from moogle.hksilver.net (mail.hksilver.net [208.231.66.99]) by mx1.freebsd.org (Postfix) with ESMTP id 4994113C48D; Mon, 5 Mar 2007 14:49:35 +0000 (UTC) (envelope-from tshadwick+freebsd-arch.freebsd.org@oss-solutions.com) Received: from [172.16.30.8] (chibi.shadwick.home [172.16.30.8]) by moogle.hksilver.net (8.14.0/8.13.4) with ESMTP id l25EnjCX050084; Mon, 5 Mar 2007 08:49:46 -0600 (CST) (envelope-from tshadwick+freebsd-arch.freebsd.org@oss-solutions.com) Message-ID: <45EC2DFD.3060105@oss-solutions.com> Date: Mon, 05 Mar 2007 08:49:33 -0600 From: Tony Shadwick User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Markus Brueffer References: <45E3467E.2070000@oss-solutions.com> <200702270345.13194.markus@FreeBSD.org> In-Reply-To: <200702270345.13194.markus@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.90/2726/Mon Mar 5 06:39:18 2007 on moogle.hksilver.net X-Virus-Status: Clean Cc: freebsd-arch@freebsd.org Subject: Re: USB HID Driver help X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2007 14:49:36 -0000 Markus Brueffer wrote: > Hi Tony, > > On Monday 26 February 2007 21:43, Tony Shadwick wrote: >> I'm definitely not a high-end programmer, but I have gone to the trouble >> of working out the protocol for a USB light gun that is normally used on >> a Playstation 2 video game console. It has 10 buttons, and can track >> on-screen location if it has access to the composite sync video signal. >> >> http://forum.arcadecontrols.com/index.php?topic=60813.0 >> >> I've written just a basic parser for the gun. FreeBSD picks up the gun >> and gives it a ugen character device that I then take continuous input >> from. The protocol is 6 bytes long repeated pretty much as fast as the >> gun can send it. > > Did you have uhid(4) in the kernel or loaded as module? If not, please try > loading the module and see if the device gets picked up by it (you need to > replug it after loading the module). > > Judging from the description of the protocol, it seems that the device is a > regular USB HID device. If it doesn't get picked up by uhid(4), it suffers > from the same problem as the gamepad of the Xbox360 by not exposing itself as > being a regular USB HID device and not providing a HID descriptor. Both can > be worked around but please verify first, that uhid(4) doesn't already > support the device. Writing an extra driver for this device is not > neccessary. > > Markus > Anyone home? :) Not sure how to proceed from here....uhid was loaded. From owner-freebsd-arch@FreeBSD.ORG Sat Mar 10 14:38:18 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D09E16A405; Sat, 10 Mar 2007 14:38:18 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.freebsd.org (Postfix) with ESMTP id DFD5613C46B; Sat, 10 Mar 2007 14:38:17 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id CB504EB1092; Sat, 10 Mar 2007 22:38:16 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id 2zdbuq3cOdqm; Sat, 10 Mar 2007 22:38:09 +0800 (CST) Received: from [10.0.2.66] (p42220-ipbffx02marunouchi.tokyo.ocn.ne.jp [211.129.152.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id D2F4EEB0909; Sat, 10 Mar 2007 22:38:07 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:organization:user-agent:mime-version:to:cc: subject:x-enigmail-version:content-type; b=QYQiNTBhuxu2NJLIEDQoY0FKtMZx23gyRC78jzEfVMh1Eiim0o6FQqeuqcTXBVvlY 3/MT1w4on8cfOz/lMdtXQ== Message-ID: <45F2C2CB.5000204@delphij.net> Date: Sat, 10 Mar 2007 23:38:03 +0900 From: LI Xin Organization: The FreeBSD Project User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: freebsd-arch@freebsd.org X-Enigmail-Version: 0.94.1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7DC38480C3AE5AE641F6D7E0" Cc: MingyanGuo Subject: locking reasoning within fork1() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2007 14:38:18 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7DC38480C3AE5AE641F6D7E0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, During the AsiaBSDCon DevSummit we have go through the current KSE and some userland threading code, and I think that brings me back to the fork1() vs others races. The current logic, especially the locking order found in fork1() looks not very ideal according to my read. I have pursued some code from other BSDs, and I think we might want to address the following problems: - At which point we should consider that a process really exists? At this point, there is no clear point that we can call a process as "really born". It looks to me that PRS_NEW just indicate that a process is not "fully initialized", but it does not provide information about "how much initialization did we done". This would make several operation very questionable, and is more error-prone. As Guo (cc'ed) pointed out, there are chances that kill(0, ..) and kill(-1, ..) would not cover PRS_NEW processes, there might be also some other places where should take care of. - The locking scheme does not look pretty. We grab and release locks again and again, and it might be more optimal to collapse some work together, and re-consider synchornization with other parts of the kernel.= - Certain parts of struct proc is mostly not accessed frequently. For the sake of better exploit of cache, we may want to consider to move certain parts out from the struct. - The PID allocation is somewhat expensive when there are a lot of processes. This might not be a very big deal, though, but given that it requires to hold a sx_xlock, our scalability could be limited due to this. tjr@ has a proposed hash based PID allocation patch in his p4 branch, and NetBSD have an O(1) algorithm that may worth to have a look a= t. Cheers, --=20 Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! --------------enig7DC38480C3AE5AE641F6D7E0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF8sLLOfuToMruuMARCvCoAJ9qX9oF/NTbOghIKVybZUDb7o1vBACdFAWy A4/WU6gKcnKJRIHWKPvL25w= =d1Dj -----END PGP SIGNATURE----- --------------enig7DC38480C3AE5AE641F6D7E0--