Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2005 10:21:59 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-drivers@freebsd.org
Subject:   Re: How to make my new driver be configurable in the kernel configuration file?
Message-ID:  <200511151022.00866.jhb@freebsd.org>
In-Reply-To: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com>
References:  <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 15 November 2005 03:59 am, Yong Ma wrote:
> Hi all,
> I wrote and debuged my driver for a new device in KLD mode,now I want to
> plug it into the kernel,so that it can be loaded when the system  boots,and
> make it be configurable in the kernel configuration file like other device
> driver as "device XXX",I don't know what to do,could anyone be kind to help
> me?

To add your driver you update the src/sys/conf/files* files.  If your driver 
is machine independent, you can add it to src/sys/conf/files.  For example, 
here are the lines in sys/conf/files for the cy(4) driver:

dev/cy/cy.c                     optional cy
dev/cy/cy_isa.c                 optional cy isa
dev/cy/cy_pci.c                 optional cy pci

If your driver only works on a single architecture (such as i386) then add it 
to the architecture file sys/conf/files.<arch> (e.g. sys/conf/files.i386).  
The device names after 'optional' specify which devices must be enabled in 
the kernel config for that file to be included.  Thus, in the example above, 
src/sys/dev/cy/cy.c is included as long as 'device cy' is in the kernel, but 
src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and 'device isa' 
are in the kernel config file.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511151022.00866.jhb>