LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Confusion over kernel source (https://www.linuxquestions.org/questions/mandriva-30/confusion-over-kernel-source-678448/)

NirvanaII 10-22-2008 10:31 PM

Confusion over kernel source
 
I just want something clarified:

A Mandriva 2008.0 distro would have to come with a kernel, otherwise it wouldn't work, right? So where I have read of people installing a kernel source, should I assume they are writting a different version to the one they have? i.e. it's not possible to have Linux running without a kernel source installed?

If I am wrong, then what is the difference between the 'running kernel', that makes Mandriva work, and a source that somebody might install?


NirvanaII

jailbait 10-22-2008 10:41 PM

You do not need the kernel source to run Linux. The source code is compiled into binary code. The kernel binary code is what you boot and run.

You need the kernel source to compile a new kernel binary or to compile something like a device driver to add to your existing kernel binary.

If you are adding something like a device driver from source to your existing kernel then you need either the entire kernel source or the kernel headers which correspond to the kernel you are running (i.e. they are the same version). Kernel headers are just a subset of the entire kernel source.

If you are compiling a complete kernel then you need the entire kernel source for the version that you want to compile. This is not necessarily the same as the kernel version you are currently running.

-------------------
Steve Stites

NirvanaII 10-23-2008 12:11 AM

Okay, so even if the same version, you need the source or header to just write a new device in effect?

Umm... do you somehow need to 'wrap' a device inside a source or header before writing a change to the existing kernel then?

I'm trying to compile the source "ungrab-winmodem", which I have read of another LQ user's account, MAKEs successfully when the kernel source is installed. Am I right to think that in the process of MAKEing ungrab-winmodem, there is a re-working of the kernel source which accomodates the ungrab-winmodem.ko driver it creates?

Should I take 'installing' source kernel to mean the placing of a resident source ready for the rewritting of the existing binary kernel? Is my understanding correct? It seems, if you were to use the same src. as binary verion of the kernel, then installing new binaries would be pointless unless it should somehow be worked.

NirvanaII

Total-MAdMaN 10-23-2008 06:57 AM

A .ko file is a module (think: device driver). The reason you needed the source code to compile it is that it needed to know what methods were available for it to communicate with the kernel. Once the source is compiled into a module (the .ko file) it can be loaded using the modprobe command. No recompiling of the kernel is necessary.


All times are GMT -5. The time now is 10:12 PM.