LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-01-2007, 01:59 AM   #1
htandel
LQ Newbie
 
Registered: May 2007
Posts: 9

Rep: Reputation: 0
Question [B]How we can link kernal module statically in kernel?? [/B]


Well,
when we artite a kernel module , we can load it into kernel with the use of "insmod" command and after using mknod we can create a node and from application we can use it.
But this is called dynamic linking of kernal module. Once you shutdown the PC this module will not be available in the kernal, you need to load it again in the kernel with insmod command.

I WANT TO KNOW....

How can we load the module statically, I mean after shuting down the PC also that modue should remain in the kernel and we(user/application) must be able to access it wihtout loading it again.

kernel module can be anything, a char or block driver or any other kernal functionality.

But how can we link that into our kernal statically?????

Do we need to change some makefile?? if yes then which?
Do we need to compile the kernel?? then what's the procedure we need to follow before compiling??

Is there anybody???who can help me???
 
Old 06-01-2007, 05:04 AM   #2
cdcshu
Member
 
Registered: Jul 2006
Location: Shanghai
Distribution: Fedora, OpenSUSE
Posts: 30

Rep: Reputation: 16
Smile Insmod it in the very begining?

Well, I think the easy way to make it is to add a line in your startup script /etc/rc.d/init.d/rcS like

insmod /lib/modules/.../xxx.ko

This way, system will load it for you after startup.

Another way is to re-compile kernel and build the module to kernel statically. So once your PC start running with the new kernel, the module has been there always.

Hope this helps,

cdcshu
 
Old 06-01-2007, 06:25 AM   #3
htandel
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks

I got some idea of what I should do... and I thank you for that.

But can anyone give me some more details, in detail. thank for the help.
 
  


Reply

Tags
driver, kernel, module


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to `__this_module' when trying to link module to kernel Rostfrei Linux - General 1 04-02-2014 02:43 AM
kernel module for D-Link DFE-530TX NIC Gaz_za Linux - Newbie 2 06-01-2007 06:22 AM
[gcc] how to statically link my program? G00fy Programming 5 04-16-2006 04:35 PM
g++ statically link stdc++ problem berty Programming 1 05-16-2005 06:00 PM
statically link a network card driver into kernel stonux Linux - Hardware 0 04-07-2005 02:57 PM


All times are GMT -5. The time now is 02:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration