Simple question - complicated answers

Mario Vukelic mario.vukelic at dantian.org
Fri Sep 28 05:41:29 UTC 2007


On Thu, 2007-09-27 at 21:24 -0400, alex wrote:

> I believe I've had a misconception of the kernel...  Somehow  I had the 
> idea that the kernel existed in a single editable file.  What led me to 
> this was reading that the kernel was compilable so it must be a file of 
> some kind that was editable, something that looked like what's in 
> /boot/config.*.    This is why I kept asking for a specific location for 
> a file..

Well yes, the compiled kernel does exist as a file, but it is not
editable (this would of course change and thus damage it), and it is not
interesting to look at in its compiled form. On my computer, this is the
kernel file: /boot/vmlinuz-2.6.22-12-generic (and the accompanying
modules are located in /lib/modules/2.6.22-12-generic/). 

When you open the file with a text reader like "less", what you will see
is something like this. It is , after all, a binary file. Not too
exciting, is it :-)

^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^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B><DB>Wrong loader, giving up...^@<E8>6^@f<85><C0>ta
<8C>Ȏ؍6^@^N<E8>^_<FF><EB><FE>PANIC: CPU too old for this
kernel.^@f<9C>fj^@f<9D>f<9C>fXf^M^@^@^D^@fPf<9D>f<9C>fXf<A9>^@^@^D^@t^Ff<9D>f1<C0><C3>f<9D>f<B8>^A^@^@^@<C3>f1<C0>f<A3><E0>^A<A2><E8>^Af1ۿ<D0>^Bf<B8> <E8>^@^@f<BA>PAMSf<B9>^T^@^@^@^^^G<CD>^Ur f=PAMSu^X<A0><E8>^A<<80>s^Q<FE>^F<E8>^A<89><F8><83><C0>^T<89><C7>f<83><FB>^@u<C8><F9>1<C9>1Ҹ^A<E8><CD>^Ur*<83><F9>^@u        <83><FA>^@u^D<89><C1><89><DA>f<81><E2><FF><FF>^@^@f<C1><E2>^Ff<89>^V<E0>^Af<81><E1><FF><FF>^@^@f
^A^N<E0>^A<B4><88><CD>^U<A3>^B^@<B8>^E^C1<DB><CD>^V<E8><9D>^C1<C0><8E><D8><C5>6^D^A<8C>ȃ<E8> P<8E><C0><BF

Of course, the actual running kernel that is doing the work has already
been copied into RAM as the first step of the computer's boot process.


> As for what I wanted to do --------I believe I clearly said that all I 
> wanted to do is see what the kernel looked like.  I had no
> intention of doing anything but study it.to get some idea of what it 
> did.   I still would like to examine the kernel.if this is possible.

To actually study it, you would want to read the kernel source code, and
not the compiled file(s). Be warned, it consists of thousands of files
and millions of lines. However, there are some parts that are
recommended reading, such as the directory "Documentation".

I already showed you how to do that back in August, and others have in
this thread: open the Synaptic package manager in menu System ->
Administration. Then search for "linux-source", which will find a bunch
of kernel source code packages. 

Installing one of these will give you a file called, e.g., 
linux-source-2.6.22.tar.bz2 in the directory /usr/src. You can unpack
this with this command in a terminal (your actual version number may
differ):

sudo tar jxvf linux-source-2.6.22.tar.bz

This will give you a directory /usr/src/linux-source-2.6.22, with the
following content. As I said, read the contents of Documentation, and
README is nice, too

ls /usr/src/linux-source-2.6.22
arch   COPYING  crypto  Documentation  fs  init  Kbuild  kernel-versions
MAINTAINERS  mm   net  README  scripts   sound block  CREDITS  debian
drivers   include  ipc   kernel  lib              Makefile modules
package-list  REPORTING-BUGS  security  usr

> What aroused my curiosity about the kernel was reading about it in the 
> kernel websites..

Back in August, and also in the current thread, people provided many
helpful links to learn more about kernels in general, and linux in
particular, like these Wikipedia links:
http://en.wikipedia.org/wiki/Kernel_%28computer_science%29
http://en.wikipedia.org/wiki/Linux_kernel

Several diagrams were suggested (I won't repeat the links, they are in
the  thread) that may give you a better idea of the kernel's structure
and complexity.

These links are a better place to start to learn about the kernel than
staring at the (highly complex) kernel source code.


> Perhaps I'm a bit too old to to work Linux......I'm 89.

Wow. Props to you for hanging out here at all :) It may indeed be just a
bit late to start kernel programming (which is a very complicated and
specialized variant of programming in general), but certainly not too
late to learn what it is and does.

Regards,
Mario





More information about the ubuntu-users mailing list