Installing & Running Linux on an IBM T23 Laptop

Alex Bligh (alex@alex.org.uk)

Changelog:

v0.01
Introduced Changelog
v0.02
Added section on modem support
Added Craig Harmer's details on SuperSavage drivers
Added wavelan suspend workaround
Couple of minor cleanups
v0.03
Added information on maintenance partitions, and some stuff about backing up MBR
v0.04
Refined modem section
v0.05
Added details of Linuxcare site, stuff on ALSA drivers, note about shipped linux drivers for E100
Added hacks to get wlan working
v0.06
Added information on how to get VMWare working
Documented fix for mouse protocol

Introduction

The IBM T23 is a cute laptop. Example configuration (mine): 640Mb of memory, forty something Gb of disk,  1400x1050 LCD screen, 1100Mhz CPU, and, for a machine with an integrated CD-Rom, etc., quite light. So I bought one. These are, at the time of writing, very new machines, so Linux currently requires some tweaking.

The aim was to have a dual booting machine, that was also capable of running some Windows stuff under VM-Ware. However, given the main OS I wanted to run was Linux, something stable would be good. I decided to write up my experiences, partly because, as you can tell from the rest of this page, it is not a painless 'install from distribution CD's' experience, and I'm not quite there yet, and partly because I'm hoping to get some tips from other people.

Before you start - deciding on disk partitions.

Your shiny new T23 will arrive with Windows 2000 on it. If you wish to preserve the Windows 2000 installation, at the very least for dual booting, you will need to find some room to install Linux. Note that whilst I have got dual booting to work painlessly, I haven't yet got Windows 2000 to boot under VMWare .

One possibility is to do this with FIPS. The technique is described in full here and you can read about FIPS from its author here . Despite the author's slightly nostradamus-like prophecies of doom, I have never had FIPS go wrong, though it sometimes sets the geometry up strangely. However, if you have important data on your Windows partition, back it up first.

I didn't actually boot into Windows before doing this, in a perhaps misguided attempt to get VMWare installed (see later ), which meant that I could shrink the Windows partition to 10Gb minimum - I chose 15Gb. Note that there is an IBM Maintenance partition, which provides product recovery. I left it well alone, as it's very useful. Here's how to use it.

You will want to read the section on fixing your partitions .

