Re: Adding a new kernel module?

From: Szilveszter Adam <sziszi_at_bsd.hu>
Date: Thu, 8 Jan 2009 19:08:38 +0100
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
Received on Thu Jan 08 2009 - 17:48:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:40 UTC