IBM ThinkPad R31 / 2656-6FG / TR16FUK

IBM ThinkPad R31: 1.13GHz PIII-M, 128MB, 30GB, DVD, 14.4", 1024x768, i830MG, LAN, WiFi, LinModem, Infra-red, Parallel, VGA, S-Video, 2 USB, 1 PCMCIA, i810/AC97, Mic, Headphone, Hibernate, ThinkLight, UK Keyboard, Nipple, 3 Buttons!

What sucks: No PS/2, No Serial, Crippled PCMCIA, Crippled Ultrabay 2000, No SMAPI BIOS, No WiFi Radio-off switch, Non-right-angled (straight) power plug, 32kB L1 Cache, ~3:00hr Battery life.

Status

Pentium(R) III Mobile CPU 1133MHz (speedstep) (732MHz 64%) working
128MB RAM (1 SO-DIMM) 1 slot spare upgraded 384MB
30GB (29GB WinXP, 1GB Recovery) F11 on boot reformatted
DVD hdc=scsi for DVD hdc=ide for ripping
14.4" TFT. Hardware brightness (802.11b arial) working
1024x768 (vga=791) disable stretch working
i830MG Graphics chipset most things Xv, 2D, 3D, no DRI
10/100 LAN, Intel EEPRO (eepro100/e100) eepro100 in 2.4 working
Mini-PCI 802.11b (orinoco_pci)   and Promiscuous!
Smartlink 56Kb Soft-Modem (slmdm) leave as country=USA working
Infra-Red/IRA (nsc-ircc) See: irda.txt working
Parallel IEEE 1284   untested
VGA Fn-F7 for external working
S-Video / TV-Out    
2x USB (uhci) (pendrive + tablet) working
PCMCIA, 1 slot only! (serial_cs/ide_cs) (4-in-1 flash reader) working
i810/AC'97 Audio/sound (i810_audio) Can hang on resume working
APM/ACPI/Hibernate See: hibernation-header.html Suspend/Hibernate
UK Keyboard (tpb) volume buttons install tpb
Trackpoint 3 Button Nipple   working
     
Think-Light hardware working
Power Adaptor 16v DC 4.5A Hacked to take 2-pin working
Batteries No quick-swap working

CPU and SpeedStep

Runs at either 1131MHz or 732MHz. Grab the cpufreq patches; then:

	# modprobe speedstep
	# echo '0:0:0:powersave' > /proc/cpufreq
	# echo '0%100%100%performance' > /proc/cpufreq

Keyboard

The keyboard is somewhat refreshing since it does not feature the `Logo' and `Menu' keys so often found on keyboards dating from since around 1995. There are the four Thinkpad buttons found at the top (Thinkpad, Volume Up, Down and Mute), however these are read via peeking the NVRAM and not by the keyboard controller. At the bottom right, there are two extra keys (Back and Forward) above the inverse-T arrow keys:

Back
Up
Forward
Left
Down
Right

Back & Forward

I have found these keys to be nothing short of irritating and have only ever pressed them when I have actually been wanting the Left or Right arrow keys. The simplist way I have found around this is to just bind them to be Left and Right. Normally when re-mapping keys there is a three-stage process, the first being to take the raw keyboard scancode and generate a kernel keycode; this code is then mapped to the character to generate. However it is possible to skip the multi-stage process and just make them pretend to be arrow-keys. Note that because of the extended (double-byte) codes generated by the physical keys, they will not repeat.

	# setkeycodes e069 106    # Map  Back    -> Left
	# setkeycodes e06a 105    # Map  Forward -> Right
	# xmodmap -e 'keycode 234 = Left'
	# xmodmap -e 'keycode 233 = Right'

Before getting the Thinkpad, I have always used a Sun Type 5 US/Unix keyboard, or the Happy-Hacking keyboard when on a PS/2 PC. I used to use my Libretto with a US keyboard map and the Control key remapped. However, this isn't quite as practical with ThinkPad UK keyboard. This keyboard has a double-height Enter (Return) key that is two rows high and much narrower—the major consequence is that it isn't possible to reach Enter and Backspace whilst keeping the rest of your fingers on the home-keys.

Control & Escape

The Escape Key is a long way off the top of the keyboard, so I swap this with the Grave (Backtick) which is on the top-left of the main keyboard area. More importantly, I map the useless Caps-Lock key to a Control-key. There are three different sets of settings: One for the Linux console, one for the X Window and finally one for Windows XP/2000, which came on the ThinkPad when I brought it:

Linux Console

	# Paul Sladen  <thinkpad@paul.sladen.org>
	# Designed for remapping the Thinkpad TR16FUK (UK keyboard)

	include "uk.kmap"

	# [capslock] -> [ctrl]
	keycode  58 = Control

	# [grave] <-> [escape]
	keycode   1 = grave            notsign          bar              nul
	keycode   41 = Escape

	# [rh-ctrl] -> [compose]
	keycode  97 = Compose

Save this as `/usr/share/keymaps/i386/qwerty/thinkpad-uk.kmap' and then run `loadkeys' on the file; or `install-keymap' to set it permanently.

X Window System

	# xmodmap -e 'keycode 9 = grave notsign'
	# xmodmap -e 'keycode 49 = Escape'

and in `/etc/X11/XF86Config-4' to convert the Caps-Lock key:

	Section "InputDevice"
	  ...
	  Option          "XkbOptions"    "ctrl:nocaps"

Windows XP/2000 registry file

	REGEDIT4
	[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
	"Scancode Map"=hex:00,00,00,00,00,00,00,00,\
	04,00,00,00,\
	1d,00,3a,00,\
	29,00,01,00,\
	01,00,29,00,\
	00,00,00,00

Copy this into a text-file named `capsctrl.reg' and double-click the file to install it. Since this's Windows, you won't be surprised to learn that it needs a reboot to take effect... (To unset it, remove the above key from the registery using `regedit').

See also: http://www.msu.edu/user/pfaffben/t30.html

Repeat Rate

With the ThinkPad, it doesn't appear to be possible to set the keyboard repeat rate in the BIOS so, I use the following command to set the keyboard repeat rate to be what I expect (minimum delay until a key on the keyboard starts repeating and then repeat as fast as possible):

        # kbdrate -r 30 -d 250

You can also add this somewhere in `/etc/init.d/console-screen.sh' so that it will be automatically run upon startup.

FIXME: This needs to be run following every suspend/hiberation, as the keyboard settings are not restored.

	$ cat /etc/apm/event.d/keyboard-repeat
	#!/bin/sh
	case "${1},${2}" in
	resume,*)
	    exec /sbin/kbdrate -r 30 -d 250
	    ;;
	esac
	exit 0

Battery Life

The battery life isn't wonderful compared to the iBooks—the ThinkPad R31 does just over 3 hours on a single battery. My Libretto—before it—did a very consistent 3:15 hours, but the ThinkPad seems to be alot more variable and can easily go down to below 2 hours if you are playing DVD's or DivX's and have forgotten to clock the CPU down to the slow speed.

The battery which came with it is labelled `02K6822' and is rated at 10.8v, 4AH (ACPI states 48,000mAH). I found an additional battery on Ebay which I got for £11.54 +P&P, this is I indentical to the above but is labelled `02K6823'

The battery packs each contain six 2,400mAH 3.6v battery cells (Sanyo `F' cells?). They are laid out as three sets of pairs of cells. The pairing of the cells in parallel doubles the current rating up from 2400mAH to 4800mAH; putting these pairs into series then triples the voltage up to 10.8V.

Charging is excellent and can go from a completely empty battery to fully charged in less than an hour, seemingly regardless of whether the machine is iin use or not.

One thing that I found out to my cost, is that it is not possible to swap batteries whilst the machine is sleeping without it crashing. I really wish they would follow suite from the iBooks and put a capacity in that can handle the tinning of the machine for 5 seconds whilst you swap the batteries. This means that you really need to get hiberation sorted. (Remember that you can't have an additional battery in the Ultrabay).

Hiberation

UPDATE: I reverse-engineered the IBM ThinkPad R31 Hibernation system and even started writing some code (called `acrdisk').

The R31 has hardware hiberation support that is handled by the BIOS. Unlike other machines (my beautiful Libretto) you can't just simply leave a large hunk of space at the end of the disk and expect the BIOS to use that—it needs to be told about where the block is.

The machine comes pre-loaded with Windows XP which features pretty reliable(!) built-in software-suspend—hopefully something that Linux will get someday—so there is no software to create the magic information.

The software that is available from IBM only runs under Windows 98 and so will not install under the OS that is on the machine. The "Sleep-Manager" software is: `./sleepmgr/slmn1c98.exe' which unpacks to the contents found in the `./sleepmgr/unpacked/' directory.

I haven't been able to investigate the software its-self any further without Windows 98 on the machine. Here are my observations;

Screen too bright

The screen often seems to bright when on power, especially since you already have it set on the lowest brightness setting (Fn+Home / Fn+End). The following will get you back the battery-level brightness even when on AC power.

  1. Unplug power cable.
  2. Suspend using Fn+F4.
  3. Plug power in.
  4. Hit [Power] button to turn on again.

Other Links

R31 Mailing List, Linux on ThinkPad mailing list