Linux on an IBM Thinkpad X31

Author: Peter Selinger
Date: June 23, 2004

For other reports of Linux on IBM and other laptops, see:
The IBM Thinkpad X31
(more images)


My wife recently bought an IBM Thinkpad X31. She installed a stock Redhat 9 system on it without too much trouble. This document reports on the tweaks we had to do to get a few features to work which were not supported by the stock kernel. Specifically, these are: One thing to understand when thinking about purchasing an IBM X31,or putting Linux on it, is that there is not just "the" X31 - there are actually a large number of different hardware configurations options available. In particular, the X31 can be purchased with a number of different processor speeds, as well as different wireless options. Thus, if some website announces "I got wireless to work on the X31", this does not by itself tell you very much, if you don't know which of the available wireless adapters they bought.

Processor speed management

All X31 models are equipped with a "Pentium M" processor (this processor is also known as a "Centrino", but note that it is not the same as a "Pentium 4 Mobile", see e.g. this website for more information). Depending on how much money you are willing to spend, you can get this processor at anything between 1400 and 1700 MHz maximum clock speed. For the sake of this discussion, I will assume you have the 1700 MHz version.

The Pentium M processor implements the so-called "speedstep" technology, which means, it can run at different clock speeds. For example, the 1700 MHz Pentium M can run at six different speeds: 1700, 1400, 1200, 1000, 800, or 600 MHz. The purpose of this is battery conservation: for example, at 600 MHz, the processor uses only 6000 mW of energy, whereas at 1700 MHz, it uses 24500 mW. Thus, it is worth running your processor at a lower speed if you do not need maximum computational power, but would rather conserve battery life. A sensible policy is to run the processor at 600 MHz when on battery, and at 1700 MHz when on AC power.

Unfortunately, the BIOS of the X31 does not automatically regulate the processor speed; it leaves it up to the operating system to do so. In fact, what happens is that the BIOS will set the processor speed once and for all at boot time: if you boot while on battery, the speed will be preset to 600 MHz (and remain so, even if you plug in the AC adapter later), and if you boot while on AC power, the speed will be preset to 1700 MHz (and remain so, even if you unplug the AC adapter later). Here is a simple program which allows you to test your current processor speed (for x86 processors only):

To control the processor speed, you need to have a kernel which has ACPI support. Unfortunately, the stock Redhat kernel lacks this feature. Thus, you need to compile a new kernel. If you have never compiled a kernel before, you should first read a tutorial on how to do so. A good place to start is probably here. I am giving step-by-step instructions below for what I did for this particular kernel I compiled.

I decided to compile a 2.4 kernel, although the newest kernel version is in fact 2.6. The reason is that Redhat 9 still uses the 2.4 kernel, and there are many incompatible changes when switching to 2.6, requiring many changes to system files. On the other hand, a 2.4 kernel can be booted without any changes to the existing setup.

Redhat 9 came with kernel version 2.4.20, but I am compiling version 2.4.26, which is the latest 2.4 kernel available at the time of this writing.

NOTE: What doesn't work. Read this before deciding whether to upgrade your kernel. There are two possible interfaces between the operating system and the BIOS; they are called APM (the older interface) and ACPI (the newer interface). ACPI has nice features such as being able to control the processor speed. On the other hand, APM is what is able to put your laptop to sleep. Sleeping is not yet supported under ACPI, at least not in the 2.4 kernel. Thus, if you run an ACPI kernel, the laptop can't sleep, and if you run an APM kernel, it can't change the frequency. This is a bit of a nuisance.

Having said this, I decided to make an ACPI capable kernel anyway; if sleep mode is absolutely necessary, I can always boot into the old kernel.

Here are the exact steps that I took to recompile the kernel with ACPI support. Commands that I typed are shown in boldface.

The new kernel should now have ACPI support. You can see this by checking that there is a directory /proc/acpi. The processor frequency is controlled via the file /proc/acpi/processor/CPU/performance. There is also other cool stuff you can do, for example, you can see the current temperature of your CPU in the file /proc/acpi/thermal_zone/THM0/temperature.

