From owner-freebsd-current@FreeBSD.ORG Thu Jan 8 18:48:59 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4907D1065672 for ; Thu, 8 Jan 2009 18:48:57 +0000 (UTC) (envelope-from sziszi@bsd.hu) Received: from mail.rubicom.hu (mail.rubicom.hu [89.147.80.28]) by mx1.freebsd.org (Postfix) with ESMTP id A33798FC12 for ; Thu, 8 Jan 2009 18:48:57 +0000 (UTC) (envelope-from sziszi@bsd.hu) Received: from localhost ([127.0.0.1] helo=mail.rubicom.hu) by mail.rubicom.hu with smtp (Exim 4.63) (envelope-from ) id 1LKzJ9-00012k-08 for freebsd-current@freebsd.org; Thu, 08 Jan 2009 19:08:39 +0100 Received: from ip5993549e.rubicom.hu ([89.147.84.158] helo=baranyfelhocske.buza.adamsfamily.xx) by mail.rubicom.hu with esmtp (Exim 4.63) (envelope-from ) id 1LKzJ8-00012c-TC for freebsd-current@freebsd.org; Thu, 08 Jan 2009 19:08:38 +0100 Received: from baranyfelhocske.buza.adamsfamily.xx (localhost [127.0.0.1]) by baranyfelhocske.buza.adamsfamily.xx (8.14.3/8.14.3) with ESMTP id n08I8caV005946 for ; Thu, 8 Jan 2009 19:08:38 +0100 (CET) (envelope-from sziszi@bsd.hu) Received: (from sziszi@localhost) by baranyfelhocske.buza.adamsfamily.xx (8.14.3/8.14.3/Submit) id n08I8chb005945 for freebsd-current@freebsd.org; Thu, 8 Jan 2009 19:08:38 +0100 (CET) (envelope-from sziszi@bsd.hu) X-Authentication-Warning: baranyfelhocske.buza.adamsfamily.xx: sziszi set sender to sziszi@bsd.hu using -f Date: Thu, 8 Jan 2009 19:08:38 +0100 From: Szilveszter Adam To: freebsd-current@freebsd.org Message-ID: <20090108180838.GA3094@baranyfelhocske.buza.adamsfamily.xx> References: <321406.5257.qm@web63908.mail.re1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <321406.5257.qm@web63908.mail.re1.yahoo.com> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: Adding a new kernel module? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 18:48:59 -0000 Hello Barney, On Thu, Jan 08, 2009 at 09:08:07AM -0800, Barney Cordoba wrote: > I'm testing a new kernel module that needs to be compiled in, and everything works fine except that make doesn't make the module for the new driver. The driver is under dev > > /sys/dev/foo > > How does the kernel make system decide what modules to build? How can I add a new kernel modules to the build system to get it to build the new module automatically? This is quite easy. You should make a new directory under sys/modules with the module name, prepare a Makefile there (you can use one of the many existing ones in the other module directories as example). This Makefile should contain all files that your driver uses, and any specific flags that are used for compilation. Again, you will find many simple and more complicated examples among the existing modules. After this, you should add the new subdir to the Makefile in sys/modules (the order is alphabetical now, but you can add it anywhere). I believe that's all. Hope this helps. -- Regards: Szilveszter ADAM Budapest Hungary