Linux on a ThinkPad T22

James MacKinnon

Department of Economics, Queen's University

I bought an IBM T22 (model 26475EU) in late February, 2002. This particular model has a 1400 by 1050 screen, a 1 GHz Pentium III processor, a 32 GB hard drive, and either a DVD-ROM drive or a floppy drive (only one can be used at a time). It is not as up-to-date as the comparable T23 models, which have faster processors and larger hard drives, but they cost considerably more and seem less likely to be compatible with Linux. Another attractive feature of this T22 is that it came with Windows 98SE, although a sticker on it says it was designed for Windows 2000. This minimized the "Windows tax" and made repartitioning the hard drive easy.

The First Steps Go Well

My first step was to fire up Windows and look at the installed hardware. The sound chip was listed as a "Crystal Semiconductor SoundFusion", the video card was called an "S3 Savage/IX w/MV", and I also found a "Lucent Win Modem" and an "Intel PRO/100 SO". All but the winmodem, which I did not care about, are known to be supported, and I believe that even it could be made to work.

My next step was to boot from a diskette containing GNU Parted. I discovered that the drive had two partitions, hda1 of just under 30 GB belonging to Windows98, and hda2 containing files from which to restore hda1, and erase all your data, when Win98 self-destructs. I had no difficulty shrinking the Win98 partition to 2 GB.

My third step was to fire up the BIOS (1.08, dated 2001-12-03) and change a few settings. I disabled "screen expansion" to prevent corruption of the display when returning from X, a problem documented by other T22 users. This made the "full-screen" text-mode display rather small, but perfectly readable. I also changed all "hibernation" options to "suspend", which I hope means that the machine will not attempt to write all over my Linux partitions when the battery runs low. I do not plan to use this machine on the battery very much anyway. I should have changed the time to UTC while I was there, but I forgot. This was no big deal. I reset the system clock after I had installed the base system, and the hardware clock was reset automatically when I next shut down.

I next installed woody, which later became Debian 3.0 when it was released, from six diskettes. These were the standard boot diskettes, not the "compact" or "idepci" ones. The kernel was 2.20. I created five logical partitions (root, swap, /var, /usr, and /home) in the usual way. As I always do with Debian installs, I formatted /usr and /home manually, from a second console, specifying 1% reserved blocks instead of the 5% Debian always uses. This involves umounting the target partition, issuing a command like "mke2fs -m 1 -b 4096 /dev/hda7", and then remounting it. With large partitions, this frees up a lot of space. It would be nice if the installation provided an option to specify the percentage of reserved blocks, although the workaround is not very difficult.

Installation of modules went fine, although I don't know for sure whether the parallel port is working. It does not matter, since this machine will not be connected to a printer. The sound chip and Ethernet card were recognized, and I soon had an IP address via DHCP. This allowed me to install the rest of the base system over the network.

A Few Problems are Encountered

Since I had never installed woody before, I let the installer guide me in the installation of additional software. This did not go well. I made the mistake of bringing up dselect, which soon got into an infinite loop of conflicting packages and dependency problems. When I broke out of dselect, having specified a nearby mirror to get the debs from, it downloaded about 150 MB of files, then announced that one of them was corrupt and refused to install anything. I could not see any way out, so I terminated the installation and went to the command line.

I decided not to bother trying to use the deb files that I had downloaded, although I believe this is possible. I just issued an "apt-get clean" to erase everything and started installing packages individually from the Debian mirror using "apt-get install packagename". This was actually not nearly as time-consuming as it sounds, because many packages bring in lots of other packages that they depend on, so my system fairly quickly got up to speed.

As usual, X was a bit of an adventure. It was not clear to me what package to ask for to get the other X packages to load, but by looking at the packages I had on my potato machine, I was able to guess, and I did manage to get XFree86 4.1 installed. The best it would do was 1280 by 1024. However, thanks to a posting from another T22 user, I found that changing the horizontal and vertical lines to

