Linux (RedHat 9) on the IBM ThinkPad R40

April 28, 2003; Updated: January 16, 2004

April 28, 2003
This document summarizes my experience (so far) of installing RedHat Linux 9 on an IBM Thinkpad R40 Laptop.

Summary

Subsystem
Information
Disk. IDE/(UDMA)
Needs Kernel patch for DMA. Update:  updated kernel 2.4.20-27-7 solves the problem. Download it from www.redhat.com/updates
Audio
OK
Suspend/Resume
Does not work properly. Resuming from suspend is sometimes unstable.
Xserver
OK. The LCD can be configured at 1400x1050. There is a problem when turning LCD off
Update: New Radeon Modules allow to switch LCD Off.
Firewire
OK. Modules load well. Tester with a Sony MiniDV Video Camera. It works.
Ethernet
OK
Modem
Winmodem. Not working with RH9 software. Update: Working with slmodem drivers. It works with a recent version of slmodem . Download the one I used (slmodem-2.9.2.tar.gz)
USB
OK. Mouse and Flash disk tested.  USB2.0 devices not tested
PCMCIA
OK. PCMCIA modem tested and working with default RH9 kernel. After patching the kernel, PCMCIA modules are not loaded properly, due to a bug in /etc/init.d/pcmcia script.

Machine description

The IBM ThinkPad R40 has these main components
The machine came with Professional Windows XP preinstalled, with all devices preconfigured, and a copy of the Windows XP CD on the hard disk.

The disk contains a hidden partition containing an image of the hard disk as shipped from factory. This is the reason why you can only see 35 Gb of disk capacity from windows.


Linux Preinstalation

Before installing Linux you must obtain room on the disk. At this point you have two options:


RedHat 9 Installation

Once that you have made room in the disk you simply have to boot from the first RH9 CD.

I have made the following partitions:
The graphical installation works well. I have done it using a USB external mouse, which was recognized. Once the install gets going, the first thing you notice is how slow it is. The explanation comes in a minute.

Remember to install kernel-sources. You will need this package in a minute!!

I chose grub as the boot loader.

When the installation finishes X are working fine and you will discover a very quiet machine. The CPU fan is very quiet and is on only from time to time.


Hard Disk - IDE

Update:  updated kernel 2.4.20-27-7 solves the problem which is described below. Download it from www.redhat.com/updates

 The first thing that can be noticed when you intall RH9 from the CDs is how slow the hard disk is. The explanation is that DMA is not on. This can be seen by typing
# /sbin/hdparm /dev/hda

The performance obtained at this condition can be seen using
# /sbin/hdparm -t /dev/hda

which in my case was about 2.5 MB/s. To solve this problem Ia have followed the indications of Graeme Widford for the same chipset on a Dell Inspiron 8500. You will have to patch the kernel and recompile it. Here is how I did it.

The following information assumes knowledge of how to patch, configure, compile and boot a new Linux kernel. See the Linux Kernel HOWTO for help. You may find precompiled kernels/modules here in the future but for now it's just patches and advice.

  1. obtain clean 2.4.20-8 kernel sources and cd to /usr/src/linux-2.4.
  2. Get the kernel patch
  3. cat ICH4M.diff | patch -p1
  4. make clean
  5. copy ./configs/kernel-2.4.20-i686.config to .config
  6. make oldconfig
  7. make dep
  8. make modules
  9. make modules_install
  10. make install

Once you've booted the custom kernel, I can see about 24 MB/s (hdparm -t /dev/hda).

The kernel source directory after patching and compilation  can be obtained here.
You can also get the result of my compilation. To install it:


# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,1)
#          kernel /vmlinuz-version ro root=/dev/hda3
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz


title Red Hat Linux (2.4.20-8custom)
        root (hd0,1)
        kernel /vmlinuz-2.4.20-8custom ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.20-8custom.img
 
title Red Hat Linux (2.4.20-8)
        root (hd0,1)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.20-8.img
 
title WinXP
        rootnoverify (hd0,0)
        chainloader +1

TouchPad

After the installation only the external USB mouse was working. By adding a few lines to XF86Config, you can manage to have both mice working, the external USB and the touchpad. My modified XF86Config is here. Please pay attention only to server layout and the mouse sections for this purpose.

LCD off

There is a problem when turning off the LCD. The LCD may switched off by:
In any case if you are in graphics mode (1400x1050) you will be unable to switch LCD on again. To solve this problem, you must.
If you want to manually switch LCD off, you still can do it:

    UPDATE   

The information below comes from Reiner Schulz .
He describes step by step how to solve the problem with LCD. I have tried it and it works. I reproduce here what he says.
  1. Update the XFree86 server. This is a simple task: the steps are here. Please read it carefully. You will need the file XFree86.bz2.
  2. Unpack the file radeon-20031118-linux.i386.tar.bz2. Execute (as root) install.sh
  3. The last step is to add a symbolic link libexpat.so.1 in /usr/lib that points to the installed libexpat.so.0.4.0.

    cd /usr/lib
    ln -s libexpat.so.0.4.0 libexpat.so.1

PCMCIA

With the patched kernel, you will need to apply this patch due to Graeme Wilford to /etc/init.d/pcmcia.
My patched file is this one.

 

Antonio Albiol. Universidad Politecnica de Valencia, Spain