LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling Your Own Kernel (https://www.linuxquestions.org/questions/linux-newbie-8/compiling-your-own-kernel-750856/)

hkothari 08-28-2009 07:34 AM

Compiling Your Own Kernel
 
I guess this is the best place to ask, so:
What are the advantages and disadvantages to compiling your own kernel?

I'm assuming one advantage is it runs faster because it's customized for your hardware but it is a noticable amount faster? What are some disadvantages?

brianL 08-28-2009 08:11 AM

I've only tried it once (on Slackware 12.2), that was to enable the HIGHMEM64G (or whatever it's called) to guarantee using the full 4 GB RAM on a 32 bit system. But since I never did anything that needed anywhere near that much RAM, I didn't really see any advantage.

lazy_troll 08-28-2009 08:29 AM

hkothari
Advantage: Your system will boot up faster rather then run faster, imho. You'll won some seconds with booting (from x to xx), but loose hours for customizing your own kernel. Also you can build a monolithic kernel - it is more secured than modular. Usually user-friendly distros (but not only them) has a modular kernels.
brianL Agree.

rn_ 08-28-2009 08:42 AM

I have also only compiled the kernel once.. a long long time ago when 2.6 had recently been released, and i was trying to turn on the hyper-threading option.

Quote:

Originally Posted by hkothari (Post 3660710)
I'm assuming one advantage is it runs faster because it's customized for your hardware

Not necessarily. it's all relative :).

Basically the main advantage is to preload (or prevent preload) modules which you may need. besides that, there are tons of options you can turn on or off depending on your need. so, if you were to preload a lot of modules or turn on some options that aren't on by default, you might actually make it slower.

how fast or how slow depends on the options and modules you select. also, if someone was to say it will shave off 10 microseconds per instruction, for instance, to a desktop user like myself that wouldn't mean much, but it would really be a huge deal for people using it in real-time envs. and simulations, etc.

i think no one can really quantify how fast or slow it would be unless they had in-depth knowledge of the hardware and the options you want to select.

you might have to run some stress tests to get exact figures.

in conclusion, for lay-people like me, the pre-built kernels are far too efficient already, and the time and effort required to compile it is just not worth it. But, you know your requirements best.

HTH.
-RN.

onebuck 08-28-2009 10:16 AM

Hi,

To compile your kernel to allow customization for hardware that may be unique to your needs or use is the primary reason for the task. As for time gains, minimal.

To trim for size is important when you need to minimize for systems that may be small footprints. Embedded systems are one example where you would want the smallest kernel possible. Systems of this type have the bare minimum hardware to support the system usage. So you would want to just have the necessary support for that same hardware.

Then you have architecture needs, if say you want to build a kernel for a different processors that is not resident on your machine. It is a lot faster to build a kernel on a modern system then it is to build one for another machine that may not have the same resources available.

mushroomboy 08-28-2009 10:37 AM

The huge idea that compiling the kernel speeds up the system drastically isn't quite so drastic these days. For the time and energy you spend learning what everything means and configuring everything you really won't reap any benifits... I don't remember where I read it but some people did tests to see if compiling a system (such as gentoo/slack I believe) is very much faster than other distro's. What they found was minimal, due to the power of most technology today it doesn't matter as much. onebuck is right with building on other systems and embeded systems, and most of us will say on a modern desktop it's relatively pointless. =( The only other reason is if you wanted to build a brand new kernel, one that might not be released in your distro's repository. But then your open to it breaking....

hkothari 08-28-2009 10:47 AM

Ok, thank you, looks like I learned something while downloading Slackware 13. Thanks all.

onebuck 08-28-2009 12:07 PM

Hi,

Quote:

Originally Posted by hkothari (Post 3660948)
Ok, thank you, looks like I learned something while downloading Slackware 13. Thanks all.

I'm glad to see your getting a real OS. :)

Take a gander at my Sig for some useful links.


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