Subject: Re: Port independent cdevsw[]
To: Matthew Orgass <darkstar@pgh.net>
From: Greywolf <greywolf@starwolf.com>
List: tech-kern
Date: 10/19/2000 21:31:26
On Thu, 19 Oct 2000, Matthew Orgass wrote:
# Date: Thu, 19 Oct 2000 22:02:23 -0400 (EDT)
# From: Matthew Orgass <darkstar@pgh.net>
# To: Chris G. Demetriou <cgd@sibyte.com>
# Cc: Lennart Augustsson <lennart@augustsson.net>, tech-kern@netbsd.org
# Subject: Re: Port independent cdevsw[]
#
# On 15 Oct 2000, Chris G. Demetriou wrote:
#
# > And, finally, as I've expressed before, I'm of a mind to have the
# > tables defined neither statically nor at config time, but rather
# > dynamically at run time from linker-assembled tables defined by
# > drivers that need them. there are a few reasons for this:
#
# Devices certainly need to be defined dynamically, however the basic
# problem with major numbers is that they do not have any natural
# relationship to what the device actually is and therefore are much more
# likely to clash with other devices than if names are used. While an
# arbitration protocol is still necessary in case they do clash, using
# numbers to identify devices just makes such an occurance more likely
# without any benefit (other then possibly being somewhat less work to
# implement).
The idea behind doing numbers and device switches is that referencing
things through an array is typically much faster than doing a string
match.
I still think that majors are not evil. Maybe I'm just too much
of a dinosaur, I don't know.
The whole idea of dev_t things and /dev in the first place was that
the dev_t was the only way by which the kernel knew what userland
wanted.
I think that migrating it to something string-based or requiring a
hash table for such instances would be horribly inefficient.
# Matthew Orgass
# darkstar@pgh.net
--*greywolf;
--
*BSD: Hackers tested, mom approved.