From owner-freebsd-x11@FreeBSD.ORG Tue Feb 15 16:29:02 2011 Return-Path: Delivered-To: freebsd-x11@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3CAB1065679 for ; Tue, 15 Feb 2011 16:29:02 +0000 (UTC) (envelope-from kibi@ikibiki.org) Received: from glenfiddich.ikibiki.org (glenfiddich.ikibiki.org [88.191.124.82]) by mx1.freebsd.org (Postfix) with ESMTP id 64BEF8FC1B for ; Tue, 15 Feb 2011 16:29:01 +0000 (UTC) Received: from home.ikibiki.org ([88.164.242.219] helo=kitty) by glenfiddich.ikibiki.org with esmtp (Exim 4.69) (envelope-from ) id 1PpNlp-0003tN-B3; Tue, 15 Feb 2011 17:28:57 +0100 Received: from kibi by kitty with local (Exim 4.72) (envelope-from ) id 1PpNlo-0006Jd-5K; Tue, 15 Feb 2011 17:28:56 +0100 Date: Tue, 15 Feb 2011 17:28:55 +0100 From: Cyril Brulebois To: Warner Losh Message-ID: <20110215162855.GR15960@debian.org> References: <20110213124019.GH7840@debian.org> <4D596ECB.8080404@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mhjHhnbe5PrRcwjY" Content-Disposition: inline In-Reply-To: <4D596ECB.8080404@bsdimp.com> Organization: Debian User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Warner Losh , freebsd-x11@FreeBSD.org, xorg-devel@lists.x.org, debian-bsd@lists.debian.org, miwi@FreeBSD.org Subject: Re: xorg-server/*bsd: moving from hal support to devd support? X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 16:29:02 -0000 --mhjHhnbe5PrRcwjY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Warner, Warner Losh (14/02/2011): > I'm mentioned this several times now: Get me a spec for what Linux > udev provides, and what services are needed, and I'll make a > compatible implementation on FreeBSD. as far as X is concerned, see Dan's reply to my first mail: http://lists.debian.org/debian-bsd/2011/02/msg00120.html I think we really don't care how udev works, we just need to gather: - devices available when X starts, - devices updated while X is running. What follows was performed on a GNU/kFreeBSD system in QEMU. For now, I tried to print all variables mentioned in devd.conf(5), and used =E2=80=9Cusb_add mouse=E2=80=9D/=E2=80=9Cusb_del 0.2=E2=80=9D in the Q= EMU console (adding/removing an USB mouse). That notified me about ugen0.2 getting ATTACHED and DETACHED. Since I'm pretty unfamiliar with FreeBSD, I couldn't link that to the according /dev/ums0 being created/deleted. Since I wanted to try and play with hotplug anyway, I wrote a tiny daemon to perform input bookkeeping (inputbk), which does: - list all devices through libdevinfo which seem to be input devices (for now I matched on the drivername, being one of: atkbd, psm, ukbd, ums; uhci should probably be added, but I coudln't check myself); - sleep one second (which could easily be replaced with waiting for a devd ATTACH/DETACH event); - list all devices again, and print added/deleted devices. Then in the xorg-server sources, I started a config/inputkb.c file, and added a device based on the information I printed from the inputbk daemon (which I hardcoded to check quickly how it went), which gave me X working without configuration, and without hal. Now, I'm wondering where to go from here. Given what I wrote up to now, my next move to check hotplug works properly: - make inputbk perform a blocking open on a fifo for writing, - make it wait for a reader to write a listing of devices, - then make it loop and only write updates there. On the X side, we would be doing: - read the initial listing, adding devices as appropriate, - add this fifo to the big select() of X, using a callback which would trigger device addition/removal as notified through the socket by inputbk. In a perfect world, we should be able to have several readers, since we might have some X instances running in parallel, so the named pipe approach is probably a bad idea (then, using a socket and adding a few lines of code would buy a daemon handling several clients). Also, I'd be happy to see the above-mentioned bookkeeping go in some other place. AFAICT, devd is appropriate for change notifications, but I'm not sure its purpose is also to keep a list of available devices. What do you think? KiBi. --mhjHhnbe5PrRcwjY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk1aqccACgkQeGfVPHR5Nd33zACdF36eiVau5ykteeQzs7VKCIHX TCUAn2Z0lRWUbv4y0QQmCzMaB1X8+Keb =p2mM -----END PGP SIGNATURE----- --mhjHhnbe5PrRcwjY--