Big picture of the Linux kernel?

Hello

I need to get the big picture of what a kernel is, what it includes, when it's necessary to compile a new kernel, etc., and have the following questions:

What source files do I need to compile a new kernel?

What's the difference between downloading source files from www.kernel.org and "apt-get install" kernel + kernel-headers? Does the latter simply make it easier to download the source files, or are the kernel source files from Ubuntu different from www.kernel.org?

When do I need to compile a new kernel?

Why does the kernel contain multiple files? vmlinuz, initrd.gz, filesystem.squashfs, etc.

When using dynamic drivers (modules) instead of static drivers, do I need to compile a new kernel? If not, how does the kernel know about the new drivers?

Thank you for any help.

Killing X

If your Linux distribution won't let you go down to runlevel 3:

  1. ps aux | grep X
  2. kill <pid>

Getting xorg.conf

XFree86 Modeline Generator

/var/log/Xorg.0.log

# apt-get update

# apt-get install nvidia-glx-185

# apt-get install nvidia-settings

# gtf 1024 768 75

# nvidia-xconfig //creates /etc/X11/xorg.conf

Copy Modeline into "Monitor" section of /etc/X11/xorg.conf

Need to modify "Screen"?

Reconfiguring X

# dpkg-reconfigure xserver-xorg

Compiling nv

# dpkg -l | grep -i xorg

xserver-xorg-video-nv                1:2.1.14-2ubuntu3                          X.Org X server -- NV display driver

Compiling Nouveau

apt-get install python-software-properties

#BAD add-apt-repository ppa:xorg-edgers/nouveau

add-apt-repository ppa:bjfs/ppa

aptitude update

aptitude install xserver-xorg-video-nouveau

Note that Karmic (9.10) does not have an /etc/X11/xorg.conf file by default. It is created as follows:

exit X

Xorg -configure //creates ~/xorg.conf.new

cp $HOME/xorg.conf.new /etc/X11/xorg.conf

Section "Device"

    ...

    driver "nouveau"

EndSection

Reboot. If it is still not using the driver, use:

sudo dpkg-reconfigure -phigh xserver-xorg

 

 

 

Just install xserver-xorg-video-nouveau

From Jaunty onwards there are nouveau packages in the Universe archive. Just install xserver-xorg-video-nouveau. These are built for all architectures supported by Ubuntu, but are not neccesarily up to date. For example, the nouveau package for Ubuntu 9.04 is dated from the month of the 9.04 release, April 2009. More up to date packages are available for x86 and amd64 in the xorg-edgers PPA or upgrade your distribution (ALT-F2 and then "update-manager -d") to Lucid (alpha) which has a recent nouveau driver release set as the default.

Compiling nVidia

apt-get update

apt-get install build-essential linux-headers-`uname -r`

dpkg -l | grep -i nvidia

dpkg -l | grep -i xorg

apt-get --purge remove $(dpkg -l | grep nvidia | awk '{print $2}')

apt-get --purge remove $(dpkg -l | grep xorg | grep nv | awk '{print $2}')

wget -c http://us.download.nvidia.com/XFree86/Linux-x86/256.44/NVIDIA-Linux-x86-256.44.run