LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-11-2007, 03:43 PM   #1
gurkama
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Rep: Reputation: 0
Kernel module migration from 2.4 to 2.6


Hi

Migrating my module from Linux 2.4 to 2.6, I encountered a problem where my .ko size was ~40% larger than the .o in 2.4.
I read that 2.6 creates a .mod.c file and links it with the .o file to create a .ko, which increases the kernel module size.
However from reviewing my .mod file I don't think it should increase the size so much - only about 2-3%.

Does anyone know if such porting to Linux 2.6 should increase the size so much?
Are there any special compilation flags for optimization or size reduction that are new in 2.6, and might help me reduce the .ko size?

Thanks in advance
 
Old 02-11-2007, 10:11 PM   #2
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
Yea 2.6 is bigger. Pretty easy to tell. Just simply compile a kernel with no options. And surprise, surpise.. kernel 2.6 is much bigger.
Almost twice the size in fact.

I believe I can sum up your situation in four simple words.
Bigger kernel, Bigger modules
 
Old 02-11-2007, 11:49 PM   #3
gurkama
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
what options then?

So what options can I use to reduce the size of the module?
 
Old 02-12-2007, 12:09 AM   #4
gurkama
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
I understand that the 2.6 kernel is much bigger, but why is a module so much bigger? what is different in the module from 2.4? (almost the same code)
Also, 40% bigger seems very unreasonable to me....
Is there an explanation for this?

Thanks in advanced
 
Old 02-12-2007, 04:15 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
yes, isn't more and more functionality being included in the kernel nowadays instead of being farmed out?
It seems (though i am no expert) that the kernel is tending to veer towards becoming monolithic.
 
Old 02-12-2007, 12:33 PM   #6
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
Lightbulb

Quote:
Originally Posted by bigearsbilly
It seems (though i am no expert) that the kernel is tending to veer towards becoming monolithic.
Well it was never a microkernel.

Why are modules bigger? Could have something to do with whats in /usr/src/linux of a 2.6 kernel vs a 2.4 kernel. Typically kernel source code is used in kernel objects right? Perhaps you could look into it yourself.
 
  


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
Can a kernel module call the function of another kernel module sceadu Programming 3 05-02-2011 02:22 AM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
nvidia driver 8762 kernel module mismatch x module openfun Ubuntu 5 06-27-2006 10:02 PM
slackware 10 compiled kernel migration questions mr_earswab Slackware 1 07-17-2004 02:51 PM
kernel module ignorant newbie looking for any one with kernel module knowledge cpoet Slackware 4 11-24-2003 09:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:10 PM.

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