LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 05-05-2012, 01:54 AM   #1
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Rep: Reputation: 17
How to convert a static driver to a loadable module in linux kernel?


Hi all,
I want to know what changes need to be done to convert a static driver to make it as a laodable module ? thanks.
Warm Regards,
ravi.
 
Old 05-05-2012, 07:49 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Recompile the kernel and choose 'M' for the specific driver when configuring.
 
Old 05-07-2012, 08:18 AM   #3
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Original Poster
Rep: Reputation: 17
is that all that is required ? I was thinking we have to do come code changes are specific to loadable modules as compared to static drivers?


Regards,
Ravi Kulkarni.
 
Old 05-08-2012, 02:39 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Obviously, from a software-design perspective, there are. Your driver must "understand" that it is designed to be dynamically loadable, and it must do all the right things to be certain that Linux I/O activity occurs properly ... when the driver isn't loaded, when it's being loaded/unloaded, when it is loaded. If your driver does not have that "additional intelligence," it can't survive as a loadable module.
 
Old 05-09-2012, 12:52 AM   #5
sunr2007
Member
 
Registered: Jan 2009
Location: Bangalore , India
Distribution: Fedora 12
Posts: 65

Original Poster
Rep: Reputation: 17
Can u Please elaborate more on the "Additional Intelligence" required by the static driver to be a loadable module?






Regards,
Ravi Kulkarni.
 
Old 05-09-2012, 01:59 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Far more informative than anything I could whip up here ... would be an actual search of the source-code of your own system. Device drivers can be loaded at several different points in the lifetime of a Linux system, and, in particularly in the case of a USB-connected device, they can be dynamically unloaded again. I am not "dodging" your question when I say quite frankly that the very best way that you can answer any of these questions, and many more, is to: "Use the Source, Luke!"

You can, and should, also skim the various HOWTOs that you will find concerning this subject. The operative word here, in my mind, is "skim." If you don't quickly perfect the skill of "skimming," you will first-hand experience what has been aptly called a "Sip from the Firehose."

No source of information about software on this planet beats the careful inspection of existing software that actually works, hence my very-pointed reference to that particular source. Look at it, and pay attention to whatever existing module out there might be closest to whatever-it-is that you now want to do. There is zero reason to start from scratch. Actum Ne Agas: Do Not Do A Thing Already Done. One thing that you will find in a great many existing drivers is the cordial acknowledgment of "prior work" from which the driver was "cabbaged." If you are starting your work from a blank editor screen, then you are most likely starting your work in the wrong place.

Last edited by sundialsvcs; 05-09-2012 at 02:01 PM.
 
  


Reply



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
Write protecting the text section of a loadable driver module sri922 Linux - Kernel 2 11-17-2009 10:55 PM
Problems with cross compilation of a loadable driver module for powerPC renergy Linux - Newbie 1 10-16-2007 01:29 PM
how to insert a loadable module into the kernel.? moog Linux - Newbie 2 01-08-2007 08:37 AM
Help, loadable kernel module . ERBRMN Linux - General 3 10-13-2006 07:34 AM
loadable kernel module brajesh Linux - General 2 01-17-2003 12:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration