LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Kernel? (https://www.linuxquestions.org/questions/linux-newbie-8/kernel-83711/)

Ishkabibble 08-19-2003 11:06 PM

Kernel?
 
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?

Thanks all! :)

h/w 08-19-2003 11:07 PM

http://tldp.org/HOWTO/Kernel-HOWTO/quick_steps.html

lethargo 08-19-2003 11:44 PM

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.)

lethargo 08-20-2003 12:27 AM

(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.

I hope this wasn't too long, and good luck.

contrasutra 08-20-2003 12:35 AM

The kernel is one big binary in windows. Its something like kernel.exe in your /WINDOWS folder.

Thats a great post lethargo, very clear. :)

exodist 08-20-2003 12:42 AM

using slackware you should go to www.slackware.com and view the guide (called essentials?) I started on slack back with 7.1 and compiled kernel my first day because of that book.

also install slack 8.1 then install 9.0 over it for best results, slack 9.0 was stripped of a lot of stuff

contrasutra 08-20-2003 01:07 AM

You've been posting that a lot. I have had no problems with Slackware 9.0. I think it's just you.

I cant find anything Slackware 9.0 was "stripped of". Anything thats missing I can compile myself. Any libraries from Slack 8.1 would be old anyway.

exodist 08-20-2003 01:38 AM

evolution
enlightenment
to name a few
as well libraries they need to compile are not there. and then the packages of those from 8.1 install fine cause no dep checking, but then they still won't run.


All times are GMT -5. The time now is 08:38 PM.