Automating Speed Management

It is possible to configure the ACPI daemon (acpid) to change the processor speed automatically in response to power events (such as switching from AC power to battery). I have not yet done so. See the acpid documentation.

Wireless adapter

Which wireless card did you buy?

There are several different wireless adapters that one can have with a Thinkpad X31. If you bought your X31 online, you may remember that you had the following choice on IBM's website under "customize":
Integrated Wireless
(Std) Wi-Fi wireless upgradable

Wireless Connectivity
[] Cisco Aironet Wireless 802.11b Mini PCI adapter [+$219.00 ]
[] Intel PRO/Wireless 2100 3B Mini PCI adapter [+$149.00 ]
This choice is confusing, and in my opinion, IBM deliberately designed their web page to fool people into thinking that they have to get either the Cisco or the Intel adapter if they want wireless connectivity. Judging from other X31 websites, most people indeed buy one or the other.

From talking to an IBM sales representative, we learned that the Cisco and the Intel are offered in addition to the "Wi-Fi wireless", which is built into the X31 regardless. Thus, the additional $149 or $219 are a pure waste of money, as you will end up with two wireless adapters in your laptop.

The only remaining question was whether the integrated "Wi-Fi wireless" card would work under Linux. According to other people's websites, both the Cisco and the Intel adapter work under Linux, see e.g. here and here. On the other hand, I did not find any information on the web about the builtin "Wi-Fi wireless" card, including such information as who made it, what chipset it uses, etc. Some people seem to assume that it is an IntelCentrino wireless card, but this is not the case. I suspect most people don't even realize it is there at all. We decided to take a chance and bought neither the Cisco nor the Intel optional card.

Instructions for the built-in "Wi-Fi wireless" card (not Intel, not Cisco)

The following is a description of how I got the builtin "Wi-Fi wireless" card to work under Linux. First, I checked that it worked under Windows. The next question is to identify the hardware. Under Windows, it is described as a "11b/g Wireless LAN Mini PCI Adapter". Under Linux, the command "lspci -v" lists this device as:
/sbin/lspci -v

02:02.0 Ethernet controller: Unknown device 168c:0013 (rev 01)
        Subsystem: AMBIT Microsystem Corp.: Unknown device 0408
        Flags: bus master, fast Back2Back, medium devsel, latency 128, IRQ 11
        Memory at c0210000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 2
I therefore learned that the manufacturer is AMBIT (definitely not Intel then), the device ID is 168c:0013 (incidentally, that is the same as my D-Link DWL-G650 PCMCIA card, which uses the MadWiFi driver - I have not yet tried if that driver also works for the AMBIT card). Poking around Windows revealed that the Windows driver is located at C:\WINDOWS\System32\DRIVERS\am5211.sys, and the Windows "driver information file" is at C:\WINDOWS\System32\Amat5211.inf.

From here, it was relatively easy to get the device to work under Linux. I simply installed the ndiswrapper software, which is an amazing program that wraps itself around a Windows driver and converts it to a Linux driver. Here are the steps that I took to make it work:

To Do: Wireless Power Management. There is one remaining problem with the wireless setup as described above: when the laptop is idle for a certain time (e.g. when the screen saver comes on), the wireless link goes down. Unfortunately, this happens even if there is network activity. I need to go to the laptop and press a key, and then, after a few seconds, the link will come back up. This can be really annoying when I am logged into the laptop remotely via the wireless link; I need to physically go to the laptop to re-activate the link every few minutes. Theoretically, one should be able to change these settings via the "power" setting of iwconfig, e.g.

iwconfig wlan0 power off
Unfortunately, this feature does not seem to be implemented in the driver.

Back to Peter Selinger's Homepage: [home]
Peter Selinger / Department of Mathematics and Statistics / Dalhousie University
selinger@mathstat.dal.ca / PGP key