From owner-freebsd-arch@FreeBSD.ORG Tue Jan 29 12:07:50 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F32116A417; Tue, 29 Jan 2008 12:07:50 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id A51E613C45D; Tue, 29 Jan 2008 12:07:49 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 80D4443DC2A; Tue, 29 Jan 2008 14:07:48 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HYFwKyZoOUFy; Tue, 29 Jan 2008 14:07:48 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 235E543DBC2; Tue, 29 Jan 2008 14:07:48 +0200 (EET) Message-ID: <479F1713.2030705@icyb.net.ua> Date: Tue, 29 Jan 2008 14:07:47 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20080123) MIME-Version: 1.0 To: freebsd-gnome@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-arch@freebsd.org Subject: HAL/freebsd architecture 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: Tue, 29 Jan 2008 12:07:50 -0000 This is not a concrete suggestion and I can not volunteer to write any code yet (unfortunately). Recently I played a little bit with DesktopBSD live CD and liked some add-on software provided there and some implementation approaches were quite interesting for me too. Just in case, the tools can be found in sysutils/desktopbsd-tools and there is a FAQ page on using them in "plain" FreeBSD: http://desktopbsd.net/wiki/doku.php?id=doc:desktopbsd_tools_in_freebsd This got me thinking: maybe we could also apply the same approach as used for dbsd-hwnotify to HAL/FreeBSD. I.e. hald could do initial querying of devices and then just wait for notification from devd about any changes. This, of course, would require some changes to the base system, but I think that these would be useful for many more applications than just hald. Some things that come to mind first: "forward" instruction to devd.conf to execute some action for all events in addition to any event-specific actions. This is so that we could preserve current devd functionality but also allow to delegate some decisions to other software. I think that this way we could get a lot of current hald functionality for free, without the special probing/polling routines that have to written at present. But this would probably mean some additional changes in kernel-land. For example, there are complaints now that CD-ROM drivers do not automatically notice media removal/change and, for instance, do not update GEOM_LABEL information [*]. This is important for HAL functionality too. So, media checking/polling would probably have to go to the CD-ROM drivers. But, as I said earlier, this would probably be a universal good - we could kill several birds with one stone. To summarize: most of what FreeBSD hald currently does in userland is either already done in kernel as well or it better be done in kernel. hald should just mostly listen to notifications coming from kernel. Most likely this is best done via devd. Such approaches, of course, would require changes to pieces of kernel and to devd. And, for sure, there could be some quite hard cases. E.g. I don't how to notify userland about media change via devctl mechanism. [*] http://www.freebsd.org/cgi/query-pr.cgi?pr=119743 -- Andriy Gapon