Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm operating well under Linux for a former "Microsoft Service Professional." I'm still trying to wrap my noodle around a few things, one of which, I'm sure, is preventing me from fully experiencing Linux. "Recompiling the kernel" What exactly does that mean? In my Windows mind it sounds like editing the registry. Is it that drastic? What is it and how do you do it? Have I done it already and just not known it?
You probably wouldn't have done it without noticing it. The kernel is the core of the operating system. I guess you could say it is sort of the traffic cop that distributes resources (memory, processor time, etc.) to the various programs running on the machine. It is also where hardware drivers go (or at least where they plug into.) In Windows, I think the "kernel" is basically contained in some of the core system DLL's.
When Microsoft wants to distribute Windows (or even test it internally), they compile the source code, and distribute the resulting files (mostly DLLs and EXEs). (Source code is the specific instructions telling the computer what to do that programmers write. Compiling it turns it into the numerical instruction codes that the CPU, e.g. a Pentium, understands.)
(sorry, I accidentally posted that before finishing...here is the rest of it...also, a caveat, I'm a Windows programmer who's been playing around on with Linux for awhile. I'm not an expert, but I have a fair amount of experience looking at Linux from a Windows user's point of view and going "huh, that's interesting." Anyway...)
Since Linux is "open source", you can get that source code, change it if you want, and compile it yourself. So actually it is MUCH more "drastic", in a sense, than editing the registry. It is if you could download new versions or even make your own changes to Windows system DLL's and hardware drivers.
However, there are some mitigating factors. On linux, compiling software is a well-espablished part of the culture. Compiling software on Windows is generally something only programmers do (only they have the source code to do it anyway.) On linux, however, where anyone CAN be a programmer, everyone can compile. As a result, the standard method of distributing programs in linux was to distribute the source code instructions for the program, and let you compile it yourself. (Although distributing programs as pre-compiled "binaries" is becoming more common on Linux, the source code distribution of a program is still common, and often the source code version is the more official version.)
Basically that is a long-winded way of saying that compiling source code yourself is quite common on Linux, so they've made it RELATIVELY easy. See the How-To in the previous post, but I think the steps for compiling the kernel are roughly:
- uncompress the source
- change to that directory
- type (to clean any old stuff off): make mrproper
- type (to select options and drivers): make menuconfig
- type (to do the compile): make bzImage
- type (to compile "modules"): make modules
- type?: make modules_install
- copy the new kernel alongside your existing one, and modify your bootloader to optionally boot your new one (leaves you an out.)
I haven't done it many times, so I'm no expert, but my point is that except for chosing the options and drivers, it's a short "recipe" you can do by rote. As a Windows user I was surprised at how easy it was for something that seemed so "drastic". With the right step-by-step documentation, it wasn't that hard.
Why bother recompiling your kernel? You've probably heard some reasons since you're asking, but here are some I've heard or gathered, in case they add any.
- You can change the source code yourself (if you want to, you don't have to.)
- You can choose the latest features (and hardware drivers), if you choose.
- You can leave out stuff you don't need.
- Since you are compiling it for your own machine, you can specify options to optimize it for the exact CPU your machine is using. For example, if you have an Athlon or a Pentium 4, you can compile it to take full advantage of those new processors. Precompiled software (including Windows) can optimize some stuff, but they can't do as much because the resulting program has to at least run on the oldest CPU they support (e.g. 386 or early Pentium.) Compiling for your own machine, you have no such restriction.
- One security book I read recommended recompiling your kernel because then you'd know exactly what you were getting, and you could choose some options that are good for security.
- You can apply new patches (including security patches probably) when they come out. (Linux kernel patches are files containing just the differences between the original source code and the patched version. You apply the correct patch to update the source code on your machine, and then recompile.
I would encourage you to try recompiling your kernel. If you want to get a sense of the options available, you could also just do it through the "make menuconfig" step (or the alternate user interfaces for the same thing, "make config" or "make xconfig"). The number of options and drivers are kind of mind-blowing, but at least they are giving you flexibility.