From owner-freebsd-hackers Tue May 22 23:59: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from kawoserv.kawo2.rwth-aachen.de (kawoserv.kawo2.RWTH-Aachen.DE [134.130.180.1]) by hub.freebsd.org (Postfix) with ESMTP id 5AD8C37B42C; Tue, 22 May 2001 23:58:59 -0700 (PDT) (envelope-from alex@big.endian.de) Received: from zerogravity.kawo2.rwth-aachen.de (zerogravity.kawo2.rwth-aachen.de [134.130.181.28]) by kawoserv.kawo2.rwth-aachen.de (8.9.3/8.6.9) with ESMTP id IAA19956; Wed, 23 May 2001 08:58:58 +0200 Received: by zerogravity.kawo2.rwth-aachen.de (Postfix, from userid 1001) id CA07214CD5; Wed, 23 May 2001 08:58:57 +0200 (CEST) Date: Wed, 23 May 2001 08:58:57 +0200 From: Alexander Langer To: SJ Cc: freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Device driver questions Message-ID: <20010523085857.B1103@zerogravity.kawo2.rwth-aachen.d> References: <20010523003414.51600.qmail@web13405.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010523003414.51600.qmail@web13405.mail.yahoo.com>; from sandejain@rocketmail.com on Tue, May 22, 2001 at 05:34:14PM -0700 X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake SJ (sandejain@rocketmail.com): Hi! > 1. "ioconf.c" contains struct config_resource and > config_device definitions for declarations in > "config" file. But I noticed that for some devices > e.g. device atadisk > device atapicd > ... > the corresponding lines in ioconf.c are missing?? I think it's because ata is a self-identifying bus. Not sure, though. Are any PCI-only devices listed? > 3. File naming question: > whats the reasoning behind having "bus.h" and > "bus_private.h"....whats the significance of > "private" here. drivers include bus.h, kernel does also include bus_private.h > 4. concept behind having devclasses...I know that > devclasses for a particular bus holds devices and > device drivers for that bus. But then whats the > need for defining a devclass for each driver we > write ? Because you can hold multpiple devices that are enumerated, e.g. xl0, xl1, ... The devclass is unique for each driver, but not for different busses. You can have ed0 on ISA and ed1 on PCI for example, using the same devclass. If ISA and PCI subdrivers are using a different devclass, the enumeration breaks. > 5. Any poniters to literature which explains the > design philosophy and code specific help for device > drivers in freebsd - I am referring to files > kern/subr_bus.c, bus.h, bus_private.h, isa/* etc. Use the source, luke :-) Seriously, subr_bus.c is quite nice to read if you read it togethers with, say, sys/pci/pci.c. That makes the concept quite clear. The developer's handbook might be worth reading for you, also there are some tutorials on the website which explain a little. Alex -- cat: /home/alex/.sig: No such file or directory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message