Subject: Re: Compiling and configuring the kernel for a device driver
To: Sera <esha@sharada.ncore.soft.net>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: tech-kern
Date: 11/04/1998 11:04:46
> 
> David Brownlee wrote:
> 
> >         I'd love to help but I don't know what those files do under
> > linux
> >         - could you give more details?

Hmm, I think SCO invented those files (you just have to love them ... :-(( ).

> >
> >                 David/absolute
> >
> 
>  I have netbsd/i386 and i'm beginning to write a device driver for a
> JPEG card on PCI bus.  I picked up a doc from FreeBSD which gives a
> brief description of  'Writing Free BSD Device Drivers' . But even
> though I could find the files he specifies,  the entries in those files
> (ex :  files.i386) are different. So I want to know the actual procedure
> NedBSD follows, the files related to that, the syntax of the entries in
> the files.
> 
> FreeBSD says :
> (one of the links from which I picked up :-
> winwww.ts.kiev.ua/tech/free/tutorials/ddwg/ddwg.html )
> 
> 1.Adding to the driver list  - uses the file files.i386

If your driver should run on multiple platforms use

dev/pci/files.pci

'clone' an exsting entry 
# NCR 53c8xx SCSI chips
device  ncr: scsi
attach  ncr at pci
file    dev/pci/ncr.c                   ncr

to:

# jpeg xx
device  jpg
attach  jpg at pci
file    dev/pci/jpg.c                   jpg
file    dev/pci/jpg1.c                   jpg
...



> 2. Make room in conf.c - uses the file conf.c  (declare your entry
> points here)

The sad part, add it to all arch/xx/xx/conf.c you want the driver to work with.

WE NEED A FIX FOR THIS!!

> 3.Adding your device to the config file. (add a line describing your
> device and on which bus it is)

Yes

> 4. config the Kernel (before building the Kernel makes a compile tree)

Yes

> 
> Is this procedure holds good for NetBSD also ?  If so can you give me
> some information or any doc or pointers to some sites ?

This works on NetBSD (besides the different location of the appropriate files.xx files).

Stefan

> 
> 
> Please do help me
> Sera
> 

--
Stefan Grefen                                Tandem Computers Europe Inc.
grefen@hprc.tandem.com                       High Performance Research Center
 --- Hacking's just another word for nothing left to kludge. ---