Kernel recompile or LKMs?

Booting, installing, newbie
Post Reply
Message
Author
User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

Kernel recompile or LKMs?

#1 Post by Dave_G »

Hi all

Been messing about with writing kernel modules (drivers) for some
custom hardware and was wondering if anyone can give me the pros and cons
of using Loadable Kernel Modules (via insmod and rmmod) versus adding
the extra code to the kernel itself and recompiling the kernel which is something
that I would rather not do.

Any input will be greatly appreciated.
Thanks
Dave.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Kernel recompile or LKMs?

#2 Post by Monsie »

Hi Dave,

Wow... you're asking this kind of question in the Beginners Help section? :shock: It would appear that the Puppy Community is ascending to a higher plain of existence... 8)

Okay.... kidding aside, I don't believe it is absolutely necessary to re-compile the kernel to install additional drivers unless you are "breaking new ground" here. You'll probably need the kernel source and header packages though.

I found this post which might help get you headed in the right direction if you haven't already seen it: http://www.linuxquestions.org/questions ... ls-334385/

Now that I've started with a reply, hopefully our "kernel experts" will see this thread and provide some extra needed input.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#3 Post by Dave_G »

Hi Monsie and thanks for the reply.

Now that you mention it, I have posted in the wrong section, my apologies.
Perhaps one of the admins would be kind enough to move it to a more appropriate place.

Thanks for the link.
I have also been doing some research and so far I can't really find any compelling
reason/reasons to recompile the kernel and simply using a LKM is certainly
easier to achieve and also a lot easier to share the module with others and
not have them recompile the whole kernel which I suspect will make many
run for the hills, myself included. :-)

Of course I could be totally wrong and will await input from the experts.

Dave.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#4 Post by Karl Godt »

Dave_G wrote:
Of course I could be totally wrong and will await input from the experts.

Dave.
Experts hanging around somewhere making money, not here .

Writing drivers for Open Source is a good prove of your talents to employers .

It is easier as module to unload and reload at first but after the first experiences you might be firm with the driver options to put into the grub kernel line ie "my_driver=debug:1,force:off" compared to "modprobe -v --first-time my_driver debug=1 force=off" .

Some drivers make difficulties being in use and can not be unloaded that easy, but this would probably need adjustments to the src code OR the kernel can be configured with these module options :
Attachments
kernel_make_menu_config_enable_loadable_module_support.jpg
(72.99 KiB) Downloaded 231 times

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#5 Post by Dave_G »

Hi Karl, thanks for your input.

You are correct in saying that some modules make life difficult when
trying to unload them but luckily in this case I'm writing them so will
make sure they are well behaved ;-)

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Kernel recompile or LKMs?

#6 Post by Monsie »

Dave,

Just in case you do have second thoughts about possibly recompiling the Kernel, I found an interesting thread for you over here at Linux Forums. See the post by Linux Engineer "variant" who explains how easy it can be to re-compile the kernel if you need to. :)

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

User avatar
Dave_G
Posts: 453
Joined: Thu 21 Jul 2011, 13:53

#7 Post by Dave_G »

Nice find Monsie it's made me a bit more receptive to the possibility of a kernel compilation.
Up to now my response would have been exactly the same as the OP
of the thread you posted a link to, namely, Ooooo Nnooooo !!!!!! :shock:

Post Reply