OpenBSD on a ThinkPad X31

This page documents how to install and configure OpenBSD for the IBM ThinkPad X31. Specifically, model number "2672N7M" (though it has a couple of extra ports not in the official model). I'm running OpenBSD 3.6-current, but OpenBSD 3.4 and later should work too [1].

Changelog

Installation

First off, OpenBSD runs rather well on the ThinkPad X31. It is a great little laptop. The machine has no external drives. Just ethernet, optional wireless, usb, (and a bunch of other network-type interfaces). This makes installation less than straight-forward. I was not able to install over the network, but was immediately able to install via a USB floppy drive. Here is a (now outdated) description of the various installation methods I tried.


Hardware

Here are the full specs. Note, this machine also appears to have cardbus and firewire ports, which were not in the specs, which was a bonus.

Here is the dmesg.

Processor

Intel Pentium M 1.60 GHz

Supported. And I am very happy to report that for batch compilation [2] the Pentium M 1.60 GHz laptop is marginally faster than my Pentium4 2.4 GHz desktop! The desktop has the more ram, but the laptop has 1M cache, which I suspect is the difference.

md5 -t timings for a some OpenBSD machines at full speed
cpu result
Pentium 4 2.55 GHz 0.571880 s
Pentium M 1.60 GHz 0.649318 s
Pentium III 701 Mhz 1.454648 s

update [22/12/03]
A driver for the Pentium M Enhanced SpeedStep modes has been added to the i386 kernel. This went in on 18/12/03. The dmesg now reports the available modes. It operates through the hw.setperf and hw.cpuspeed sysctls. The driver lives in sys/arch/i386/i386/est.c. Play with it and make sure it works!

update [06/01/04]
A driver for the pentium 4 thermal control circuit (tcc) has been added to the kernel. This can be used to limit power consumption with the hw.setperf sysctl. Thermal control is indepedent of SpeedStep, and if you have SpeedStep (like the X31) then the tcc is not used, I think. Check sys/arch/i386/i386/p4tcc.c for more information.

An example tuning:

    $ sysctl -a hw.cpuspeed
    hw.cpuspeed = 1600
    $ sysctl -a hw.setperf
    hw.setperf = 100
    $ sudo sysctl -w hw.setperf=50
    hw.setperf: 100 -> 50
    $ sysctl -a hw.cpuspeed
    hw.cpuspeed = 1200

Also, the mV value is reported at boot time, and changes if you clock the machine back. At setperf=100:

    Enhanced SpeedStep 1600 MHz (1484 mV)
and at setperf=0:
    Enhanced SpeedStep 600 MHz (956 mV)

Measurements indicate a battery life gain of 32% at 600MHz, compared to the default, stretching the battery life to 4 hours. Read the man page for more information.


Running times of the md5 -t test, at 10% increments of the setperf value. This reveals the interesting result that setperf levels are stepped, rather than being continuous. So adjusting it to levels finer than multiples of 20% are useless. It also shows that the performance hit as you move to lower values is not a linear decrease, but slightly curved. Also note the single outlying value for setperf=0.

Graphics

Chipset "ATI Radeon Mobility M6 LY (AGP)" (ChipID = 0x4c59)

