LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 08-20-2003, 12:06 AM   #1
Ishkabibble
Member
 
Registered: Aug 2003
Location: Worcester MA
Distribution: Ubuntu 8.04
Posts: 120

Rep: Reputation: 15
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!
 
Old 08-20-2003, 12:07 AM   #2
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
http://tldp.org/HOWTO/Kernel-HOWTO/quick_steps.html
 
Old 08-20-2003, 12:44 AM   #3
lethargo
LQ Newbie
 
Registered: Aug 2003
Location: St. Paul, Minnesota, US
Distribution: Slackware 10
Posts: 27

Rep: Reputation: 15
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.)
 
Old 08-20-2003, 01:27 AM   #4
lethargo
LQ Newbie
 
Registered: Aug 2003
Location: St. Paul, Minnesota, US
Distribution: Slackware 10
Posts: 27

Rep: Reputation: 15
(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.
 
Old 08-20-2003, 01:35 AM   #5
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

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

Thats a great post lethargo, very clear.
 
Old 08-20-2003, 01:42 AM   #6
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
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
 
Old 08-20-2003, 02:07 AM   #7
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
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.
 
Old 08-20-2003, 02:38 AM   #8
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Kernel 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 01:58 PM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 04:59 AM
kernel panic: try passing init= option to kernel...installation with Red Hat 9 kergen Linux - Hardware 1 09-30-2004 04:28 AM
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 05:54 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:24 AM.

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