Subject: Re: kernel-internal interface changes?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 03/25/2005 10:34:03
--rJ8inJ6ig7iY3YX9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 25, 2005 at 03:11:52AM -0500, der Mouse wrote:
[...]
> >> [...error when trying to use the package...]
> >> This isn't my idea of "it works with 2.0".
> > You should have done what pkgsrc was telling you (after all, it's
> > only one single command it's asking you to do!).
>=20
> Now that you've confirmed that it's not for 2.0 but rather for
> 2.0-plus-newer-pkg-tools, I will.  I assumed I'd done something wrong
> and got the wrong version of the package, or was trying to use it
> wrong, because the error seemed to be saying that what I had was not
> compatible with 2.0, conflicting with your statement that there was
> such a package that did work with 2.0.

pkgsrc evolves, and sometimes needs features from newer versions of
the pkgtools.  When this happen, you have to update them using the
pkgtools/pkg_install package.  That doesn't mean 2.0 is any less
supported by pkgsrc.

> > You should have looked at how things are done in -current/-3:
>=20
> > defpseudo tap {[unit =3D -1]}:            ifnet, ether, bpf_filter
>=20
> > The reason why there is a locator is to get config(8) to generate the
> > CFDRIVER_DECL() line in ioconf.c.
>=20
> Aha!  (Out of idle curiosity, if you have the time and inclination to
> satisfy it - and this may well be something that I don't know only
> because I'm at home and all this stuff is at work - how do all the
> kernel config bits get into sys/conf/files and sys/conf/majors and such
> when you use the package?  I specifically went looking for scripts and

They don't.

All the config(8) stuff hardwire the autoconf(9) structures in the
kernel binary.  When tap(4) is built as a LKM, there are routines to
attach to and detach from the autoconf(9) framework dynamically that are
used at appropriate times.

As for the device major number, I let it be allocated dynamically.
That's why the package provides a script that auto-creates the correct
device nodes at modload(8) time, when used as indicated in the MESSAGE
file.

> > The fun thing about this is that tap(4) (back when it was the very
> > simple and straightforward ethfoo(4)) was specifically written to be
> > an example of a LKM.  I really thought I explained enough, or at
> > least gave enough background, to the autoconf(9) APIs, in the
> > commentaries if if_tap_lkm.c.
>=20
> Well, for this, I definitely do not want an LKM, so I was ignoring
> anything that looked LKM-specific - including if_tap_lkm.c.  I'll give
> it a read-over.

Yes, it's LKM-specific, but it contains everything that is hidden from
you when you use config(8).

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--rJ8inJ6ig7iY3YX9
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBQkPbCtgoQloHrPnoAQKn5QgAjd65Tz5CzapEZk478DDC2zYB1A9T7H75
F5QMF/mZOcWCYbe0cUSjlP81bbRMe2Y3ekhngnzThlnzwDWrZviwpDUsuMFCIDlq
EutgVTihHbkozyevdfNeayKnG2eojNefL8k7gHzucUBdu8NacCruqqjqdUXanlU3
M7S05DQRdKhZTF+1AUX+KvNQthuVyPTL9vbRM695rbNlOs4K3eHwZE9hMdgJUwLC
ISadV3lABjIg/hi2lbIEX4ph47n8sYAV+lvVfCi65xANVwUBhIM3dQXQRV/4KEDD
qXCEHZh9Waqf0CBNdiLPr10FQ2y3zhXMAaGqTzvl3/9FqdOO+oPLDw==
=FDnG
-----END PGP SIGNATURE-----

--rJ8inJ6ig7iY3YX9--