Supported with the radeon driver. Looks great 1024x768. An XF86Config file is available, thanks to Kim Nielsen. (This is for my machine with a 'us' keyboard, not 'dk' as Kim's is).

Also, screen fonts/xterms will look a lot better if you install some truetype fonts. Here is how.

Some of graphics-related things are controlled from the keyboard:

  • Fn F3 works to turn off the screen
  • Fn F7 switches between { internal, external, both, neither } displays. Nifty.

The external display has been confirmed to work rather well with both an external monitor, and also with an overhead 'beamer' projector. This is a great laptop for presentations! I had to make *no* changes to my X setup for this to work. It was fine out of the box.

update [18/01/05]
The Xorg radeon server for this card provides a "DynamicClocks" option, which:

    Enable dynamic clock scaling.  The  on-chip  clocks
    will  scale  dynamically  based  on usage. This can
    help reduce  heat  and  increase  battery life  by
    reducing power usage.
Seems a useful thing to use.

Hard Disk

paprika$ sudo atactl wd0c identify

Model: FUJITSU MHT2040AT, Rev: 8423, Serial #:         NN4GT3A12YAF
Device type: ATA, fixed
Cylinders: 16383, heads: 16, sec/track: 63, total sectors: 71474162
Device capabilities:
	ATA standby timer values
	IORDY operation
Device supports the following standards:
ATA-2 ATA-3 ATA-4 ATA-5 ATA-6 
Master password revision code 0xfffe
Device supports the following command sets:
	READ BUFFER command
	WRITE BUFFER command
	Host Protected Area feature set
	Read look-ahead
	Write cache
	Power Management feature set
	Security Mode feature set
	SMART feature set
	Flush Cache command
	Device Configuration Overlay feature set
	Automatic Acoustic Management feature set
	Set Max security extension commands
	Power-up in standby feature set
	Advanced Power Management feature set
	DOWNLOAD MICROCODE command
	SMART self-test
	SMART error logging
Device has enabled the following command sets/features:
	READ BUFFER command
	WRITE BUFFER command
	Host Protected Area feature set
	Read look-ahead
	Write cache
	Power Management feature set
	SMART feature set
	Flush Cache command
	Device Configuration Overlay feature set
	Automatic Acoustic Management feature set
	Advanced Power Management feature set
	DOWNLOAD MICROCODE command

Ethernet

Intel PRO/100 VE rev 0x81

Intel PRO/100 VE works with the fxp(4) driver. Supported since July 2003, not supported in GRUB.. grr.

Wireless

The ipw driver is in the OpenBSD kernel, so the internal wireless should work. What follows in a now-dated discussion of the problems of getting wireless working.

You may want to look at the "misc/tpwireless" port if you want to install a non-IBM "authorized" wireless nic. This port disable the nic check in the bios.

Andrew Baumann has written a comprehensive discussion of the problems of getting the X31 wireless cards working, with the internal aerial. It is mostly about Linux support, but applies to other open source operating systems as well. The current news is that there is a beta open source Linux driver. Maybe an OpenBSD centrino driver will appear soon...

Intel PRO/Wireless 2100 LAN MiniPCI Adapter

This card is not supported (08/2003). An unofficial driver appears to be available, see here. Haven't tested this yet.
Note that it is not the same as the "PRO/Wireless 2011", which is supported.

Cisco Aironet MPI-350 MiniPCI

I think this card does not work. The following information is based on google research, as I don't have this card myself.

Most Cisco 350-based cards are supported by OpenBSD, but apparently not the Cisco 350 mini-pci variety, sold by IBM:

    Part no. 31P8301 : "Cisco Aironet Wireless 802.11b Mini PCI"

It is recognised as "Aironet MPI-350 Wireless" by the kernel, from the pcidev entry:

    product AIRONET MPI350          0xa504  MPI-350 Wireless

An entry for this card was added to the list of pcidevs (07/03), but the relevant code to have it picked up by the an driver doesn't appear to exist. It is possible that only a product id entry has to be added to dev/pci/if_an_pci.c to get this working...

At least two people have reported to misc@ that the card doesn't work. This card is supported in FreeBSD, so you could have a look at that code.

update [31/03/04]
Dan Harnett writes:

        a Lucent based mini-PCI card should work just fine.  Most Lucent
        based cards do not attach directly to the PCI interface, but rather
        have some sort of PCMCIA/CardBus <-> PCI bridge.  The mini-PCI cards
        appear to be no different.

        I'm currently using a Dell TrueMobile 1150 (OEM Agere) in my X31
        (2884-XX4) with no problems whatsoever.  The BIOS does not complain
        at all as it apparently does not see this as a networking device.
Check out: dmesg.

PCMCIA cards work fine.

Modem

Intel 82801DB Modem

Unsupported. Haven't tried this.

Audio

Intel 82801DB AC97 Audio works with the auich(4) driver. Works perfectly.

update [22/12/03]
The pcidevs entry for the chip has been entered into the kernel. A single line in the dmesg changes:

ac97: codec id 0x41445374 (Analog Devices <74>)
to
ac97: codec id 0x41445374 (Analog Devices AD1981B)

USB

Supported. External iPods, usb keys, usb floppys etc seem to all work.

PCMCIA

Supported.

CF-Card Reader

Supported.

APM

Supported. The machine sleeps with apm -S, and suspends with zzz, or if you close the lid. And it wakes up if you open the lid. This is nice. For this all to work, you have to enable the apm daemon in /etc/rc.conf. This code has come a long way since I last used it in 2.9.

Firewire

Ricoh 5C552 PCI-Firewire
Not supported.

IrDA

Supported. I even managed to get file off my girlfriend's Siemens phone over IrDa, using the ports tree tools.
Ed Wandasiewicz writes:

        IrDa does work on X31. Try the following.

        1. Enable IrDA in the BIOS.
   
        2. $ dmesg | grep irq
   
        You should see pccom0 and pccom1, serial ports.  IrDA should be /dev/cua01
   
        3. Install the birda package from the ports/packages collection.

        4. Set up an activated IrDA device next to the X31. As root type
        $ ircomm -Y -d /dev/cua01 -y /dev/ptyqf -l log -v 2
           
        5. $ cat log

        You should see verbose logging telling you if it's successful. You can
        use /dev/ptyqf in your /etc/ppp/ppp.conf and hey presto.

        (The X40 has IrDA but its built into the secure disk slot, which at
        present is not recognised.)

Security Chip

Unsupported. Isn't detected by the kernel.

A preliminary NetBSD driver for the TCPA ("Trusted Computing Platform Alliance") security chip was announced on daemonnews.org in early November 2003. You could port it while the code base is small. There is also a GPL Linux driver from IBM Watson.

An OpenBSD port of the NetBSD driver is available. See here. It has been tested on the x40, so maybe the x31 also works?

Keyboard

Works fine. The following issue was been solved when OpenBSD switched to Xorg's server. You may also wish to install the 'sysutils/tpb' port from the ports tree, which enables binding actions to the AccessIBM button, and nice graphics for the other funny buttons on the keyboard. Also, thanks to Bernd Ahlers, you can use the following to enable the two keys around the arrow key set:

    $ xmodmap -e "keycode 233 = Page_Down"
    $ xmodmap -e "keycode 234 = Page_Up"

An X/keyboard issue: running 3.4-current, about once a day the keyboard stops responding to input, for a minute or two. The mouse pointer continues to work. Logging on remotely, and restarting X, fixes the problem. Waiting a few minutes also works. Sometimes just before it stops responding, it echoes key presses very slowly. I haven't resolved this. It seems to only happen when I hold down Alt or Ctrl keys while pressing other keys, but isn't reproducible.

It has been suggested that this is possibly an ACPI support problem, although we don't have a solution yet, other than to go and have a cup of coffee, and hope it has settled down by the time you get back. (In fact, the problem appeared while writing this paragraph...)

update:
On 16/12/2003, running the Dec01 3.4-current, the cursor stopped responding: it was stuck on the screen. The keyboard continued to work and the machine was otherwise functional. Moving the accupoint had no effect. Restarting X had no effect (unlike the aforementioned keyboard issue). Rebooting the machine solved this problem. This problem has happened on 1 previous occasion, so that is twice in 1 month. The problem seems to manifest itself soon after reawakening from sleep.

update:
A fix for the frozen cursor problem! Sometimes switching to the console and switching back helps. Just restarting X (i.e. loggin out) sometimes works too. Or a combination of the two (logout; switch to console; switch back). The mouse reawoke and I continued on my merry way. Hmm... I wonder if I can fix the frozen keyboard like this? Problem: how to switch to the console when all you've got is a cursor?

Keyboard Light

The X31 has a keyboard light for typing in the dark. It works :)

