[ Think Pad R40 ][ Previous | Next ]
Linux - RedHat 9
Updated 2004.11.05
The original installation was RedHat Linux 8.0. The stock 8.0 kernel (2.4.18-14) had severe problems with the IDE chipset of this R40. It failed to boot, and halted with this message:
PCI_IDE: unknown IDE controller on PCI bus 00 device f9, VID=8086, DID=24cb
PCI: Device 00:1f.1 not available because of resource collisions
PCI_IDE: (ide_setup_pci_device:) Could not enable device.
An updated kernel (2.4.20-13.8) resolved that issue. IIRC, the process was to download the newer kernel RPM and all associated RPMs (source, etc) to my scratch FAT32 partition, boot the install CD in rescue mode, chroot /mnt/sysimage, and install the new RPMs with rpm.
Problems with apps like cdrecord were solved by upgrading to RedHat 9 - but keeping the 2.4.20-13.8 kernel, which was more recent than that provided with stock RH 9.
I wanted to try the speed-step capabilities of the cpufreq patch and figured this was a good time to step up to a newer kernel - 2.4.25. In the interest of a clean start, I did a fresh install of RH 9, and proceded from there. This write-up is a description of that process - with a few references to the original installation left in for googlers.
Thanks to Harald Hannelius and Robert Svoboda for tips on CPU frequency scaling working and Bill Giannikos for his soft-modem wisdom.
Knoppix
Knoppix is CD based Linux. With it you can boot and run Linux without installing to HD. Very handy to test Linux on your laptop before an installation, or as a rescue CD. Here is the description from their website:
"KNOPPIX is a bootable CD with a collection of GNU/Linux software, automatic hardware detection, and support for many graphics cards, sound cards, SCSI and USB devices and other peripherals. KNOPPIX can be used as a Linux demo, educational CD, rescue system, or adapted and used as a platform for commercial software product demos. It is not necessary to install anything on a hard disk. Due to on-the-fly decompression, the CD can have up to 2 GB of executable software installed on it."
Version KNOPPIX_V3.2-2003-04-18-EN.iso (kernel 2.4.20-xfs/XFree86 4.3.0) downloaded and burned with Nero on win2k booted and ran just fine on the R40. Very cool.
Take a KNOPPIX CD with you to your favorite computer retailer to test Linux on prospective machines.
KNOPPIX might also be handy if you don't intend to install a separate boot loader/partition manager. Boot a KNOPPIX CD, and use nparted and maybe ntfsresize to prepare your install partition(s).
Preparation
CD isos
Downloaded 3 CD isos of RedHat Linux 8.0 and later 9.0 from RedHat. Burned using Nero in win2k.
BIOS
Didn't fiddle the BIOS at all prior to install. Left acpi, plug-and-play and everything else in its default configuration.
Partitioning
Warning: I have used and recommended System Commander for years. However, I cannot recommend their SC8 version. Installing it on my R40 garbled the HD sufficiently that Win2K would no longer boot. After discussing it with their support people, I tried a fresh install rather than an update. That too damaged the HD. In the end, I went back to SC7 and had to do a total Win2k re-installation. On top of that, support was very slow to respond, and so far they have refused to refund the purchase price because I took too long to ask - since I waited for their support to reply! Very sad.
Since Solaris uses the same ID as Linux swap (82) I ran win98>scin to change the ID to 99 to hide it from the Linux install. Otherwise, the Linux install might/would format the Solaris partition as swap space. I used System Commander 7 to create a 6GByte Linux partition, 100Mbyte boot partition, and 512Mbyte swap partition. After the Linux install, I changed the Solaris ID back to 82. Here are the partition tables as reported by (DOS) scout and Linux fdisk.
See warning below.
See KNOPPIX, above for another approach to partitioning.
Installation
Warning: the initial RedHat 8.0 install modified the C,H,S values in the partition tables. I was able to manually repair using the saved scout.txt file, but win2k had been terminally damaged. I have no idea why this happened, or if it is likely to happen to anyone else. The fresh RedHat 9 install also diddled the C,H,S values. I don't know if this would have tweaked win2k again, but I made sure to repair the partition tables (by booting to DOS and running SCIN) before trying to boot into win2k.
Update 2005.01.19: I may have finally figured this out. See partitioning notes.
Since SC7 is my overall boot manager, I had the RH install put the Grub bootloader in the Linux /boot partition, not in the HD's MBR.
The original install was RedHat 8.0 (kernel 2.4.18-14). Booted from CD 1 and did a full install. The RH 8.0 install seemed to go fine, but would not boot. Boot halted with this message:
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PCI_IDE: unknown IDE controller on PCI bus 00 device f9, VID=8086, DID=24cb
PCI: Device 00:1f.1 not available because of resource collisions
PCI_IDE: (ide_setup_pci_device:) Could not enable device.
RedHat's 2.4.20-13.8 kernel update solved that problem. I had to boot CD 1 to rescue mode, chroot to /mnt/sysimage. I then used rpm to install the new kernel.
Now it boots, and most things run, but cdrecord hangs the system with a blinking caps lock led. An upgrade to RedHat 9 got that working.
Note: even when running on AC, the screen may blank during installation. Hitting a key may or may not restore a usable screen. Hitting Fn-F7 (monitor select) a couple of times should restore the screen to a usable state.
So much for the original install.
This latest effort was a clean install of RedHat 9, using the same partitions as the previous install. The fresh RedHat 9 install also diddled the C,H,S valueagain - see above. Things basically worked after the RH 9 install, but the HD default mode wasn't DMA, and attempting to set DMA mode failed. Upgrading to the latest available RH9 kernel fixed that: kernel-2.4.20-30.9.rpm, kernel-2.4.20-30.9.src.rpm, kernel-source-2.4.20-30.9.rpm.
New Kernel Build
With the updated kernel working, I proceded to download a new "vanilla" 2.4.25 kenel from www.kernel.org, and the cpufreq-LINUX_2_4-20040322 patch from ftp.linux.org.uk.
For simplicity's sake I used the existing RH9 (updated) configuration as a base when building the new kernel. There were a few additions to the config to support cpufreq. I should probably have done a full config to carve out a lot of stuff (modules, mostly) that I don't need -- maybe another day. I also had to patch yenta.c (with this patch) to back out changes made for 2.4.25 that break kernel cardbus support on my R40 and cause this in the log:
cs: socket d603e000 voltage interrogation timed out
Proceding with the patched build:
cd /usr/src/
tar -xjf <path to linux-2.4.25.tar.bz2>
cd linux-2.4.20-30.9
make oldconfig
cp .config ../linux-2.4.25
cd <path to cpufreq patch dir>
./patchin.sh /usr/src/linux-2.4.25
cd /usr/src/linux-2.4.25
patch -p0 <path to yenta patch>
make oldconfig - enable freq tables, user control, and centrino cpu
make dep
make bzImage
make modules
make modules_install
make install
"make install" attempts to copy the appropriate stuff to /boot, and update grub.conf. It worked fine for me - YMMV. For the record, here is the build .config file.
General Configuration
Since I wanted to be able to mount the win98se, win2k, and "scratch" FAT32 partitions, I modified /etc/fstab to make that easier. Also added entries to allow quick mount of usb floppy and usb jump drive. It now looks like this: fstab. I automount the scratch logical partition, which gets shared by all the OSs, and leave the winxx partitions and usb stuff unmounted unless I need them.
For general information purposes, here are the dmesg boot log, grub.conf, and modules.conf. Hard drive default configuration as reported by hdparm: hdparm report.
What works
Graphics
This got a little complicated. The install recognized the ATI Radeon Mobility 7500 and configures XFree86 4.3.0 to use the "radeon" driver, which works fine in normal use. However - it has some severe problems with apm. After a timed screen blank and "un-blank", the display is garbled. Hitting Fn-F7 (monitor select) a couple of times fixes it. After a suspend to RAM and restore, the display is OK. After a suspend to HD and restore, either by keystroke or low battery condition, the display is garbled, and the keyboard is unresponsive. Fn-F7 does not fix either the display or the keyboard.
Originally,I edited /etc/X11/XF86Config to use the "vesa" driver. This fixes all the above issues, but (presumably) at some loss of performance. Here is my edited XF86Config. Unfortunately, Mplayer requires the accelerated driver to play DVDs. Kind of a pain to edit XF86Config every time I need to change, so I made /etc/X11/XF86Config into a link to either a vesa or radeon version. My simple xselect script allows setting the link to either file. It also has a "default" setting that is called at boot time by my /etc/rc.d/rc.local script to make sure it is in vesa mode.
To switch to the radeon driver:
/sbin/xselect radeon
and log out and back in.
Resume from standby may leave the LCD at partial brightness. Adjust with Fn-HOME and Fn-END. Also see APM/ACPI below.
Pointing Devices
UltraNav TrackPoint and touch pad both work (at same time). Usb mouse works. If X is running the first time the usb mouse is plugged in, it isn't immediately recognized. Reboot (or restart X?) and plug it in again. After that it will be recognized. UltraNav and usb mouse will work at the same time.
Network
Bult in Intel Pro100 VE NIC works. Here is my /etc/sysconfig/network-scripts/ifcfg-eth0.
WiFi
Thanks to Werner Heuser of tuxmobil.org for a link to ndiswrapper! This open "wrapper" allows using the Windows XP (not 2K- it causes loaddriver errors) Intel Pro2100 Centrino wifi driver with linux. I downloaded version 0.3, built, and ran it and in just a few minutes had wifi up and running!
Download (if you don't already have it) the XP Centrino wifi driver from the IBM software and driver matrix. It will be necessary to run this .exe file somewhere to extract the files (I haven't searched IBM to see if the discrete files are available). Grab the w70n51.sys and w70n51.inf files and put them somewhere in the ndiswrapper directory. There may also be a link from the ndiswrapper page to a suitable XP driver.
Download ndiswrapper from http://ndiswrapper.sourceforge.net and build and install per README.
I am currently running 0.6+CVS. It seems to work OK, but did produce these warnings during the install:
[root@littleblue utils]# ./ndiswrapper -i x70n51.inf
Installing w70n51
Malformed UTF-8 character (unexpected end of string) at ./ndiswrapper line 938, <INF> line 499.
Warning: Cannot locate w70n5msg.dll
....
Warning: Cannot locate w70n5msg.dll
The default install creates device wlan0 aliased to ndiswrapper in /etc/modules.conf. The RedHat network configuration tool "neat" or redhat-config-network expects things to be named eth0,1,etc - including wifi NICs, so I built my /etc/sysconfig/network-scripts/ifcfg-wlan0 file by hand.
Note: I live out of radio range of anyone else so I haven't bothered to secure my wlan. You [should|will have to] add appropriate essid and key entries to this file!
The RedHat network startup script loads all drivers for all interfaces in /etc/sysconfig/network-scripts (all those with an ifcfg-xxx file) even if those interfaces are not enabled at boot time with an ONBOOT=yes entry. This is (apparently) to preserve the order in which interfaces and drivers are associated. This has the side effect of turning on my radio - even though wlan0 is not "up". My normal situation is wired via eth0. Ndiswrapper documentation says that "/sbin/iwconfig wlan0 txpower off" should turn off the radio, but it didn't. I thought that it might be due to a mismatch between wireless tools and ndiswrapper since iwconfig was warning that they were compiled with different versions of the kernel wireless extensions:
Warning: Driver for device wlan0 has been compiled with version 16
of Wireless Extension, while this program is using version 15.
Some things may be broken...
I downloaded and built the latest of Jean Tourrilhes' wireless tools. Unfortunately, that didn't change the behavior. I only mention it here because I noted that the default tool build doesn't seem to pick up the correct kernel source in a RedHat environment. When building the tools, use:
make KERNEL_SRC=/lib/modules/`uname -r`/build
You will also find that the default install is into /usr/local/... so if you don't either change the default, change your path, or move the new tools into /sbin, you will end up using the old ones anyway.
In the interest of battery life, I put a line in rc.local to just unload the driver at the end of the boot sequence. When I want to use wifi - or the modem - I launch a simple script that shuts down whatever else is up, unloads ndiswrapper if loaded (to quiet the radio), and "ups" the desired interface. Doing it this way also takes care of the default route. Since I was trying to do a brain-dead profile implementation somewhat like "neat" I called this one "tidy." (Sorry about that :) ... and another thing - I know I'm a crappy coder ... so send me a decent version ). You can invoke tidy with any interface in /etc/sysconfig/network-scripts, or with "modem":
/sbin/tidy wlan0, /sbin/tidy modem, /sbin/tidy eth0 ...
Linuxant claims to have a wrapper for the windows driver that will allow use of the Intel Pro/Wireless 2100 Centrino WiFi module with Linux. I haven't tried it yet - too cheap to pay the $19.95US. Here is their press release. Maybe someone will let me know if this really works.
After a couple of flip-flops Intel now says:
"A Linux* driver for the Intel® PRO/Wireless 2100 Network Connection is currently under development."
In fact, they seem to actually be doing it. See ipw2100.
Bonus Info: Harald Hannelius asked that I include a pointer for people using the Atheros 802.11 a/b or 802.11 a/b/g WLAN-card to the webside http://sourceforge.net/projects/madwifi, which I am happy to do. He also says that when compiling the so called madwifi-driver one should use the following command to get the LED working:
export COPTS=-DSOFTLED ; make
Modem
Thanks to information on Bill Giannikos' Linux on Toshiba Tecra S1 web page, I have gotten the AMR modem working. Here is a snip from his page:
To get it to work download the slmdm-2.7.10.tar.gz drivers. Next unpack these drivers (tar xzvf slmdm-2.7.10.tar.gz) and edit the file amrmo_init.c with your favourite editor. Go down to line 75 and change the value at the end of this line from 0x2486 to 0x24C6 (yes, it should look like the line below it). You can then follow the instruction in the README file to install the driver.
Note: Don't use the slmdm-2.7.14 drivers. These may seem to install properly but when it goes to dial out it dials the WRONG number (in fact it dials more numbers than it should).
Per the README instructions I also edited the Makefile to point at the kernel include files on my system.
KERNEL_INCLUDES:=/lib/modules/`uname -r`/build/include
It worked like a charm for me! I can hook up at 52K via my Worldnet dialup account. There are some log messages - in addition to the usual "tainted kernel" messages caused by loading a non-GPL driver:
This driver is not compatible with the installed modem codec.
Please contact your modem provider for support.
but they seem to be harmless. One could presumably hack the source to make them go away.
I used the kppp dialer to manage my dialup connection. It was easy to configure using the instructions on the WURD's dialer page. I did have a problem until I realized it was necessary to disable eth0 to allow kppp to set up the dialup connection as the default route. I use my "tidy" script to switch from ethernet and start dialup:
/sbin/tidy modem
The modem dialing sequence wasn't audible at first - see sound, below.
Sound
Works. However, with 2.4.25 (maybe w/stock RedHat 9 as well - I didn't test it) neither the modem or CD player produced sound until the volume control applet was opened. It wasn't necessary to change any volume settings, it was enough to just open it. This was true after each reboot. Apparently the sound module wasn't getting loaded automatically, so I hacked /etc/rc.d/rc.local to load it at boot time.
IEEE 1394
May work. A Sony camcorder plug-in is recognized. I haven't found an application with which to test. dvgrab fails, but I haven't pursued this since I know squat about it. I find this message in the log:
"ieee1394: SelfID completion called outside of bus reset!"
USB
Usb works, as tested with a usb floppy drive with a pc-formatted floppy installed. In order to get the drive recognized:
#mkdir /mnt/usbfd
#mount -t auto /dev/sda /mnt/usbfd
Also works with Lexar jumpdrive:
#mkdir /mnt/usbjump
#mount /dev/sda1 /mnt/usbjump
With modified /etc/fstab, just
#mount /mnt/usbfd
or
#mount /mnt/usbjump
IrDA
Untested
CD burning
cdrecord 2.0 and nautilus-cd-burn both work. cdrecord defaults to "burn free" off and doesn't take advantage of most modern burner's overrun protection (why???). To use burn free, a cdrecord command looks like:
cdrecord dev=0,0,0 speed=24 driveropts=burnfree <path to iso to be burned>
Note that cdrecord is fed an iso to be burned, not normal files or directories. Those must be processed into an iso first with something like:
mkisofs -J -R -l -o <name of iso to create> <path to files to be burned>
You can mount the created iso to check it prior to burning with:
mount <path to iso> -r -t iso9660 -o loop <your mount point>
This laptop is fast enough (and has a "burn free" burner) so you can pipeline the operations:
mkisofs -J -R -l -x ".*" <path to files to be burned> | cdrecord dev=0,0,0 speed=24 driveropts=burnfree -
The -x ".*" omits "invisible" files. Don't forget the "-" at the end.
DVD playing
mplayer 0.92.1 works. It requires using the radeon driver rather than the vesa frame buffer driver. See Graphics, above. It is also necessary to create a link from /dev/dvd to /dev/cdrom. I downloaded the basic player, a skin, and a font from www.mplayerhq.hu and built per instructions. Rpms are available, but as of this writing, all versions that I could find had a known security hole. See the home page (above) for details.
APM/ACPI (and X)
As nearly as I can tell, the RedHat 9.0 kernel doesn't support acpi. My impression is that acpi in Linux is not fully implemented yet, so I let the R40 run in apm mode. I had previously created a hibernate file in the C: FAT32 partition (C:\save2dsk.bin, /dev/hda1/save2dsk.bin) with an IBM utility program since I had DOS/Winxx available (see Windows 98SE). If you don't, use fdisk to create a FAT32 partition, and use Andrew Tridgell's tphdisk utility to create the hybernation file.
Basically, apm works just fine with the vesa X driver - with the exception of timed suspend. Standby and suspend can be done with function keys or apm commands. All other apm functions are via function keys.
These were all tested using the XFree86 4.3.0 vesa driver. See Graphics above.
Standby (LCD off) (Fn-F3 or apm -S) works.
LCD brightness up/down (Fn-HOME, Fn-END) works.
Monitor out select (Fn-F7) (probably) works.
Suspend to RAM (Fn-F4 or apm -s) works.
Suspend to disk (hibernate) (Fn-F12) works.
Timed disk spin down and LCD standby work.
Low battery suspend to disk (hibernate) works.
Timed suspend to RAM or disk does not work - just doesn't happen. (anybody
who knows how to make this work - please let me know!)
tuxmobil.org has a Linux on Centrino Laptops page that addresses ACPI and other issues.
CPU Frequency scaling (speedstep)
Frequency scaling works with 2.4.25 and the cpufreq patch. A daemon is necessary to interact with the cpufreq features of the kernel. I tested with cpufreqd. There are other possibilities, including cpudyne and powernowd.
The default cpufreqd build installs to /usr/local/etc and bin, so I linked cpufreqd and cpufreqd.conf to /sbin and /etc, respectively. Since I'm using APM, I also edited cpufreqd.conf to specify APM. Now I can see the CPU clock change in /proc/cpuinfo when switching from AC to battery operation. I haven't yet tested anything beyond that.
The simple way to launch the daemon would be to start it in rc.local, but for the experience, I used a Sys V init script instead. I put my cpufreqd script in /etc/rc.d/init.d and did:
/sbin/chkconfig --add cpufreqd
(You could also make your own links to the cpufreqd script from the appropriate run levels.) Then redhat-config-services can be used to start/stop/enable/disable the daemon, or it can be done manually with chkconfig or /sbin/service cpufreqd <desired operation>
PCMCIA
Works as tested with Netgear FA511A NIC.
Note: 2.4.25 yenta.c must be patched before the kernel build, and the pcmcia script must be patched afterward. The RedHat pcmcia script attempts to modprobe pcmcia_core.o, yenta.o, and ds.o (it shouldn't append the ".o"s to the module names) and fails with messages like:
modprobe: Can't locate module pcmcia_core.o
Performance
No formal testing done beyond the simple hdparm stuff. Default IDE DMA mode seems to be udma5. Boots pretty quickly. Haven't tried building a kernel yet. Hdparm test results:
#hdparm -tT /dev/hda
(on AC - maximum cpu clock rate)
Timing buffer-cache reads: 128 MB in 0.29 seconds =441.38 MB/sec
Timing buffered disk reads: 64 MB in 3.22 seconds = 19.88 MB/sec
(on battery - lowest cpu clock rate)
Timing buffer-cache reads: 128 MB in 1.53 seconds = 83.66 MB/sec
Timing buffered disk reads: 64 MB in 3.26 seconds = 19.63 MB/sec
Battery Life
Untested. I've been too busy installing all this stuff to actually use any of it
[ Think Pad R40 ][ Previous | Next ]