Install/Compile Linux Kernel 3.0 In Ubuntu

2 Comments

An RC for the Linux Kernel 3.0 was recently released. The change in the version number is mostly to mark the 3rd decade of the Linux Kernel, it doesn’t bring any major changes. Still, why not try to setup the new version on your system?

Downloading kernel

# cd /tmp
# wget http://www.kernel.org/pub/linux/kernel/v3.0/testing/linux-3.0-rc6.tar.bz2
# tar -xvjf linux-3.0-rc6.tar.bz2 -C /usr/src
# cd /usr/src/linux-3.0-rc6

Configure kernel
Before you configure kernel make sure you have development tools
(gcc compilers and related tools) are installed on your system.

This step may save you time, if you want to reuse the old settings.
Whenever you install the kernel, generally you put the config file
in /boot. So, you can use the existing version of config file:

# mv /usr/src/linux-3.0-rc6/.config  /usr/src/linux-3.0-rc6/.config.save
# cp /boot/config-`uname -r`  /usr/src/linux-3.0-rc6/.config

Now you can start kernel configuration by typing any one of the command:

# make menuconfig -	Text based color menus, radiolists & dialogs.
			This option also useful on remote server if you 
			wanna compile kernel remotely. 
# make xconfig 	-	X windows (Qt) based configuration tool, works best under KDE desktop
# make gconfig 	-	X windows (Gtk) based configuration tool, works best under Gnome 
			Dekstop.
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

Give a unique name to your new Kernel –
Edit /usr/src/linux-3.0-rc6/Makefile and change EXTRAVERSION

Once you have finished, save and exit. It is now time to compile.

However to speed up the build if you have a dual core processor type,

export CONCURRENCY_LEVEL=3

The general rule is 1 + the number of processor cores.

Compile kernel

# make -j4

Start compiling to kernel modules:

# make modules
# make modules_install

***** Not recommended Goto “Follow this” *****

# make install

It will install three files into /boot directory as well as modification to your kernel grub configuration file:

System.map-3.0.0-rc6

config-3.0.0-rc6

vmlinuz-3.0.0-rc6

***** End *****

***** Follow this *****

cp ./arch/x86/boot/bzImage /boot/vmlinuz-3.0.0-rc6
cp System.map /boot/System.map-3.0.0-rc6

Create an initrd image

# cd /boot
# update-initramfs -c -k 3.0.0-rc6

Finally we need to add the initramfs image to the grub.cfg
file located at /boot/grub/grub.cfg

# update-grub

Now just reboot and your new kernel should automatically load.

Install PAE kernel

Leave a comment

Physical Address Extension or  PAE as it is generally called, is a technology which allows 32 bit operating systems to use up to 64 Gb of memory (RAM), something which is normally achieved by switching to a 64 bit system.

Read more about it HERE

If your Linux box has 4GB RAM or above, you need to install PAE kernel

On RHEL / CentOS

yum install kernel-PAE

Ubuntu

Ubuntu 10.04 – Lucid Lynx and newer iterations automatically installs the PAE kernel if it detects more than 3G of memory. If you need to install it manually.

sudo aptitude install linux-generic-pae linux-headers-generic-pae

Once installed ensure that the grub has the pae kernel as the default and then reboot your machine.

Linux USB structure

Leave a comment

Linux USB device driver sits above USB core( USB controller) and read device.

A USB endpoint has 4 types: control, interrupt, bulk, ISOCHRONOUS.

struct usb_host_endpoint contains struct usb_endpoint_descriptor, which contains: bEndpointAddress( IN, OUT),bmAttributes

(endpoint type),wMaxPacketSize, bInterval (in my subsequent I plan to use an endpoint of this to tell camera take an image!)

A USB interface has several endpoints, is a logic connection. One USB driver only has one USB interface.

A USB configuration has multiple USB interfaces.

USB mouse example:

http://hi.baidu.com/obeyrules/blog/item/a01e85816a8a279bf603a6c0.html

How to write Linux USB device driver article:

http://www.linuxjournal.com/article/4786