Subject: Re: Port independent cdevsw[]
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.ORG>
From: Lennart Augustsson <lennart@augustsson.net>
List: tech-kern
Date: 10/15/2000 19:51:47
"Greg A. Woods" wrote:

> [ On Sunday, October 15, 2000 at 18:03:33 (+0200), Lennart Augustsson wrote: ]
> > Subject: Port independent cdevsw[]
> >
> > Why do we have a cdevsw[] and bdevsw[] for each port?  Purely historical
>
> IIRC it's because ports try to keep major/minor compatible with the
> original vendor-supplied OS for that platform....

As I said, historical reasons. :)


> > I suggest that we switch over to having a mostly port independent [bc]devsw
> > tables.  There is still a need to have port specific drivers so I suggest the
> > following design:
> >
> >     Set aside a part of the major device numbers for port specific driver,
> >     say 0-255.  The table for this will be port specific.
> >     The rest of the major numbers are port independent and stored in a
> >     central table.
>
> Much better would be if config(8) allocated the actual slot numbers from
> a common table -- hand-hacking *devsw[] entries is really bogus!  That
> common table could then driver MAKEDEV and all would be one!

That's certainly another option.  But you'd have to have one table per port
which still forces you to update in more than one place.  (You could have
one common table for all ports, but then you'd have to split the major
space like I suggested.)


--

        -- Lennart