From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 15:40:40 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E26A16A41F for ; Tue, 15 Nov 2005 15:40:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (66-23-216-219.clients.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7AA443D45 for ; Tue, 15 Nov 2005 15:40:39 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2002034 for multiple; Tue, 15 Nov 2005 10:40:49 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAFFealV087129; Tue, 15 Nov 2005 10:40:36 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Tue, 15 Nov 2005 10:21:59 -0500 User-Agent: KMail/1.8.2 References: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> In-Reply-To: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511151022.00866.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: How to make my new driver be configurable in the kernel configuration file? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 15:40:40 -0000 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. (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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org