Now, before you install LILO or do anything else which will write over your newly installed MBR, I suggest very strongly you make a copy of your current MBR (that's the one after you shrunk the disk), as well as keeping the one before you shrunk the disk. The easiest way is to run FIPS again (yes a second time), pretend you are resizing your Windows partition again, and wait till it asks for the number of cylinders you want in it. Then press CTRL-BREAK, and it will drop out. You will see you now hae a bootsec.001 as well as a bootsec.000. You will need this backup (which you should keep on floppy) if you install LILO in the MBR and subsequently want to use the maintenance partition , and you can restore the MBR using restorrb.exe (which will give you a choice of files to load). Note as this restores both the code to run the maintenance partition, and the partition table, bad things will happen if you have subsequently altered the partition table.

Fixing your partitions

Now it turns out, that at least as far as IBM and Windows 2000 are concerned, FIPS sometimes doesn't set the LBA and CHS geometries to the same value (these are different ways of persuading the BIOS that the disk has a usable number of heads, cylinders, and sectors). This gives VMWare problems, and also gives Windows 2000 problems in booting in safe mode. If you run the product recovery program on the maintenance partition (just use fdisk or similar to set it to active) it will notice this, and fix it, before merilly reinstalling Windows 2000. If you find a less destructive way to fix this (i.e. without reinstalling Windows), I'd love to know. My fix was to reinstall Windows 2000 from the product maintenance partition, which I describe here . I'm sure there is some less drastic way to do it.

How to reinstall Windows 2000 using the IBM Maintenance Partition

Your T23 has a special parition (marked Hidden Win98-FAT 16) or similar which can be used (within the license terms, of course) to restore your original hard disk.

Firstly back up any data you have on your Windows 2000 partition . This isn't one of those idle threats about possible data loss, I mean we are going to delete and reformat the partition, and you will lose anything on there. If you have a functional kernel, you should be able to mount it (read-only is safest) and copy everything you need to your shiny new Linux partition. However, as we are about to play with the internals of the disk, I recommend that if the data is the slightest bit important, you copy it to some external media.

If you haven't already repartitioned your disk correctly, do that next, like this . Now as that bit was marked 'Before you Start', you'll already have done that, won't you...

To activate it normally, after the IBM logo screen, press F11 (you should see a message telling you to do this). It says it will format the hard disk. Fortunately this is a lie. It formats the first / boot / windows partition (no I haven't worked out exactly which), and copies all sorts of goodies onto it.

If like me you erased your MBR using LILO, you can either restore your MBR from the backup you faithfully kept before you installed LILO, or put back the original MBR. You can do this using this tip from the IBM site (it's tech tip MIGR-4QDSS5, and though it says it's for a list of machines that doesn't include the T23, IBM confirms this is the correct image). Sadly it's rather overenthusiastic in rewriting the MBR and appears to dump on the partition table too. So keep a backup of your working partition table first. You will have to merge in the partition data with your favourite utility.

So why can't you just run the IBM Maintenance partition from lilo ? Well, turns out you can. And it appears to work, and installs a copy of Windows 2000. But strangely it's missing all the IBM OEM bits. I used this to help debug VMWare. However if you follow the instructions here you shouldn't need it.

BIOS & Embedded controller upgrade

It appears that updating your BIOS may fix lots of things in here - I ran under BIOS 1.01b and embedded controller 1.00c. Manoj Kasichainula recommends upgrading using these links on the IBM web site to BIOS 1.03 and to embedded controller 1.02 - for some reason these aren't (yet) indexed properly on the IBM support site (i.e. searching for 'T23 BIOS' in the downloads section doesn't find them, and my IBM Update Connector says I'm up to date - sigh). If you take the BIOS upgrade, you then don't need to apply the APM patches .

Before you blindly apply the above, check your T23 hasn't already got a newer version - IBM may have released an even newer version by the time you read this, which may have fewer, or more, bugs. Who knows. It is alleged that this upgrade fixes some of the mouse problems too.

Choosing your distribution

I am a recent convert to the Debian distribution, having previously been a Redhat fan. The stability and conformity of the Debian packages, plus the fact it doesn't try to hide what it's doing whilst it does an install, and doesn't treat you like a moron, is particularly attractive. I blew copies of the 3 Debian CDs. I soon learnt the disadvantage of the Debian distribution: at least in the UK it is far from obvious where to buy these from, and blowing them from windows is an absolute pig (for which read 'completely non-functional'. You are better off writing your own rsync script and pulling the CD image off the rsync server. Why they don't allow you to ftp the complete image down, I will never know. Perhaps I will put it on my server. This will be my one and only rant againt Debian, as from then on, its performance was beyond expectation, and I had far more success than I ever had with Redhat. I believe dselect may be addictive.

At time of writing, Debian stable is 'potato' (i.e. 2.2r3). There is a new release named 'woody' in testing. There is an unstable package called 'sid'. As you will read, though I started off with potato, I ended up mostly upgrading to woody. Unfortunately I could not find CD images for woody. Rumout has it woody hits the streets in November 2001, which will make this process far more easy.

It has been alleged, but not tested, that the Debian Woody CDs (as opposed to Potato haven't even tried building them), will not boot, other than via loadlin. It would be sad if that were the case.

Booting Linux for the first time

There are apparently quite a few standard kernel images which crash a T23. Booting both from Debian CD 1, and Debian CD 2, crashes the machine. The kernel image on CD 3 does work, though the framebuffer support is screwed up. However, it's sufficient to start the install process. Unfortunately this means yes, you need to download all three CDs. There may well be some kernel boot line which fixes things. I believe the crash is something to do with sound chip support, or perhaps AGP support, though I didn't bother narrowing it down.

The Install Process

No hitches here, so long as you are installing from CD.

Building a new kernel

The kernel you currently have has a dodgy framebuffer, and is 2.2. I wanted 2.4 for iptables support, and to run ReiserFS. I pulled down 2.4.12. Though this compiled, it wouldn't boot. I didn't bother to find out why as for various reasons I wanted 2.4.12-ac5 anyway. With Alan Cox's patches, all went well. The kernel .config file I used is here . I do not claim it is perfect, however it boots. You may wish to try without enabling sound first (Intel chip), as some versions causs a lockup on boot - see here for how to do it. Ditto more complex options like framebuffer, DRI, etc.

I subsequently upgraded to 2.4.13-ac7, which amongst other things is meant to fix sound resume under APM. The .config file I used is here .

I recommend not using CONFIG_MODVERSIONS, at least to begin with. You do not normally need to rebuild the modules (provided the API is constant) and you're otherwise going to be doing rather a lot more rebuilding than you probably bargained for. Because I am a reactionary neophobe, I also try to build as little as possible as modules anyway. YMMV.

Now you've got a working recent kernel running, you may want to fix your partitions , before proceeding.

However, this kernel out the box will not support either your onboard ethernet, or your on-board 802.11, here's how to fix it:

Onboard ethernet

The onboard ethernet is an Intel device with PCI code 1031, which can be driven by the eepro100 driver. However, the eepro100 drivers in the distribution kernels (2.2.19, 2.4.12, and 2.4.12-ac5) do recognise the chipset concerned, and need to be patched. Furthermore, once the PCI chipset is recognised, you will find the driver appears to work, but hangs occasionally (particularly on 10BaseT half duplex). This is a known bug on some eepro100 chipsets, and the driver contains a workaround mechanism to fix it, by sending an instruction to set the multicast list (which apparently clears the lockup) if no packets are received for 2 seconds. However, this workaround is (for reasons unknown to me) only activated if 2 bits are set a particular way in the eeprom (progamable memory on the eepro card - acronym overload error), which they aren't by default, at least not on my T23. Rather than fiddle about reprogramming the eeprom, I suggest patching the eepro100 driver to always activate the workaround, which should be harmless (bar a few hundred clock cycles every 2 seconds) if it's not needed. You can find my patch for eepro100.c here .

Later testing suggests it doesn't completely fix the lockups (possibly the fix disappears after you suspend). Steve Hill suggests using the Intel driver (commonly called e100, as opposed to eepro100), from here , which apparently works better, though I haven't tried it. Godmar Back notes that the T23 ships with linux drivers on-board, which support this card. They can be found at C:\drivers\network\linux\e100 and/or c:\ibmtools\drivers\ethintve\linux; you can mount your windows partition from linux (read-only if you are paranoid) to get at these from linux, and simply invert the slashes to find the directory.

802.11 controller (wireless ethernet)

You will also need support for the 802.11 controller. This is an Intersil chip-set (previously called Harris I think), and they appear to work with Absolute Value Systems, who seem to be pretty active in promoting linux drivers, which are GPL'd. You can find their project page here . I pulled down version 0.1.10 of their  linux-wlan-ng drivers.

You will want to add a line like 'alias wlan0 prism2_pci' to your /etc/modules.conf file. You will also need to add something to associated your interface card, so for instance in /etc/network/interfaces (debian naming, I'm sure other distributions have similar), I added the pre-up line below.
iface wlan0 inet static
# join group
  pre-up /sbin/wlanctl-ng wlan0 lnxreq_autojoin ssid='' authtype=opensystem
The drivers don't appear to survive suspend/resume. They do with the following foul hack. Make a file named /etc/apm/event.d/wlan (again the name may vary if you aren't using debian), containing something like this .

It is alleged by Steve Hill that this driver is 'scarilly out of date', and suggests that on 2.4 that orinoco_cs will do the job. I'm not quite sure how as it's a PCI device rather than a PC card, but he may well be right, especially as other people have said the same thing. Certainly it currently does not survive a suspend/resume and you will need to hack APM as detailed below to make it work.

I had two other problems, the neither of which are strictly related to the T23, but are probably worth documenting. If you use a Cisco/Aironet wireless hub, or are suffering from packet loss or mysterious stalls on downloads, read these two tips:
  1. I had a perfectly functional 802.11 network, using new Cisco/Aironet cards, and an older Cisco/Aironet basestation. There was no packet loss any machine to any machine previously. Adding the T23, it suffered (to anywhere) about 20% packet loss, whereas the other machines were fine. Naturally I blamed the T23. Eventually in desperation I upgraded the firmware on my Aironet up to version 8.5.5, the upgrade being free from the Cisco website , which cured everything. I suspect modern Cisco/Aironet card firmware has some workaround to work with old Access Points, that other cards do not.

  2. My T23 still appeared to be incapable of transmitting full length ethernet packets. Ethernet drivers ought to be able to transmit packets up to 1500 bytes in size (this is referred to as the 'MTU'). Sadly, at least with the driver combination I have, it appeared not to transmit packets greater than 1492 bytes. This demonstrated itself as an inability to access some web sites, and a general drop in performance, as well as mysterious network failures. Here is a long mail to the the linux-wlan-users list, which explained the symptoms. Further investigation suggested this is something (not quite clear how) to do with the AccessPoint - ensure your AccessPoint is using a default encapsulation of rfc1042 (not 802.1h) and you should be fine. On an Aironet / Cisco AccessPoint you want to look under Configuration, Radio, I80211, Encapsulation. I am not sure whether this is a driver bug, an AP bug, or just a feature. Anyway, with this switch twiddled, I get 1500 byte MTU, and large packets work just fine.

Sound Support

You will need drivers in your kernel to support sound. The chipset is PCI ID 2485, an Intel ICH3, which is driver by the i810 driver, but sadly enabling what appears to be the appropriate option in the kernel, (i810 support), causes the kernel to hang when detecting the device on boot on 2.4.12-ac5. On 2.4.13-ac7, te world is slightly better; the chip is detected, and you get sound out of it if you try hard enough. I think I had to unmute the machine whilst in BIOS first using the 'Thinkpad' keys at the top left of the keyboad. Now I just have the normal problem of fighting with userspace apps - esd doesn't seem particularly stable - dunno whether that's anything in particular to do with my setup though.

Altenatively, it is alleged that the ALSA drivers can be made to work. Godmar Back writes that the ALSA drivers almost work. With the patch here (onto alsa 0.9.0beta9), it works except for suspend resume. He added the following (preventing the problem that snd_pcm_suspend_all assumes pcm_mic is non-null, which caused an oops on suspend), and it works fully.
[root@godmar cards]# diff card-intel8x0.c.orig card-intel8x0.c
954a955
>       end_time = jiffies+HZ;
960c961,963
<                       mdelay(10);
---
> /*                    mdelay(10); */
>                       set_current_state(TASK_UNINTERRUPTIBLE);
>                       schedule_timeout(10);
1025c1028,1029
<       snd_pcm_suspend_all(chip->pcm_mic);
---
>       if (chip->pcm_mic)
>               snd_pcm_suspend_all(chip->pcm_mic);

Framebuffer / DRI support

Some people like the kernel to understand their video cards, which gives them a Direct Rendering Interface (for X and the like) as well as framebuffer VGA support. Allegedly this can also fix problems switching in and out of X, and with suspend/resume. Although I am having some problems with suspend/resume, I don't know enough to put it down to this issue. DRI is not supported currently for the SuperSavage, and should be turned off. AGP should also be turned off. One or both of these otherwise crash immediately after detection. My current workaround: turn framebuffer support off, don't have the kernel messing with the video adapter. Others allege that framebuffer (alone) works fine, and suggest using the init line ' vga=828'.

Modem support

This information is from Craig Harmer - I haven't yet tried it. He writes, in his readme file:
The  T23 sports a Lucent Win modem (otherwise known as a Lin modem).
    ATI1    E851
    ATI2    OK
    ATI3    LT V.90 Data_Fax Modem Version 5.99
    ATI4    72
    ATI5    5.99,0,19,11C1,0449,1468,041
    ATI6    OK
    ATI7    OK
    AT+FCLA...    0,1

Though I think most of the information is artificially manufactured by the modem driver (since it also claims to have a 16550 UART which i know
it doesn't).

IBM supplies a driver that is billed as working with a Lucent win modem in the T22 and other models, so it may work here as well (i'm trying it), which
you can find here . This is source only, and only for kernel v2.2, but it may work with my kernel v2.4 as well. I'm trying it. Note that I found this by going to "drivers and downloads" on their site and searching on "linux modem notebook".
Michael Rowe writes (& I haven't tried this either):
As it turns out, the version on the IBM site is a little old. There is a newer one (6.00b6) available here that appears to work perfectly! ... it loads the modules correctly, and responds to AT commands... Only getting a 28k at the moment, but that's as likely as not my crappy phone line.

APM Support

You can get APM to work in two ways. Firstly you can compile with APM off (you can turn simple PM on, though that doesn't make much odds). Then the suspend and resume will work, but it's 'dumb', i.e. Linux doesn't know about it.

Secondly, you can compile with APM on. However, Linux appears to crash on resume. This is because, whatever option you specify under CONFIG_APM_ALLOW_INTS , the kernel (dmi_scan.c) detects any IBM manufactured machine, and forces the option on. This appears to cause it to crash. See my mail to linux-kernel here for a proposed fix. Note that several people have said that this option needs to be on (i.e. allowing interrupts, the opposite from what my patch does) on a newer IBM laptop to work, and some have alleged that setting it off can corrupt disks; so whilst noone has said this speifically in relation to a T23, you apply this patch at your own risk... I get a APIC error on CPU 0 on resume, but it seems to be harmless.

Note, that if you upgrade your BIOS , you don't need to apply the patch. I recomment upgrading the BIOS.

If you compile I810 sound in, APM resume will oops, unless you have 2.4.13ac7 or higher (I'm sure the patch will work it into the Linus tree some time). For more information, see here .

Some day ACPI will work, I am told, for suspend and resume. However, currently ACPI and APM should be viewed as alternatives, and ACPI doesn't do all we need.

If you want your wireless ethernet card to suspend/resume, and you used my method to install the linux-wlan drivers, you will need some horrible hack in your apm event.d directory like this .

Installing X-Windows

This was somewhat painful.

The video card you need support for is the S3 SuperSavage IX/MX. Note I wrote 'SuperSavage' not 'Savage'. There is an S3 driver page here, which tells us that they do not support SuperSavage chipsets, but that the good folks at S3 are now producing the drivers. But if you visit the S3 driver page here , you will find no Linux SuperSavage drivers (or at least not the source). S3 used to publish one, and the source, but it seems to have disappeared from the web site (it's alleged it's now returned though I haven't been to check). Fortunately, it was GPL'd, and Craig Harmer ,  took a copy of it, modified the source a bit, and compiled it up for XFree86 4.1.0; you can find the results of his labour, and a few additions by me, here . Debian 'Woody' comes with XFree86-4.1.0.1, and you will find a symbol clash problem if you try and load Craig's driver. So I hexedit'ed the .o file and have included that in the .tgz file.

Craig has since updated at least the Readme file for his driver package, which contains lots of other useful information. You can find a text copy here .

Steve Hill tells me that the new drivers from Tim Roberts, here , now contain initial SuperSavage support, from drop 1.1.20t. I haven't yet tried this. But it looks nicer than hexediting stuff. Since been confirmed by Manoj Kasichainula , who says he should know as he contributed some of the patches (but credits Tim Roberts for rejigging the memory detection routines and helping with insights that made the resulting driver much better); guess I ought to get around to trying this.

Upgrading from the Debian Potato XFree-86 3.x.x to Debian Woody's XFree86-4.1.0.1 worked, but required, it seems, downloading most of Debian Woody. Had I known this to start off with, I'd have done a Debian Woody installation from the start. Saying that, although this was time consuming, it was relatively painless.

Debian Woody has just added a savage driver; unfortunately it doesn't currently support SuperSavage, so you will have to rename the driver and use one of the above methods.

Developing a working XF86Config-4 file was a pain, and I failed. I took a shortcut and asked Craig for his. I modified it to support mouse data from gpm, i.e. the console mouse driver, and you can find the result as XF86Config-4 in the above archive. The mouse is unreliable if you try and use PS/2 mouse support (or indeed as far as I can tell any X-Windows native driver) and you can't seem to get 3 button support. The disadvantage of using gpm is that vmware does not like the intellimouse output that gpm provides by default. Note that gpm can output its data in many formats (as per command line options), and one can alter XF86Config-4 appropriately to handle these formats. To do this, alter gpm.conf (by running gpmconfig under debian) or otherwise change the way gpm is invoked and change the repeater type, to, I suggest 'MouseSystems'; similarly change the protocol type for the mouse in XFree86Config-4 to 'mousesystems '. VMWare has a full-screen driver for this mouse, it would appear.

It is alleged, but not tested, that mouse problems are all fixed if you upgrade your BIOS . However, I'm still happier running things through gpm.

Configuring Dual Booting

This worked first time with lilo - boots the (newly shrunk) Windows 2000 partition fine, however, it won't boot in safe mode unless you fix your partitions first.

Configuring Dual boot under VMWare

I am using VMWare 3.0 release to boot Windows 2000.

Compulosary reading material on installing this software is published by VMWare here , if you want to dual boot your machine. Note you will probably want to delete the bottom line (with C:\= if it's still there), as this generates the unlabeled 'Microsoft Windows' option on boot, which goes and reinstalls over your harddrive without warning if you select it. I learnt the hard way.

Firstly, on release VMWare (not some of the beta releases), your machine will run the memory check etc., but appear to freeze afterwards. Actually it is working, but very very very slowly (like it will take more than an hour to boot the first screen). So boot up in VMWare, press F2 to enter the (virtual) BIOS, and select the primary hard drive. Using the +/- keys (it's the '-' key you want), change the type of the HD to 'User'. Now select UDMA mode disabled, and set transfer mode to standard. Press F10 for save and exit. It should now boot at least to your boot menu. Thanks to Dirk Jennerjahn for this tip.

The next issue you will run up against is that the Windows 2000 installation is set up for a machine with ACPI on. Though your T23 has ACPI, the virtual machine which VMWare boots does not support ACPI. Thus the O/S will not load. VMWare fully explains how to work around this in the section on ACPI in the above document.

Now fixing this causes the machine to boot a bit further. However, if you didn't follow my advice on fixing your partitions , here it stops with an INACCESSIBLE_BOOT_DEVICE blue screen of death. The newsgroups seem to have people who have tried to do the same fix and ended up with the same problem.

Now, assuming you fixed the above, you will still get a blue screen of death (same one), but a bit further on. The problem is that the whizzy IBM IDE controller doesn't work with the virtual hardware supplied. So do the following (provided Dirk Jennerjahn ), carefully:
  1. If you haven't already done so, boot natively into Windows 2000, and follow the instructions on the VMWare site to create a duplicate hardware profile
  2. Reboot natively into Windows 2000, selecting the normal OS image (not the ACPI disabled version), but select the VMWare hardware profile
  3. Start the Device manager and locate the IDE Controller (i.e. the thing starting 'IBM...' under the IDE controllers category) object then edit its properties by right clicking on it and selecting properties.
  4. Select the driver tab and then select the "update driver" button.
  5. Click Next then select the "Display a list of the known drivers ..." option then click next. 
  6. Select a Standard Dual channel PCI IDE controller instead of the driver that matches your physical IDE controller then click next then next again.
  7. Click "finish" then "Close".
  8. Shutdown when prompted and boot into your Linux host, and start VMWare and power it on.
  9. Select the ACPI disabled config, then select the VMWare profile when prompted
This should boot Windows 2000 suffiiciently far for you to install the native drivers for VMWare.

Other Useful Resources

LinuxCare has an IBM T23 certification page here . This tells you how to get things working on stock Caldera Open Linux 3.1, Redhat 7.1 & 7.2, and TurboLinux 6.1. I have not tried everything that's there. However, I note from some things (like the network driver, and the screen resolution), that their T23 seems to differ from my T23.

Conclusion

Well, it mostly works. What doesn't work, I am working on.

I intend this to be a living document. If you have anything to contribute, or a link to your own experiences, I would be glad to include it. Please mail me at alex@alex.org.uk.

Credits

Particular thanks to
Anyone who sent me stuff that isn't listed above, or who wants a link to their email address (which I don't put in by default because of spam worries) just drop me a mail.

v0.06 - Fri 11th January, 2002


Home