Laptops:IBM Thinkpad R31
From Linux 101, The beginner's guide to all things Linux.
Contents |
[edit] Introduction
This article attempts to describe how to run Linux on the IBM Thinkpad R31, which I obtained through one of Clemson University's laptop programs. I use it quite heavily, since its purchase in late 2002 I have carried it to every class I ever attended at this school. I am on my second hard drive and soon to be third screen. The battery no longer holds a charge. Otherwise this is a wonderful computer and has near-perfect Linux support.
[edit] Before You Read All This
Almost all of the hardware in this machine is fully supported, and "out of the box" most Linux distributions will work pretty well with it. This document is not an installation guide, it merely aims to serve as a reference for those who might have problems getting certain parts of the hardware working, or interest in making certain parts work better.
[edit] Hardware
[edit] Processor
Intel Pentium IIIM running at 1133 MHz, and I believe there was another variant of the R31 with something slightly slower. Being a mobile CPU with SpeedStep it has the capability to do freqency scaling - see Power Management. Fully supported by the kernel (module speedstep-ich).
[edit] Input
[edit] Keyboard, buttons
The keyboard works fine however you configure it. The extra buttons on my machine (I have only volume up, volume down, mute, and "Thinkpad") can be made to work with Linux too. Without some sort of software the volume up, down and thinkpad buttons do nothing. These buttons are supported by TPB, the Thinkpad Buttons utility. This program can be used to change the mixer by the volume buttons, and to run a command when the Thinkpad button is pressed. Also, if you set it up with xosd support, it will give on-screen display of button presses such as turning the ThinkLight on and off, changing the screen brightness, volume, etc. Consult the TPB site for more information.
[edit] Mouse
The built-in stick mouse works fine as a regular 3-button PS/2 mouse...except for a really weird power management issue (see power management section).
If you want to adjust the speed, acceleration or anything else about this mouse you will need the Trackpoint Utilities, or tp4utils. This provides a daemon, tp4d for managing configuration of your Trackpoint and communicating with the hardware using special Trackpoint commands. It even comes with a graphical configuration tool called xtp4.
In Windows this mouse has a vertical scrolling capability when you hold down the middle mouse button and move the stick. This is possible in Linux, as is horizontal scrolling. This is all done in the settings in my xorg.conf below.
When using the middle mouse button as a scroll toggle, you need to find another paste button. My xorg.conf makes the left and right mouse buttons used together serve this function. Pressing two buttons at once is a little tricky, so you can use tp4utils to assign stick-depressing to trigger left and right button mouse events, thus pasting. Stick-depression, you ask? Yes, that's right, you can push the head of the TrackPoint in and it also serves as a button. You can even set the sensitivity for this button - and get it just right so that you don't accidentally paste while trying to move the mouse, or move the mouse when trying to paste. Use the xtp4 program to figure out the best settings for you, it lets you test as you tweak. Don't forget you will need to start the tp4d daemon at boot time somehow...
[edit] Storage
[edit] Memory
Mine came with 256 MB of SDRAM. No problems using the RAM with Linux.
[edit] Hard Disk, CD-ROM, IDE
The 30 GB hard disk and 24x CD-ROM drive are fairly generic and fully supported by the kernel, as is the IDE controller. To test the speed of your hard disk, issue the command
- #
hdparm -Tt /dev/hda
Results from mine:
/dev/hda: Timing buffer-cache reads: 652 MB in 2.00 seconds = 325.24 MB/sec Timing buffered disk reads: 60 MB in 3.04 seconds = 19.75 MB/sec
If you get a really low speed on either of these measurements, first make sure the hard drive is not currently running (close all applications) and try again. If it is still excessively slow, DMA is probably not turned on, and your disks are using the much slower PIO mode. Try this command to turn DMA on:
- #
hdparm -d 1 /dev/hda
If this doesn't work, your kernel probably doesn't have support for this IDE controller compiled in. If not, you need to reconfigure and recompile your kernel with support for the piix IDE device driver.
|
Note: In the two years I've owned the R31, the hard disk has died and been replaced twice. Be sure to keep a backup of all your important data and possibly some of your system configuration, so you will not lose 30 GB of data if your hard disk dies. IBM's hard disks have never been very reliable and this notebook's drive is no exception. |
[edit] Video
[edit] Screen
14.1" LCD with native resolution of 1024x768. Works fine in X11 as a generic 1024x768 LCD. See my xorg.conf below.
[edit] Graphics Card
Intel i830M chipset-integrated graphics card with shared memory. Some versions had a i830MG (slower). It isn't the fastest thing in the world, but it will comfortably run some GL-based xscreensaver modules, and some old 3D games like Unreal Tournament and Quake 3. Mostly supported by DRI in the kernel (module i830). On things that use a lot of video RAM there are sometimes missing polygons but that may be because I have very little memory shared to my video card. See my xorg.conf below.
[edit] S-video out
So far as I know it's not working, see more details here. I've never tested. If it did work, it would use nvtv to output video.
[edit] VGA output
There is a female VGA connector which can be used to output to a monitor, projector or other display device. It works fine - cycle through the output modes using the Fn+F7 key combination. Normal mode is LCD only, next comes VGA out only, then LCD + VGA out together. You can get an on-screen display of which output is being used by installing and configuring TPB, see keyboard section for more information.
Dual-head is possible with the i830 chipset but I haven't tested it yet. I will update in a few days on this.
[edit] Sound
Intel 82801CA/CAM AC'97 integrated sound card. Again, not stellar but works fine. This laptop has two interestingly placed speakers, a 1/8" mono Mic input and a 1/8" stereo headphone jack. It's all fully supported by ALSA in the kernel (module snd-intel8x0).
I was having problems with the sound, and you may have similar problems. The sound would stop suddenly and kernel messages (see them using using dmesg) revealed the message "IRQ 11: nobody cared! ... Disabling IRQ 11." I thought this was a Linux problem for a long time, and tried many different things but nothing fixed it. Finally, I started having more problems with random lockups and got the motherboard replaced. Sound works fine now! If you have this problem and your laptop is under warranty, get it serviced.
[edit] Networking
[edit] Wireless
This is a miniPCI version of the common Intersil Prism 2.5 Wavelan chipset. It is supported by both the Wavelan drivers and the Orinoco drivers. The Orinoco drivers are, IMHO, easier to use along with the Wireless Tools, and the Wireless Page can help you out with all of that. Just make sure you have the drivers hermes, orinoco and orinoco_pci compiled as modules.
Unlike some of its descendants in the Thinkpad line, this machine does not have a wireless network usage light. You can Google a little and find a program called netled which displays network traffic using one of your keyboard LED's. This isn't entirely useful, but sometimes fun.
[edit] Ethernet
The Intel Ether Express PRO/100 VE ethernet controller is supported both by the Linux kernel and by Intel. The kernel's module is eepro100 but you can use Intel's e100 driver if you like - I'm not sure which is "better", eepro100 works fine for me so I just use it. You can use Wake-On-Lan with this card using the script etherwake which seems a strange nomad sort of program - it has no home page. Google for it and you'll come up with something. Likelihood is that your distribution has some package for it.
[edit] Modem
Intel 82801CA/CAM AC'97 Modem Controller, a WinModem as they call them. Supported by the nice people at Smart Link. Simply download the driver from their Linux support page, unpack the driver, and install:
|
Note: You will need the entire kernel source installed on your system. If you have any trouble, consult the |
-
cd /home/username -
tar zxvf slmodem-2.9.10.tar.gz -
cd slmodem-2.9.10 -
make -
su - #
make install
Now you need to load the driver and set up the daemon program. Set your country code when you run the daemon.
- #
modprobe slamr - #
/usr/sbin/slmodemd --country=USA /dev/slamr0 &
These commands must be run every time you want to use the modem, or you could have all this run whenever your computer starts. Copy the script provided with the driver and add the following line to your /etc/modules file:
slamr
- #
cp scripts/slmodemd /etc/init.d/
Now use your distribution's utility for adding the service slmodemd to init level 3. If you have trouble with this, check the README. Once all this is working, you can use the modem device /dev/ttySL0 with you favorite dialer - two good ones include kppp which comes with KDE, and Wv Dial.
[edit] Other peripherals
[edit] USB
There are two USB 1.1 ports and an internal hub. I think the built-in keyboard might also be USB. Fully supported by the kernel.
I use a USB mouse with this computer while it sits on my desk as it is more comfortable. I have found that sometimes when coming back from suspend, or when unplugging the USB mouse and then plugging it back in, the mouse will no longer work. I think this has something to do with the X server, however there is a simple workaround. If your USB mouse doesn't come back, simply press Ctrl+Alt+F1 to switch to another virtual terminal, then switch back to the VT on which X is running (probably Ctrl+Alt+F7). The mouse should work again now.
[edit] PCMCIA cardbus
This laptop has a Texas Instruments PCI1410 cardbus controller. It has a single socket. I have never used it (because everything I need is built into this laptop...) but others report it works with pcmcia-cs.
[edit] Infrared
In the spot where there should be an infrared port on my laptop, there is just a plastic square. I have no real use for this anyway, but here is a page describing how to get it working if you like.
[edit] Parallel Port
Never tried this useless legacy equipment, in fact I disabled it in the CMOS setup. Should work with standard kernel parallel port stuffs.
[edit] Power Management
Because of the power management issues in this machine some notes are necessary here. For all other power related reference, including CPU frequency scaling, look at the Power Management page.
[edit] APM
APM (Advanced Power Management) works somewhat, it can put the machine into the suspend state. When using APM to check the battery status, however, the built-in mouse goes nuts, jumping to the top-right corner of the screen and clicking randomly. When this happens, sometimes it will "get stuck" repeating a key or mouse event. Pressing the Esc key repeatedly will sometimes get it "un-stuck". To avoid this situation, turn off any battery meters. You can still check your battery status, just enter apm at the command line. Don't move the mouse while checking! This does not effect an external mouse.
One solution I've heard that supposedly fixes the jumping mouse issue is adding the option i8042.nomux=1 to the kernel options at boot time. I have no idea what this does, and it seems to have no effect on my machine.
[edit] Standby
You can put the machine into APM standby using the command apm -S (as root). When you do this, it may work once and then when you try again, the laptop will not wake up. For some reason or another, the X server tends to die while the machine is in standby. To solve this, one can switch to another virtual terminal and put the X process to sleep. Here's my script to do this. Put this in a file called thinkpad-standby.sh and run it as root when you wish for the machine to suspend.
#!/bin/bash # Standby script for Thinkpad R31 # get the process id of the X server XPID=`pidof X` # switch to VT 1 and put X to sleep chvt -t 1 kill -STOP $XPID # APM standby apm -S # wake up X and change back to VT 7 kill -CONT $XPID chvt -t 7
|
Note: Passing |
[edit] ACPI
Previously I thought ACPI was completely unusable on the R31 because of reported bugs in the ACPI BIOS. Recently I ran Knoppix on the machine, and was surprised that it detected the ACPI system and successfully loaded modules for it. I was able to use the built-in TrackPoint mouse and the battery meter at the same time! However, I did not test sleep, or any other common power functions beyond trying the sleep and hibernate buttons on the keyboard, which did not work. If I did more digging I think I would probably find that many things do not work properly.
There are instructions on disassembling and patching your R31's ACPI BIOS to fix the issues in the firmware. This is not for the faint of heart! It could ruin your laptop entirely. I haven't done it and I don't recommend that you do, unless you really know what you're doing. However if you do get this working you will be able to use your battery and several other things normally.
[edit] Sensors
There is also no Linux sensor support for this laptop. This means you can't read the thermal data, fan speed, etc. This is due to some strange issue with Thinkpads in general, in fact the lm-sensors tool sesors-detect detects it and won't continue to run the sensor probes. If even the sensor probes are run, the machine can be rendered totally unusable. It may be possible to get some of this information from ACPI
[edit] My xorg.conf file
This is the configuration file for X.org that I use with my R31 - it has a few tweaks. First of all, I don't like that pesky Caps Lock key - I never use it, and sometimes I accidentally press it instead of shift. So I map it to a much more useful extra Left Control key. If you do not want this option comment out the line between the #################'s.
Secondly, I have set up the middle mouse button to toggle scrolling. When the middle mouse button is down, left-right movement of the stick mouse triggers horizontal scrolling and up-down movement triggers vertical scrolling. Of course, in X11 one usually uses the middle mouse button to paste highlighted text, so "Emulate3Buttons" is turned on, so that if the left and right buttons are pressed together it pastes. Now this may seem counter-intuitive, unless you use the tp4utils to make stick depressions generate the right buttons to paste. See the mouse section above.
Please note that you can't use this as your entire xorg.conf or XFree86-4 file. I have removed some distribution-specific elements (i.e. the server file section) of the below file and left only the useful stuff. Back up your existing X11 configuration file before editing it. Compare this file to your X11 configuration file and make appropriate changes, don't try to copy it all without understanding. Also make sure you have the DRI drivers compiled correctly before adding the dri and glx modules, etc. or X may fail to start. Also note that the "screen" and "monitor" sections were mostly generated, and they worked so I left them alone. If anyone has a better way, please update.
Section "Module"
Load "dbe"
SubSection "extmod"
Option "omit xfree86-dga"
EndSubSection
Load "type1"
Load "freetype"
Load "glx"
Load "dri"
EndSection
Section "DRI"
Mode 0666
EndSection
Section "ServerFlags"
Option "blank time" "10" # 10 minutes
Option "standby time" "20"
Option "suspend time" "30"
Option "off time" "60"
Option "AllowMouseOpenFail" "True"
EndSection
Section "InputDevice"
Identifier "Keyboard1"
Driver "keyboard"
Option "XkbModel" "pc101"
Option "XkbLayout" "us"
Option "AutoRepeat" "500 5"
################################## Comment this line for normal CapsLock
Option "XkbOptions" "ctrl:nocaps,grp_led:caps"
##################################
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "PS/2"
Option "Device" "/dev/input/mouse0"
Option "YAxisMapping" "4 5"
Option "XAxisMapping" "6 7"
Option "Emulate3Buttons"
Option "Emulate3Timeout" "50"
Option "EmulateWheelButton" "2"
Option "EmulateWheel" "true"
EndSection
Section "InputDevice"
Identifier "Mouse2"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mouse1"
Option "ZAxisMapping" "4 5"
EndSection
Section "Monitor"
Identifier "monitor1"
VendorName "Generic"
ModelName "Flat Panel 1024x768"
HorizSync 31.5-48.5
VertRefresh 40-70
# Sony Vaio C1(X,XS,VE,VN)?
# 1024x480 @ 85.6 Hz, 48 kHz hsync
ModeLine "1024x480" 65.00 1024 1032 1176 1344 480 488 494 563 -hsync -vsync
# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576" 50.00 768 832 846 1000 576 590 595 630
# 768x576 @ 100 Hz, 61.6 kHz hsync
ModeLine "768x576" 63.07 768 800 960 1024 576 578 590 616
EndSection
Section "Device"
Identifier "device1"
VendorName "Intel Corporation"
BoardName "Intel 830"
Driver "i810"
# Option "DPMS" #enable display power management
EndSection
Section "Screen"
Identifier "screen1"
Device "device1"
Monitor "monitor1"
DefaultColorDepth 24
Subsection "Display"
Depth 8
Virtual 1024 768
EndSubsection
Subsection "Display"
Depth 15
Virtual 1024 768
EndSubsection
Subsection "Display"
Depth 16
Virtual 1024 768
EndSubsection
Subsection "Display"
Depth 24
Virtual 1024 768
EndSubsection
EndSection
Section "ServerLayout"
Identifier "layout1"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Mouse1" "CorePointer"
InputDevice "Mouse2" "AlwaysCore"
Screen "screen1"
EndSection
[edit] Links
These are some links I find useful whenever I am looking for R31-related information:

