Re: Make my own modules for kernel 2.4.32

From: Willy Tarreau
Date: Tue Jan 31 2006 - 15:06:53 EST


Hi,

On Tue, Jan 31, 2006 at 11:39:25AM +0100, Massimo De Beni wrote:
> Hi all,
> I'm a newbye to kernel 'modding' and I've a question that may seems
> outdated... The situation is this:
> I worked to get a Set Top Box to work with the latest stable 2.4
> kernel, the way is clear but the box need some modules to be loaded at
> boot in order to get the video and audio device to work (modules that
> are not shipped in kernels 2.4...); now I'm building those modules
> separatly, compiling directly the drivers source codes with 'make',
> and then I insert the .o with 'insmod'.
> I would create a better system in which one could compile those
> modules directly on the 'make menuconfig' of the kernel, so I'm
> modifying the various Makefiles && config files, but I'm a bit
> confused... Any good hint?

You have to add an 'obj-m' entry to the Makefile located in the same
directory as your driver, and make it depend on an option which will
be enabled in some Config.in (in the same directory if possible).
You should look at any driver provided as a patch for the kernel, it
will be fairly easier for you to understand what they touch. And don't
forget one important thing : always ensure that the kernel still builds
with your module disabled. Also, don't forget to add an entry in the
Configure.help file.

> Thanks in advance...!

Regards,
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/