From owner-freebsd-hackers Thu Dec 3 02:22:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA25390 for freebsd-hackers-outgoing; Thu, 3 Dec 1998 02:22:28 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA25379; Thu, 3 Dec 1998 02:22:11 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.9.1/8.8.5) with SMTP id KAA61695; Thu, 3 Dec 1998 10:20:52 GMT Date: Thu, 3 Dec 1998 10:20:52 +0000 (GMT) From: Doug Rabson To: Kazutaka YOKOTA cc: Nick Hibma , sos@FreeBSD.ORG, hackers@FreeBSD.ORG, jkh@FreeBSD.ORG Subject: Re: major/minor numbers In-Reply-To: <199812030411.NAA27727@zodiac.mech.utsunomiya-u.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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