[net.unix-wizards] Minor device numbers: too small!

faustus@ucbvax.UUCP (Wayne Christopher) (03/30/84)

There is really no problem - if you have more than 256 devices
that use a particular driver (very unlikely I would think) you
can just split them up between two major device numbers, and put
some duplicate entries in the *devsw[] tables...

	Wayne

sdyer@bbncca.ARPA (Steve Dyer) (03/31/84)

Though I cannot yet conceive of needing more than 256 minor device
numbers, it should be relatively easy for anyone with source code
or the ability to link a new kernel with customized new device drivers
to have more than 256 devices of a particular class (e.g. ttys.)

Rather than using a single major device number to specify a device class,
simply use *several*, and you'll get 256 for each major device you claim.
That is, duplicate the cdevsw[] entries for each major device number.  Now,
the only issue is how to resolve an individual device data structure (such
as a particular "struct tty") given both a major and minor device number.
Most drivers merely used the minor device number as an index into an array.
Here, you'll have to be a bit more careful, but it shouldn't be hard.

How long will it be before we hear: "User ID numbers: too small!"
-- 
/Steve Dyer
{decvax,linus,ima}!bbncca!sdyer
sdyer@bbncca.ARPA

rogers@dadla.UUCP (04/02/84)

	You could add another major number without too much
hassle and make more than 256.  It would take some work, but
I think it should work.


		-Roger Southwick

		...!tektronix!rogers

gam@proper.UUCP (Gordon Moffett) (04/04/84)

@
The minor device number is stored as a char.  This limits the number
of particular devices (eg, terminals) to 256.  If you have many tty's
this can clearly be a problem.

Have others encountered this limitation?  How have you dealt with it?
Anyone know if future releases of Unix will overcome this limit (in
a standard way)?

jerry@oliveb.UUCP (Jerry Aguirre) (04/05/84)

How long will it be before we hear: "User ID numbers: too small!"

Actually this has already happened.  The original unix used a char
to store the user id.  After all, more than 256 users on a PDP-8!
When the system grew they did some tricks of keeping track of who
had logged in.  Finally they went to ints for user ids.

					    Jerry Aguirre
    {hplabs|fortune|ios|tolerant|allegra|tymix}!oliveb!jerry

pete@kvvax4.UUCP (Pete Story) (04/10/84)

> How long will it be before we hear: "User ID numbers: too small!"
> Actually this has already happened.

You bet it did.  The uid is now an integer, but if you make it too big 
you may get trouble.  In particular, we tried using our staff numbers, 
so the ids were guaranteed unique and the same on all our machines.  
These can go well over 1000 - and at least lastcomm(1) and quot(1) 
needed changing to handle it.  (4.1 bsd)
-- 
Pete Story {decvax,philabs}!mcvax!kvport!kvvax4!pete
A/S Kongsberg Vaapenfabrikk, PO Box 25, N3601 Kongsberg, Norway
Tel.  + 47 3 739697       Tlx.   71491 vaapn n