Subject: Re: 32 bit dev_t, Revision 2
To: Todd Vierling <tv@NetBSD.ORG>
From: Darren Reed <>
List: tech-kern
Date: 01/12/1998 09:04:18
In some mail I received from Todd Vierling, sie wrote
> 4. The major device numbers will be renumbered into three blocks.  Major
> number 0 will not be used; it is reserved as a flag for "old" dev_t's.
> These three blocks will have separate bdevsw/cdevsw structures (planned to
> be merged into a devsw structure if the API for the device calls is
> rethought to include character and block distinctions in the calls).
> %0xxxxxxx xxxx:  If the top bit of the major number is 0 (major 0 through
> 4095), the device is a dynamically allocated device (planned for future
> expansion in a dynamic device system and/or LKMs). 
> %10xxxxxx xxxx:  If the top bit is 1 and the next bit is 0 (major 4096
> through 6143), the device is a statically numbered machine-independent
> device (anything in src/sys/dev et al.).  MI devices are kept consistent
> across all ports.
> %11xxxxxx xxxx:  If the top two bits are 1 (major 6144 through 8191), the
> device is a statically numbered machine-architecture-dependent device.  MD
> devices are kept consistent across all ports of the same ${MACHINE_ARCH}.
> MD devices which are ported to become MI will receive MI major numbers, but
> their MD numbers will not be decommissioned.

I assume for %10 and %11 there will need to be a registry kept, no ?

There are two examples of not requiring a registry implemened today:
Solaris 2 (each box has its own registry in /etc/name_to_major) and
FreeBSD with DEVFS.

Solaris 2 suffers from having all devices in name_to_major and cannot
boot if that file (or one of several others related to it) is corrupt.

FreeBSD reconstructs DEVFS everytime it boots...which inroduces
complications for preserving file attributes.

Whilst they are both inadequate, they remove any need for a registry.
I think the Solaris2 model is better and if it didn't die when failing
to parse certain files in /etc but dropped into /bin/sh, would kick arse.