Wednesday, May 16, 2012

When your device driver doesnt work !!! :-o

Sometimes after a successful boot after compilation of a new linux kernel, you may find that some of the drivers are not working.

For example your touchpad may not be working, or there may be a problem with the network dirver. To enable these, one will have to compile specific modules related to the device that is not working.

Do this
lspci
This would give you a list of all the device drivers that are required for specific devices. Now hunt for the device drivers online, and if your linux kernel version is not that old, you will stumble upon the correct device driver.

In my case, I couldnt get the Internet working, so I did an lspci which gave me the following results ::

$ lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 06)
00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)
01:00.0 VGA compatible controller: ATI Technologies Inc M96 [Mobility Radeon HD 4650]
01:00.1 Audio device: ATI Technologies Inc RV710/730
12:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
13:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05)

I searched for Realtek Controller device driver and found it. untarring and compiling the device driver will hopefully get the internet running with linux 2.6.

It worked!!!

I downloaded the package... followed some steps given in readme and it worked! One obesrvation ::

after you have installed the network driver, REMEMBER to do

ifconfig ethX up.

This will start the wired lan/ethernet connection.. This bugged me for quite a few hours so I thought Ill make a note of this here.

Thats all I have to say right now... kernel chronicles will continue. :)

Tuesday, May 15, 2012

Compiling old Linux Kernel with configuration of current linux kernel

A couple of years back, I had this premonition of "linux kernel" being some kind of a taboo... Some completely cryptic term known only to a few erudite people.

Today as I write this post, I feel elated to share that I too belong to the erudite group!

So this is not something as tough to do as it sounds, but its pretty cool to try this out yourself.

The steps to do this are as follows:
1> Download the source code from the http://www.kernel.org/
2> untar the code
3> copy the untared folder to /usr/src

Now heres the twist. Unlike a newer version of the linux kernel, if we are planning to compile the older version, then there are parts of the new version can be used in order to compile with the older version (i.e. the working part of the older version can be used so that the new version doesnt give you hiccups with say the network driver or the touchpad...

4> copy the config-2.6.36.4 file from /boot to /usr/src/linux.x.x.xxx/.config file.

5> do make (in usr/src/linux-x.x.xxx folder)
6> do make modules_install
7> update-grub (optional).
8> reboot

tadaaa...
hopefully this should do the work...
now on reboot check for your linux version in the grub menu... check also for older versions of linux installed.
press enter after choosing the option.

Post here any of the doubts/ errors that you encountered. well try and figure out how they can be solved.

Let the compilation Begin!