Linux and a Compaq Evo N160

This page chronicles my experiences with running linux on a Compaq N160 laptop. When deciding on a laptop to purchase, the user reports over at http://linux-laptop.net were very helpful, but unfortunately there didn't appear to be any reports for the N160 (a fairly recent model). Hopefully this page will help others who own an N160 or are thinking of buying one.

Overall the experience has been quite pleasant, and I am currently sitting on my couch typing out this webpage in emacs.

Recent news

Sun 29-Sep-2002

I recently learned that Compaq tech reps are pointing to (among others) this page when people ask linux related questions on the forums. I hope it's useful. I've gone through and updated some of the sections to reflect current progress.

Summary

The laptop

The N160 is one of the "next generation" laptops, where APM and the BIOS have been largely obsoleted. Everything is expected to be controlled by ACPI, which is supposed to make it easier to circumvent badly designed firmware and BIOSes. This certainly sounds attractive, but unfortunately it carries with it the requirements of building an ACPI parser into the kernel, which is complex.

The BIOS on this laptop, for instance, now allows one to change the boot devices, the system time, and that's about it. Everything else is expected to be adjusted via software.

The good

The good news is that a number of features, such as the brightness and external monitor/TV buttons and output appear to have been implemented in firmware. This means that they work fine in linux without any special support.

The bad

The hard drive in this laptop makes weird clicking noises from time to time. I don't think that there's an actual problem with the drive. The sound is like the head of the drive moving to the corner and "parking", and then moving back again. It seems to do this when ever the drive has stopped writing something, so presumably it's to guard against shock (a parked head is far less likely to damage the drive if the laptop is jolted than an unparked one is). Sometimes in the middle of writing data, this also happens, which leads me to believe that even a small break in the write of the data stream is enough to get it to park. It would be nice if this parking was configurable (in my humble opinion, the delay is too short).

I still wonder if this is a problem with my laptop, or just the way the N160s are.

Linux installation

When I received the laptop, it came with a bootstrap version of Windows 2000 on it. Upon turning the laptop on for the first time, Windows began installing and the installation instructed that the computer shouldn't be turned off during this process. When it was complete, I booted into Windows and had a poke around.

After testing some of the essentials such as the DVD, floppy, sound, network, I installed Partition Magic and began to repartition the drive. The Windows install was a VFAT one which made the process easier (though I believe new-ish versions of partition magic can resize NTFS partitions). I turned off suspend support under Windows (which freed up the 256MB state file it keeps around), and removed all the Compaq and Windows files lying around C:, which got the partition down to about 1 gig. I left about 1.5 gig for Windows and left the rest of the 20G drive for Linux.

Installation time

I put a bootable CD of the stable Debian distribution into the DVD drive and began hunting through the provided PDF manual for the laptop for the shortcut key to access the BIOS. Turns out the key is F10, which you need to hit on the initial startup screen when the cursor appears. I discovered the BIOS was already set to check the CDROM first, so rebooted again and let the Debian install start up.

The install went very nicely. I've been through a number of Debian installs before, so I won't comment on the Debian installation process (which I think is just fine). Most of the base hardware was detected. I tend to skip the module configuration stage, as I recompile a kernel afterwards. One complication was that the eepro100 module would not load with the provided 2.2 kernel, which meant I couldn't copy across a 2.4 kernel from one of my other machines by way of the network. I worked around this problem by booting into Windows, copying the image over, and then booting back into Linux to copy it across from the other partition. I used a debian package called "kernel-package" to generate a .deb of the kernel, which meant I could compile it on an existing machine and I wouldn't need the development tools installed on the laptop.

Booting into the new system; XFree86 complications

Later 2.4 kernels now support the minipci eepro100 which is contained in this laptop. After booting into the 2.4 kernel with the network working, I dist-upgraded to the latest unstable version of Debian. Unfortunately the latest version of X in the latest Debian is 4.1.x, which didn't support the video card in this laptop. You can read about the workaround in the X support section.

Individual components support

ACPI

By far the most important feature I needed was battery status, and this is working in kernel 2.5.7 and 2.4.19 with the latest ACPI patches (available here - I'm using 20020918.) The ACPI patches have not booted on this laptop without kernel paramaters since about 20020404. To get your machine to boot after patching your kernel, pass the parameter "pci=noacpi".

The ACPI developers have basically said there is little hope of getting proper suspend-to-disk or suspend-to-ram support in the 2.4.x kernel series. This is what I currently run, however, because stability is more important to me than being able to suspend the laptop. The swsup project (suspend to swap) looks like a promising alternative.

Using python I wrote a little program to display the current battery status level on an "on screen display" at the touch of a button. It's available in the latest pyosd release on this website.

I have not tested limit support with any recent ACPI patch, so I do not know if it is supported yet. My N160 is a celeron, so it doesn't support speedstep. I get a fairly respectable 3hrs something battery life with the screen brightness down and no power management options, so I'm not troubled.

Detection of the various switches like the power, sleep and lid switch are handled well by the current ACPI code, so you can trigger arbitrary programs to run when these buttons change state. This laptop came with some extra buttons, some of which I haven't been able to get working yet. The two volume buttons have their own keycodes and thus can be detected like normal keystrokes. I use a similar setup for the volume keys as the battery meter mentioned above. The other buttons however don't appear to have any keycodes associated with them, so it's a mystery on how they're actually read from. The reason I mentioned them in this section is I suspect ACPI may be used to read them.

X support

The Radeon Mobility M6 in this laptop is supported in Xfree86 4.2 (and 4.1.99, I think). Since the latest Debian doesn't have the the 4.2 XFree86 packages, you need to use the following line in your /etc/apt/sources.list file:

deb http://wuarchive.wustl.edu/users/tom/x4.2 sid/$(ARCH)/

Non-debian users will need to compile the package from source if their vendor hasn't provided a 4.2 release. This isn't very hard, and I had to do this before the Debian packages became available.

The touchpad is detected fine when specified as a standard PS/2 mouse. If I have a USB mouse plugged in to the laptop before starting X, I can use that instead of the touchpad with no extra setup required. I haven't attempted to hotswap the USB mouse yet.

Sound

Sound works well. The soundcard is supported by the i810_audio drivers in the standard 2.4 kernel. I use the alsa drivers these days because the OSS drivers wouldn't play back sounds in bitrates other than 44100khz.

USB

I've only tested a USB mouse so far, but that worked fine.

PCMCIA

I use the lone PCMCIA slot that comes with this laptop for wireless around the house. I am using the latest linux-wlan drivers, coupled with the 2.4.x kernel PCMCIA drivers. No complications.

Touchpad/GPM

The Touchpad's basic features work well in X - I can tap to click and click and drag (holding down your finger when you hit the edge of the pad will cause it to continue to scroll). The extra features like scrolling edges and the 4-way scrollbar aren't supported by X, however.

GPM has some more sophisticated support for these synaptics touchpads, and I've read a number of success stories. There seems to be some troubles with it on my machine, however - the cursor will appear for a while and then disappear, repeating this in a cycle of about ten seconds. Sometimes it's completely erratic and after trying a few times, I generally have to reboot to get it working again (since the mouse has been left in a bad state, and the reboot resets it). If anyone has had any luck using GPM on an N160, please drop me a line!

The instructions I was following came from this page.

Ethernet

The internal ethernet on this laptop performs very well. I made one tweak which makes the card behave better when under heavy load. The information came from a page, and is copied verbatim for your convenience:

Download the file eepro100-diag.c from Donald Becker's website. Compile it up as per the instructions at the end of the file. As root, probe the card using the binary eepro100-diag, with the command;

# ./eepro100-diag -p 0x3000 -ee -f

You should find the word at offset 0x0A is 0x49b2, and that the diagnostic tool complains that the PHY is in sleep mode. You need to rewrite the EEPROM to turn sleep mode off - this is achieved by doing the following;

# ./eepro100-diag -p 0x3000 -ee -f -G 0 -w -w

Screen/TV

I tested these over the weekend and I'm glad to say they're working quite well, too! The various video states (laptop, monitor, both) are altered by hitting Fn + F3. A TV plugged into the svideo output can be used in the same manner as a monitor plugged into the monitor out. As to be expected, text is barely legible on a TV, but movies turn out quite well.


Back to the Homepage.
Damien Elmes - web@repose.cx