Subject: Re: why is partition c always the full disk?
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 07/15/1998 09:49:33
>> [...], because someone (mycroft, I think it was) already committed
>> the following [major/minor/makedev macros]
>> In short, we *already* have 32-bit dev_ts, with 20 bits of minor
>> number, and all existing device nodes continue to work Just Fine.
> Yes, but other than the dial-in/out flag for tty's, we don't use more
> than the first 8 bits or so.

That was meant as a reply to the person who (correctly) pointed out
that 16 partitions means one more bit for the partition number and
hence one fewer bit for the drive number - the point being that a
system with 8 bits of minor number and 8 partitions can have up to 32
devices per driver, but with 16 partitions, on 16 devices.  Apparently
this is a real limitation for a few of the biggest NetBSD systems out
there.  My point was just that that is currently a non-problem.

>> Yes, switching an existing system to 16 partitions requires some
>> delicate tap-dancing in /dev.  [...]
> The above's why we haven't switched.

> The idea is to tie the switch to using a new major number for a block
> device.  A device node with the old major number has 8 partitions,
> and a device node with the new major number has 32 partitions.

No reason it couldn't be done...though it would be a little ugly,
because it would mean that not every driver could use the DISKUNIT and
DISKPART macros.

I've been trying to come up with a way of handling this automatically
at boot time: have userland look at /dev and tell the driver how many
partitions per drive /dev appears to be expecting.  (For people who
have unusual ways of doing /dev for some reason, the userland program
could also take an overriding value on its command line instead of
always looking at /dev.)  The biggest problems arise when your boot
device isn't drive zero of its driver - there's no *conceptual*
problem, because disk minors are conceptually <drive,partition> pairs.
But that's not how the existing internal interfaces work.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B