Subject: Re: Device minor numbers conversion in COMPAT_NETBSD32
To: Joachim Koenig-Baltes <joachim.koenig-baltes@emesgarten.de>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 01/04/2006 11:46:35
--MEAi/rlBiy15p0nd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jan 04, 2006 at 10:53:39AM +0100, Joachim Koenig-Baltes wrote:
> On Wed, Jan 04, 2006 at 01:29:41AM +0000, David Brownlee wrote:
> > I'm probably missing something here, but what would the
> > problem be with selecting new, unconflicting device ids
> > for both ports, and having the old device ids enabled under
> > a compat option (including a sysctl if preferred). New
> > kernels default to the compat enabled, and new MAKEDEV
> > creates new nodes.
> >
> > Document it clearly, enable it in the kernel on COMPAT_30 or
> > earlier, and make the kernel print a warning when it sees an
> > old form /dev/console node.
> >
> > No flag day, and we get a 'perfect' set of device numbers.
> >
> > Taken to an extreme its an oportunity to make _all_ ports work
> > from the same unified set of device numbers. Mmmm...
>=20
> I think it would be nice to have that for NetBSD, but I think the
> problem is also relevant for emulation. E.g. I would like to use
> an existing working linux installation under emulation. For that to work=
=20
> I have to somehow replace the linux dev (under NetBSD /emul/linux/dev)=20
> entries (delete or replace by NetBSD equivalents). I have a setup where
> I create different device nodes depending on whether I want to use
> the linux installation under xen or emulation which is a bit annoying.
>=20
> The device numbers are a contract between the file system (with the=20
> nodes) and the running kernel.
>=20
> What I'd like to see to address the problem is:
>=20
> Have a mount option that specifies how to interpret (or "emulate")=20
> device numbers. Then each kernel can map the device numbers to his=20
> internal representation. So an i386 kernel can map amd64 dev entries
> and vice versa. And an i386 kernel (or amd64) could map linux i*86=20
> device numbers to its internal representation and all I'd have to
> do to run an existing linux installation under emulation is to specify
> a mount option for the linux partition with the dev entries.

I like that idea.  That would indeed answer the question of what
processes intend to see.  David's idea solves the numbering issues for
netbsd32 in 4.0, and under COMPAT_30, COMPAT_NETBSD32 would use
Joachim's idea for proper work...

--=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.

--MEAi/rlBiy15p0nd
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iQEVAwUBQ7uni9goQloHrPnoAQJMOgf/QhFJaCnyuf+Y4v2cwviUBvGU9AMNjqYP
y9jvtNLDqhO/Zl2kCNIvPHQMC3OEnDwu4lFqsPoiMmwtmxyStIkxGRntYg0udipG
6YfEIWIXo+sX/vW4r0i8q3HmEcRGpcGKbs6AhFC1erWJ6HVNH2BZRfbG/UxbS0zR
FyFK3/p1lHS1+ehwJc8ysGgNHvPld8ydixEpKBBM9QC7kMgiXRT6TVBMvkV/RV9W
AV165ExqhtqTN3/1FXFiJKE2IwiknjEg6E1SHoyf87urLt+cCvCOIm8SEkhj07Ln
pnqeJOGVOxQGp1k85zlHkl1wo7FsohG3rKaFF9La6gwQRwzfArfOkw==
=r2di
-----END PGP SIGNATURE-----

--MEAi/rlBiy15p0nd--