Subject: Re: Device minor numbers conversion in COMPAT_NETBSD32
To: None <abs@NetBSD.org>
From: Joachim Koenig-Baltes <joachim.koenig-baltes@emesgarten.de>
List: tech-kern
Date: 01/04/2006 10:53:39
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...

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 
I have to somehow replace the linux dev (under NetBSD /emul/linux/dev) 
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.

The device numbers are a contract between the file system (with the 
nodes) and the running kernel.

What I'd like to see to address the problem is:

Have a mount option that specifies how to interpret (or "emulate") 
device numbers. Then each kernel can map the device numbers to his 
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 
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.

Joachim