Why compile the kernel?

Soccerman

Elite Member
Oct 9, 1999
6,378
0
0
as you can tell, I'm still a newb to linux, so forgive me for my dumb questions!

now, I'm wondering, why exactly do people compile your kernel?

is there an equivalent to compiling the kernel when it comes to windows (changing the registry??).
 

lucidguy

Banned
Apr 24, 2001
396
0
0
Compiling something means taking source code and building machine-readable object code out of source code.

Since the only people with access to Windows source code is Microsoft employees and a couple of Russian hackers, compiling kernel code is not a very widespread activity when it comes to Windows.
 

Chaotic42

Lifer
Jun 15, 2001
34,330
1,497
126
When people say compiling the kernel, they mean customizing and compiling. It allows you
to select the hardware and low-level software options you need. An example is my 3Com 3c905b
network card. To get it to work, I have to select it in the kernel config. It then compiles
it in with the other options, so that my kernel is tailored for my system.
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
Why I recompile Linux kernels, is mostly because I upgrade to every new version they put out as soon as it comes out (the same day or next :), instead of waiting for RedHat to spoon feed me a RPM of the kernel.

There is no equivalent in Windows of recompiling the kernel...that is, that no non-Microsoft person can do it. But Windows NT/2000 does have such a customized kernel thing...it's called Professional / Server / Advanced Server / Datacenter.
 

Soccerman

Elite Member
Oct 9, 1999
6,378
0
0
It allows you to select the hardware and low-level software options you need.

so, does that mean that when it (linux) is using my hardware properly, that means that the Kernel was compiled?

I don't think so...

I thought drivers for hardware, was all modules? can someone help me out here?
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
1...All Linux kernels must be compiled for them to run on your system. The ones that come with RedHat, Mandrake, SUSE, Slackware, etc. are compiled by the people at that company, with options so that they work on the majority of hardware out there.
2...Some hardware drivers must be compiled in, while others can be used as modules: for example, I compile the floppy controller driver as a module, since I rarely use the floppy drive, and don't need the driver in memory constantly. However, if you're booting off a SCSI harddisk, you need your SCSI adapter driver compiled in, since the kernel needs that to load the other modules, and if the driver itself was a module...well, I think you get the point here.
HTH.
 

MGMorden

Diamond Member
Jul 4, 2000
3,348
0
76
The reason it offers a speed boost is that you can take out all of the stuff you don't need (kernels included w/ Mandrake and REdhat and such have way too much stuff compiled in). You can also tailor it to your machine's archetecture (most default Linux distros, like most windows software, comes optimized for a 386 just so that everyone can run it without compatibility issues. if you compile your own though, you can compile everything with, for example, Athlon optimizations so that you'll get 10-15% faster programs as compared to "out of the box" solutions).
 

Soccerman

Elite Member
Oct 9, 1999
6,378
0
0
alright then.. that's pretty much what I thought..

so how does one go about compiling the kernel? do you have to open a file and edit it?

also, I read on the forums at Linux Newbie.org that there are better filesystems then the default one.. one of them has support in the 2.4x kernel..

if I wanted to impliment these new filesystems, I'd have to reformat the partitions that are being used, right?
 

fivepesos

Senior member
Jan 23, 2001
431
0
0
generally you would have to reformat your current partitions to take advantage of newer filesystems. do some research into reiserfs, its probably the filesystem they were speaking of. even though 2.2 had limited support for reiserfs, 2.4 handles reiserfs flawlessly (for me so far).

to restate what everyone else has said about kernel compilation, its used for speed improvement. who needs a kernel for dozens of IDE and SCSI controllers along with hundreds of NICs when all u have is 2 ide controlers, no scsi, and one nic? no reaso. and the only reason they are there is cause redhat (or whichever distro) wants their kernel to work on most systems. in fact, its possible to make your kernel less efficient by taking the opposite route: adding options to your kernel. if you took redhats stock kernel and added support for EVERYTHING than i suppose it would run slower.

read the kernel-howto and roll your own kernel to use
 

Chaotic42

Lifer
Jun 15, 2001
34,330
1,497
126
<<<< It allows you to select the hardware and low-level software options you need. >>>>

<< so, does that mean that when it (linux) is using my hardware properly, that means that the Kernel was compiled? >>


Huh? Every linux kernel is compiled, AFAIK. What I'm talking about is custom-fitting the
kernel to your system.



<< I thought drivers for hardware, was all modules? can someone help me out here? >>



They *can* be modules. They don't have to be. It's up to you. There are a few things you
*can't* make modules, but for the most part, they can be done either way. Making something
a module means that you can remove it when you want. Let's say I want to use a system
that might sometimes have an NE2000 NIC, and sometimes a 3Com 3c509. I'd make them both
modules, and the system would insert the correct one (hence the name modules). If they
were compiled in, they'd just be taking up space (but it would still work in this example,
the kernel would just be bigger).