Subject: Re: Binary only drivers in sys?
To: Bruce J.A. Nourish <bjan+tech-kern@bjan.net>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 08/25/2003 10:51:35
On Sun, 24 Aug 2003, Bruce J.A. Nourish wrote:

> I'm taking this interlude to ask a question: what should we do about
> non-BSD licensed kernel code? Specifically, the atheros driver relies
> upon a binary only ELF object, which is released under a licence that
> prohibits use and distribution in modified form. By FCC regulations,
> this software cannot be released under any other license.

I think it'd be fine as something that's available. I'm not sure if it
should be in the NetBSD CVS repository, but I think we should support it.
It may go against our, "everything's freely available and re-usable"
desire, but if we label it well, we can keep 3rd parties from having
surprises.

> FreeBSD solved the problem by putting the non-BSD object in a contrib
> subdir. We don't have such a subdir for the kernel. As the goal of
> this porting effort is the get the code into the kernel, the Core
> team will have to decide where they want it. Also, when I'm done with
> ath(4), I'm considering porting ltmdm, the Lucent windmodem driver, from
> FreeBSD; this also relies on a restrictively licensed .o file.
>
> I've considered LKM's as potentially the ideal solution to the problem,
> but there are no examples of LKM network drivers. Could such a thing
> be made reasonably easily? How would I go about it?

The problem with network driver LKMs is unhooking them. Way back, like for
1.4, I wanted to start work on a LocalTalk LKM. The first issue was that
you couldn't delete network interfaces. So I did a lot of work on
ifdetatch. Only part of it actually made it into the tree, much to my
dismay (I had added code to do reference counting on interface structures,
and ifaddrs; the latter's also needed for fine-grained network SMP).

We have enough code now that you should be able to just make a network
LKM. The ifdetatch code that works for hot-swap should do you fine.

> Also, I believe FreeBSD's loader(8) can insert modules into the kernel
> at boot. Would anyone want such a feature in NetBSD? The only use I
> can think of would be to let people with binary-only network drivers
> install/netboot NetBSD. It would certainly be nice, though.

We have support in the LKM framework now to load lkms at boot. See
/etc/rc.d/lkm{1,2,3}. We have "BEFORENET", "BEFOREMOUNT", and "AFTERMOUNT"
as places that lkms can get loaded. So with a disk'd root (or a miniroot),
you can load network LKMs.

Take care,

Bill