Subject: Re: Call for review: The New Block/Character Device Switch Configuration
To: None <tech-kern@netbsd.org>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-kern
Date: 07/02/2001 21:30:29
[Forwarded with edits from a private response at the request of maekawa@.]

On Mon, 2 Jul 2001, Chris Torek wrote:

: >...but breaks compatibility.
:
: >Renumber the conflicting devices and provide compatibility with a kernel
: >compile switch providing redirects in the old slots, and I'm right with ya.
:
: That is why I provided the actual code for the "compat_dev" function.
:
: Of course, you have to do this at the same time you switch
: away from using 8-bit major and minor numbers.

...which doesn't work, because our (now 32-bit) dev_t uses an encoding
scheme that breaks your suggestion from the original message:

: In BSD/OS, we support backwards-compatibility with old (and non-native)
: file systems in the ioconf.c.${MACHINE} code.  (This depends on the fact
: that our dev_t encoding guarantees dv_makedev(1,0,0) > 65535.)

For us, there is no mapping of old to new dev_t's; device 1,0 is still
0x00000100.  We use the top 16 bits in a somewhat `different' split scheme
to add bits to both major and minor.

=====

Now, we *can* implement your suggested scheme, but instead of relying on the
top 16 bits being 0, we'd instead need to start numbering dynamic devices at
256, and subtract 256 from the device number when accessing the dynamic
array.  Just a slightly different way to have the same annoyance.  :)

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/