Subject: Re: Port independent cdevsw[]
To: Lennart Augustsson <lennart@augustsson.net>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 10/15/2000 23:50:07
On Sun, Oct 15, 2000 at 06:03:33PM +0200, Lennart Augustsson wrote:
> I know this has been discussed before, but I'd like to bring it up again.
> 
> Why do we have a cdevsw[] and bdevsw[] for each port?  Purely historical
> reasons I'd say.  It's a real nuisance.  Whenever you add a MI device

It's also usefull to use a 'native' file system. For example, you can boot
a NetBSD kernel on a SunOS disk and it'll just work, because of COMPAT_SUNOS
and because enouth devices nodes are the same.

> driver you have to change far to many places.  You need to update the
> conf.c file for all ports that can have the device, and then the MAKEDEV
> for the corresponding ports.  This is annoying and error prone.
> 
> 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.
> 
> This design would allow us to slowly move over to MI drivers since the
> old tables will still work.  To keep backwards compatibility we can
> just keep duplicate entries in the port specific tables and the new one.

This would also take care of the compat issue I raised above :)

--
Manuel Bouyer <bouyer@antioche.eu.org>
--