Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 1998 10:20:52 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
Cc:        Nick Hibma <nick.hibma@jrc.it>, sos@FreeBSD.ORG, hackers@FreeBSD.ORG, jkh@FreeBSD.ORG
Subject:   Re: major/minor numbers 
Message-ID:  <Pine.BSF.4.01.9812031016440.367-100000@herring.nlsystems.com>
In-Reply-To: <199812030411.NAA27727@zodiac.mech.utsunomiya-u.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 3 Dec 1998, Kazutaka YOKOTA wrote:

> 
> >For USB support I need at least 1 but possible 3 or more major numbers.
> >
> >	usb0
> >
> >and possibly
> >
> >	ums0
> >	ulpt0
> >	ucuaa0	(maybe)
> 
> We shall be needing major numbers for the ISA AT keyboard and the USB
> keyboard too.  With USB, we can have multiple keyboards together with
> the standard ISA AT keyboard.  The user will use either one keyboard
> for his/her console and may use the other keyboards as auxiliary input
> device.  We need device nodes for them.
> 
> It won't be long before this will happen; I am currently working on
> splitting and generalizing keyboard I/O code from syscons and
> implementing mechanisms for syscons to use whatever keyboard available
> in the system, and the other keyboard will be made readable via a cdev
> device driver.
> 
> Nick and Soeren, I will be sending you a snapshot of the experimental
> code to you tonight.  It's almost finished :-)

Can we take this as an opportunity to move syscons out of sys/i386/isa and
share the code between i386 and alpha (and any other pci based
architectures which might appear).  We can do this now if we segregate the
device probe and attach methods and make sure that all accesses to video
ram are wrapped up in macros.

> 
> >Brian Feldman came up with the idea to use major numbers together with
> >other drivers, for example have ums use the numbers that also psm uses
> >(their both PS/2 mice). Anyone tried this? Sounds a bit odd if you do
> >not want to divide minor number space amongst them statically.
> 
> I may be wrong, but, my understanding is...
> 
> When the kernel accesses device driver functions, it will invoke them
> as:
> 
> 	(*cdevsw[major(dev)]->d_open)(dev);
> 
> This means if we are to share a major number between different
> drivers, we need to have a way to multiplex access to the drivers via
> a single major number.  Do we have such mechanisms in our kernel now?

It is possible to have two drivers which use the same major but only if
exactly one of those drivers has attached device instances.  The
registration of the cdevsw would need to move to the attach method of the
driver (its normally done by SYSINIT now).

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9812031016440.367-100000>