Subject: Re: A potential step towards modularisation
To: Quentin Garnier <cube@NetBSD.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 02/09/2004 09:00:17
--9Ek0hoCL9XbhcSqy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Feb 08, 2004 at 10:35:19AM +0100, Quentin Garnier wrote:
> Le Sat, 7 Feb 2004 19:33:54 -0800
> Bill Studenmund a ecrit :
> [...]
> > > The user will have several choices:
> > >=20
> > > Case 1, good'old GENERIC_LAPTOP:
> > >=20
> > > ex* at pci? device ? function ?
> > > ex* at cardbus? cardslot ?
> > >=20
> > > =3D=3D=3D> No module is created
> > >=20
> > > Case 2:
> > >=20
> > > module ex* at pci? device ? function ?
> > > module ex* at cardbus? cardslot ?
> > >=20
> > > =3D=3D=3D> 3 modules are created:  ex.ko, ex_pci.ko and ex_cardbus.ko.
> > >=20
> > > Case 3:
> > >=20
> > > module ex* at pci? device ? function ?
> > > ex* at cardbus? cardslot ?
> > >=20
> > > =3D=3D=3D> only one module is created, since attribute ex_cardbus is =
static
> > > and
> > >      depends on attribute ex.  The module name is ex_pci.ko.
> >=20
> > My concern is that by having multiple module options, we create a
> > support morass. If this implementation is the direction we all want to
> > go, I'd rather have it than nothing.
>=20
> The issue here is that prefixing a device instance by 'module' will make
> every possible modules: the module for the driver itself, and all its
> direct dependencies that nothing statically compiled depend on.

Hmmm.....

So if I had just:

module ex* at pci? device ? function ?

do I get both ex.ko and ex_pci.ko?

> > I'm mainly thinking of audio drivers, but usb would probably fit, and I
> > bet there will be more with time.
>=20
> Even though the user has some control (I'd hope so :) over what modules
> are created, their content will not usually change.

Ok, that's a help.

> There are already issues with our current monolithic kernel: need-count is
> not available to LKMs (neither is need-flag, but if you lack the symbols,
> you know it's not there).

I think need-count won't quite fit. As I recall, it's for static=20
allocation of driver resources. For an lkm, we can either embed a value=20
(in the lkm), or we can push to move drivers away from it.

Take care,

Bill

--9Ek0hoCL9XbhcSqy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAJ7yhWz+3JHUci9cRApm9AJ0etWNqttl+3CBdNlVz1z+b2JBwoACfbpwY
/iQozqA7+8PiuCQH2GxXS5w=
=9k0p
-----END PGP SIGNATURE-----

--9Ek0hoCL9XbhcSqy--