HorizSync 31.5-67
VertRefresh 50-90

and adding the line

Modeline "1400x1050" 108.00 1400 1448 1462 1688 1050 1050 1053 1066

along with the obvious changes to make 1400x1050 at 16bpp the default, gave me a very nice-looking screen. Actually, I used 24bpp initially, but this caused several programs not to work. It appears that 32bpp is not supported by this driver, so I seem to be stuck with 16bpp.

To my surprise, the Trackpoint "mouse" seems to work perfectly, with the third "button" working just the way I would expect the middle button of a mouse to work. There seems to be nothing special to enable this in my XF86Config-4 file.

I verified that, as reported by other T22 users, StarOffice 5.2 will totally hang X as soon as it brings up a dialog box. This required a controlled reboot from a network connection, since killing X from a remote login does not give back access to the keyboard and screen. The solution, which I found in another web page about the T22, is to put the line

export SAL_DO_NOT_USE_INVERT50=true

in .bashrc or another startup file.

The only remaining problem with X was that I could not access my TrueType fonts (which I had just paid for, again, when I paid the Windows tax on the new machine). Installing xfstt, which I used with potato, did not help. When I modified XF86Config-4 to talk to xfstt, X would not even start up! A web search suggested that XFree86 4.x is incompatible with xfstt, but it can deal with TrueType fonts itself. However, you need to give it some information. I had to

I wondered what would happen when I replaced the floppy drive with the DVD-ROM drive. Since I have not yet tried to install apmd, I shut down and powered off before doing this. When it rebooted, the kernel found and correctly identified the device, which it saw as /dev/hdc. After I linked this to /dev/cdrom and /dev/dvd, I was able to verify that it can read both CD ROMs and DVDs.

It took a bit of effort to play DVDs under Linux, but I ultimately succeeded. The most promising package that comes with Debian 3.0 and seems to be able to play commercial DVDs is Ogle. It was easy to install and brought in a slew of libraries that it depended on. Initial performance was poor, but replacing the regular ogle package by the ogle-mmx package, and enabling DMA on the DVD drive, helped a lot. The video is now very good, although artifacts are occasionally visible. Unlike the DVD player that came with Windows (98 SE), Ogle keeps the aspect ratio correct when you resize the window or go to the full screen. CPU usage seems to be between 25 and 35 percent when playing a DVD.

The problem is that the sound, with the standard ogle-mmx .deb file, is almost inaudible. If I turn the volume up to the maximum and stay very close to the speakers, I can just about hear it. But there is no way anyone could watch a movie that way. The same DVD played under Windows was very much louder. Other Linux applications, such as amp, also produce acceptably loud sound.

A google search suggested that this is a known problem, having to do with conversion from five channels to two. With advice from Debian's Ogle maintainer, Mikael Hedin, I changed "level=1" to a higher number in libao/audio_out_oss.c. I tried various numbers. I think I finally settled on "level=8", but it may have been "level=6". This solved the problem. I can now both watch and listen to DVDs.

I believe that more recent versions of Ogle allow you to specify the level in a config file. However, since these are not available for Debian 3.0, and I have been too lazy to recompile the source and deal with dependencies, I am still using my custom version of 0.8.2. More recently, Bernard Godard has suggested that using a mizer (aumix) provides another way to solve the inaudible sound problem.


Considering that putting Linux on a laptop is often reported to be difficult, my experience with Debian 3.0 and the IBM T22 was remarkably painless. The Ethernet and sound cards worked immediately. After I changed the permissions on /dev/dsp and /dev/mixer, amp and other sound applications worked fine. Simply adding myself to the "audio" group did not work. Setting up X was not very hard, thanks to the magic modeline given above. The StarOffice hanging X problem would have been a showstopper, but I was expecting it, and the workaround solved it. The fact that my machine has a recent BIOS may have helped me avoid some problems that others have reported.

QED Home Page