Results 1 to 7 of 7
Hi,
I am trying to compile a module for 2.6.12 kernel and I have reached at a dead-end:
Let's say my module is my_module.c.
I have included it in /usr/src/linux/drivers/my_module/my_module.c
...
- 10-09-2006 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 2
Kernel Module Programming
Hi,
I am trying to compile a module for 2.6.12 kernel and I have reached at a dead-end:
Let's say my module is my_module.c.
I have included it in /usr/src/linux/drivers/my_module/my_module.c
and successfully edited Kconfig and Makefile.
When I type make menuconfig, my module, appears correctly on "Graphics Drivers" Menu, and I select it as in-built (*).
Afterwards, I type make, and the compilation process starts.
My module, compiles smoothly, without any error and the image is ready.
The problem is that when I boot the new kernel, my module IS NOT loaded, as it should be, and I can load it only with modprobe or insmod.
dmessg does not have any error message or initialization message for my module.
What does go wrong?
Thanks in advance !Last edited by mvictoras; 10-09-2006 at 02:58 PM. Reason: Wrong title
- 10-09-2006 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Google on "load modules at boot time"
- 10-09-2006 #3Just Joined!
- Join Date
- Oct 2006
- Posts
- 2
As I said, I recompiled the kernel, and selected the module as build-in.
If I am not mistaken, this means that I do not have to load it at boot time with /etc/modules(.conf) (This is the main reason I selected it as build-in and not as a module)
- 10-10-2006 #4Just Joined!
- Join Date
- Oct 2006
- Posts
- 2
If you could let me know your .config file then we could have a look on it and let you know what exactly has happened and how to solve it.
- 10-10-2006 #5Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
It's not necessary to link modules statically anymore these days, use Loadable Kernel Modules.
If you can do it in user space, you should do it in user space. Since modules run in kernel module they can corrupt kernel structures if they are not careful.
- 10-10-2006 #6That's not the point IMHO. Most of the drivers and file systems can be statically included into the kernel. In fact, the main file system (ext3fs for example) should be statically linked for a better performance. Other drivers and file systems (iso9660) are also included bu default in most of the distributions.
Originally Posted by Franklin52
Completely agree. But it is a driver and it needs to access some kernel data structures and probably map certain memory regions from the inside... I think the only way is to write a module (however if it were a file system I would recommend to use FUSE)
Originally Posted by Franklin52
Best Regards
- 10-11-2006 #7Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Sure, it's common to include file systems, drivers or some programs into the kernel for a better performance.
Originally Posted by fernape
What i'm trying to make clear is that it's not necesarry to load most of other stuff statically.
Regards


Reply With Quote
