Porting HAL to FreeBSD

David Zeuthen david at fubar.dk
Mon Jun 21 13:19:31 PDT 2004


Sorry for the lag,

On Sat, 2004-06-19 at 23:46 -0400, Joe Marcus Clarke wrote:
> > The goal of DBUS is to work on a very large number of OS'es, but due to
> > authentication issues (DBUS sports a quite flexible and extensible
> > security model) I think it only currently works on Linux since the
> > current authentication mechanism relies on credentials passing stuff on
> > sockets which is fairly non-portable as far as I understand; there were
> > some recent discussion here
> > 
> >  http://freedesktop.org/pipermail/dbus/2004-May/001093.html
> > 
> > and some here
> > 
> >  https://listman.redhat.com/archives/message-bus-list/2003-October/msg00075.html
> > 
> > However, DBUS has a dbus-sysdeps.[ch] files to abstract such details.
> I wonder if we couldn't adopt what is being used for gnome-keyring
> here.  Out-of-the-box, g-k doesn't work on FreeBSD due to the way
> credential passing on the socket is done.  However, I sent patches to
> the maintainer to fix this:
> http://bugzilla.gnome.org/show_bug.cgi?id=142373

I suppose this could work; I saw Kristian Høgsberg note that there's
also an authentication mechanism that relies on a cookie file in the
users home directory; to authenticate, the client must prove that it has
read access to this file by reading a cookie from it and send it to the
server end.  It relies on a safe home directory but is quite portable.

> > > FreeBSD has userland hooks for getting certain device events.  On 4.X,
> > > we have a usbd that can recognize when USB devices are attached, and
> > > spawn programs (e.g. moused) to handle certain drivers.  On 5.X, we have
> > > a more generic devd which handles similar attachment events, but does so
> > > more a plethora of other devices (e.g. PCMCIA devices).
> > > 
> > 
> > Very nice.
> While we have hotplug support under 5.X via /dev/devctl, there are some
> caveats.  If the user is already using devd on this system, we cannot
> open devctl even for reading.  This is a known bug, but it's not clear
> on if it will be fixed for 5.3-STABLE.

Uh, that sounds pretty technical; I'll better get up to speed :-)

> > > This property would not exist on FreeBSD.  I assume that one would just
> > > ignore this, or create a new, FreeBSDs-specific, property if warranted?
> > 
> > Right; the linux.sysfs_path stuff is required for every device on Linux
> > such that applications and libraries using HAL can find more info on the
> > device. I suppose that a similar construct would be used on FreeBSD.
> This sounds like applications may be expecting sysfs after all.  While
> we could create something like like:
> freebsd.dev_sysctl="dev.umass.0"
> Applications would need to be taught to use sysctl(3) and not simply
> open(2) to access that path.

Yeah, for using devices you'll still need the abstraction bits in each
application / library as usual


hal mailing list
hal at freedesktop.org

More information about the Hal mailing list