Date: Wed, 23 May 2001 10:38:00 -0700 (PDT) From: SJ <sandejain@rocketmail.com> To: Alexander Langer <alex@big.endian.de> Cc: freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Device driver questions Message-ID: <20010523173800.84311.qmail@web13404.mail.yahoo.com> In-Reply-To: <20010523085857.B1103@zerogravity.kawo2.rwth-aachen.d>
next in thread | previous in thread | raw e-mail | index | archive | help
--- Alexander Langer <alex@big.endian.de> wrote: > 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? The configuration contains the following two lines: device pci0 device pci1 for which the corresponding ioconf.c output is: struct config_resource pci0_resources[] = { }; #define pci0_count 0 struct config_resource pci1_resources[] = { }; #define pci1_count 0 > > > 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 But still the name "private" confuses me...according to me it should have been "bus_public.c". Any comments? thanks for your help sandeep > > > 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 __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ 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?20010523173800.84311.qmail>