Subject: Re: guidelines for including a newly-created driver?
To: Netbsd Mailing List <>
From: Jason Thorpe <>
List: port-i386
Date: 08/12/1996 19:08:36
On Mon, 12 Aug 1996 13:02:41 -0700 
 Netbsd Mailing List <> wrote:

 > assuming that one has written a driver (call it "whatever.[ch]"), how
 > does one insert it into the configuration so that it is correctly
 > placed into the source tree for later compilation?  is there a set
 > of documents/guidelines for doing this?

Hm, there's not a manual page on that (yet), but I can answer your question:

"it depends" :-)

What kind of driver is it?  Is it ISA, EISA, or PCI?  (I'll assume it's 
one of those three, since you posted this to port-i386 :-)

If you wrote an MI ISA, EISA, or PCI driver, you'll need to place it in 
sys/dev/{isa,eisa,pci}/files.{isa,eisa,pci} ...

[ e.g. foo is a completely isa driver ]

# The Zap Products foo card
device foo
attach foo at isa
file	dev/isa/foo.c		foo

That will get it to pull in foo.c.  Now, if you need to put this in the 
{b,c}devsw, it needs to have a "flag" generated:

device foo
attach foo at isa
file	dev/isa/foo.c		foo needs-flag

That will generate a "foo.h" in the compile directory, which will define 
NFOO to 0 if no foo in config file, or 1 if foo is in the config file.

Hope that helps ... let me know if you have more questions.

 -- save the ancient forests - -- 
Jason R. Thorpe                             
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939