Further reading

Andrew Baumann's Linux on the X31 page.

A dmesg, XF86Config and notes on what works and what doesn't, on OpenBSD, from Kim Nielsen is here.

A page on OpenBSD on the ThinkPad X40. Including a bunch of interesting tools.

Stefanos Zachariadis's Linux on the IBM ThinkPad X31 page.

Another, well known user of deadly.org fame, Jose Nazario, posted this success.

And it looks like the Net/OpenBSD developer Jun-ichiro "itojun" Hagino has one (in Japanese) of these machines, although I'm not sure if he is running OpenBSD on it. The text is to do with the appearance of drivers for the atheos chipset.

Notes

[1] Prior to OpenBSD 3.3-current, July 2003, there was no driver for the PRO/100 VE ethernet card. So I wouldn't recommend installing an old kernel.

[2] Full build of GHC 6.0.1, 30 mins for the laptop, versus 32 mins for the faster-clocked desktop box.

Changelog

  • 01/08/07 : Almost 4 years now, still flawless. Glad I bought it.
  • 06/11/05 : Had it for 2 years now. Daily, intensive use. Update some entries.
  • 15/05/05 : Some useful ports tree utilities
  • 18/01/05 : Update to state of play with 3.6-current
  • 01/09/04 : Update IrDA thanks to Ed Wandasiewicz
  • 31/08/04 : New Centrino wireless driver project for *BSD
  • 12/08/04 : New page on OpenBSD on X40
  • 05/08/04 : Mention new open source Linux wireless stuff
  • 31/03/04 : Add Dan Harenett's working wireless
  • 25/03/04 : Clean up Enhanced SpeedStep paragraph
  • 23/03/04 : PXE added to OpenBSD -current
  • 22/03/04 : Graph performance of setperf values
  • 15/03/04 : Fix for frozen cursor problem
  • 16/01/04 : Document unresponsive Fn-F3
  • 07/01/04 : Driver for P4 thermal control circuit documented
  • 22/12/03 : Driver for Speedstep modes committed to -current!
  • 16/12/03 : Document unresponsive cursor
  • 14/12/03 : External display works perfectly
  • 14/12/03 : Document failed attempt with mini-usb key
  • 06/12/03 : Document the Fn keys
  • 05/12/03 : Keyboard problem related to ACPI?
  • 30/11/03 : Mention specific X31 model number
  • 29/11/03 : Add hd information
  • 28/11/03 : Link to jose's post
  • 26/11/03 : Mention keyboard problem
  • 21/11/03 : Validate html, almost
  • 20/11/03 : TOC and internal links
  • 18/11/03 : Mention truetype fonts
  • 17/11/03 : Successfully installed OpenBSD via USB floppy
  • 16/11/03 : Point out which OpenBSD version I'm referring to
  • 15/11/03 : Document failed attempt at PXE booting via GRUB
  • 13/11/03 : Initial revision, add link to IBM specs