Subject: Re: 32 bit dev_t
To: Todd Vierling <tv@NetBSD.ORG>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: tech-kern
Date: 01/15/1998 11:52:41
> - mknod(8) will make 16-bit device nodes (or N bit device nodes, depending
> on command line switches) if passed two numerical arguments. It will make
> 32 bit device nodes if passed three numerical arguments in
> `major unit subunit' format.
> - major() and minor() are still the preferred way of getting at the
> internals of a dev_t (though only the kernel should care, anyway).
> Devices may or may not adhere to the `unit'-`subunit' split, so they
> should use their own semantics on handling the minor bits.
My suggestion here is "do it the way BSDI did'.
Like I said, I'm just not particularly concerned about MAKEDEV/mknod
compatibility.
Having 'dv_unit()' and 'dv_subunit()' in the kernel would be a good
idea. Also a good idea might be to rename 'minor()' in the kernel to
'dv_minor()', so that no devices will ever try to use the old
semantics of minor numbers again w/o being inspected.
There's only so much in the way of semantic freedom a given device
should have in interpreting its device nodes. 'real' devices should
use 'dv_unit()' to figure out which device unit is being accessed.
dv_subunit() usage should be device dependent, but should be
as consistent as possible within classes of devices.
I'm not even so convinced that things like BPF, which BSDI allowed to slide
by using the old minor() should be allowed to do so.
chris