Debian on the HP nc4000

These are my notes regarding making Debian GNU/Linux work on the HP nc4000 notebook PC.

Please note that, despite my day job as HP Linux CTO, these notes do not represent any form of official support from HP for this combination of hardware and operating system. If that matters to you, please go troll around starting here and you should be able to find the matrices of officially supported Linux solutions from HP.


Still here? Cool...

I bought the nc4000 to replace an HP Omnibook 500 that was finally starting to fall apart after about a quarter-million flight miles over a couple years of nearly continuous use. I'm not abusive, but I use my primary machines hard, and my notebook is my primary machine these days. The things that excited me about the nc4000 were the CPU speed, built in wireless and gigabit Ethernet, USB 2.0, and keeping about the same form factor. The things that I dislike are the lack of three mouse buttons, the presence of the "scratch'n'sniff" thingy (I prefer the pointing stick), and my assumption that with so many new interfaces in the machine that it'd be a challenge to get everything working.

The nc4000 is my main machine now, and I'm pretty happy with it.

Other nc4000 owners with web pages you may want to read include Martin Michlmayr, another former Debian Project Leader, and Bob Proulx.

Scott James Remnant has a web page describing his slightly newer nc4010 which may also be of interest.

HP has various manuals available online, the "Maintenance and Service Guide" which you can find by searching at www.hp.com has lots of useful information.

What I Bought

From HP, I ordered the following pieces:
         DG987A#ABA      1.6-GHz,512mb,40gb,wireless CNC4000UP160X240NGD51P
         269087-B25      512-MB 266-MHz DDR Memory Upgrade
         DC373A#ABA      External MultiBay
         269089-B25      24X Combo DVD/CD-RW
         DD880A          6 cell Travel Battery
  qty 2  265602-001      AC Adapter 65W
         291370-B25      DC Air/Auto Power Cable
Because I wanted more than 40G of disk (more disk is almost always better!), I went to newegg and bought a Hitachi 80Gb 4200rpm notebook disk. Installing this disk was harder than it needed to be, because the screws holding the 40G drive into the "sled" were of two types. One type is a T5 Torx that I didn't have a driver for, so I used a Dremel tool with a cutoff wheel to grind slots in the heads of those two screws so I could get them out, then used new screws to install the new drive. So far, I'm very happy with the results.

Initial Install

Because the parts showed up at different times, and the external multibay to house the DVD/CD-RW drive was the last piece to arrive, I got impatient and figured out how to network boot the machine. I didn't save the URL, but it was trivial to find a Debian PXE boot howto on the net. The only trick was that they suggested installing tftpd-hpa instead of the standard tftpd. I don't know if that is really necessary, I just did it and it worked. Once I had the machine network booting, I did a woody base install, then pulled over a kernel image .deb built on another machine with the right drivers and installed it before doing the first reboot. I had to try that a couple of times until I had the kernel config right... but once I could reboot on a base system with a working network interface, the rest was easy to load.

That sounds lame, but I didn't keep notes and nothing seemed very hard to me. Fortunately, Joey Hess points out that there are instructions for setting up to PXE boot in the debian-installer wiki! Starting with a recent debian-installer image and installing one of my kernel packages is probably the fastest path to happiness now.

Kernel

I chose to start with 2.6.0-test*. So far, this has been a good choice. It took me a few iterations to figure out things like the Pentium-M CPU really needing the kernel speedstep support enabled to function well. I'm running released 2.6.5 now: No pretense about these being perfect, it's just what I'm running right now. If you figure out more or have a better config, please feel free to share it! I try to remember to manually update these files every time I build a new kernel.

What Works

I have enough working to make the machine useful to me... but there's still work to do.

Graphics

I'm using X 4.3.0 from Debian unstable with the radeon driver. I've got good quality XGA on the internal LCD. The VGA output seems to work fine, I've given several presentations using modern projectors without problems, though I had trouble with a projector in Bangalore that many other people had trouble with too... I haven't tried the svideo output, but I've had a report by email from another nc4000 user that it works fine for him with an svideo to NTSC adapter.

I chose to install GNOME V2.4. I'm still getting used to all this new-fangled desktop nonsense... but it seems to work. ;-)

Gigabit Ethernet

The tg3 driver in 2.6 kernels supports the internal NIC. Recent Debian standard kernels have removed this driver along with several others that have firmware licensing issues. Either build a kernel yourself or download one of mine.

Sound

The 2.6 ALSA driver snd_ali5451 works. The packages alsa-base and alsa-utils in Debian unstable provide the user space ALSA utilities needed to make it all work. Remember that ALSA has output disabled by default, you need to use a mixer to un-mute the output before you'll hear anything. Using the Debian option offered during package installation to save mixer settings across reboots works for me... and the volume control on the GNOME panel works fine (including the all-important mute!) once I set the GNOME preference to enable a sound server at startup.

PCMCIA

The yenta_socket driver in 2.6 works with and the rest provided by pcmcia-cs-3.2.7. I've tried a Xircom 10baseT card, a Xircom modem card, and the Fuji adapter card for my camera's smedia cards... all work as expected.

Internal 802.11

The built-in WIFI card is based on an Atheros 5212, which supports 802.11A/B/G. Some nc4000 models ship without the A support, but all appear to use chips from the same Atheros series. I have an oldish 802.11B hub at home (a very early Apple Airport) that the nc4000 talks to quite happily, and I've had good luck with wifi service in airports, hotels, and at conferences since I picked up this machine.

The driver I'm using is madwifi, which is based on a proprietary HAL module wrapped by sourcecode that interfaces with the kernel. I'd be much happier with a GPL'ed driver, but there isn't one that supports this particular chip yet. In order to build madwifi, I had to make a couple of changes in my kernel builds:

Building the madwifi driver was as easy as running 'make' and 'sudo make install'. I then added 'ath_pci' to /etc/modules, and updated /etc/network/interfaces to contain
 
	auto ath0
	iface ath0 inet dhcp
Seems to work fine, except that I couldn't manually set an ESSID with the released version I tried first. On advice from Martin Michlmayr, I moved to the latest version in CVS and the problem is solved. Now, when I build new kernels, I freshen to latest madwifi CVS and rebuild the driver modules and so far they've always worked.

USB 2.0

I've used the external multibay adapter with the DVD/CD-RW drive in it to read several disks, and it works fine. I didn't do anything special, the Debian 'hotplug' package just works.

I haven't tried writing a CD yet, but have no reason to expect it won't work.

Battery Life

Using 2.6.0-test9 with the performance cpufreq governor in the kernel, which apparently just sets the CPU to maximum speed statically, I was able to get about 4.5 hours of runtime out of the two batteries (internal and travel) with the machine mostly idle and the screen backlight at minimum. While this isn't hideous, it isn't what I'd hoped for, and so I investigated the various cpufreq governors.

There are various daemons that work as clients to the userspace governor support in the kernel. Of the ones I investigated, powernowd is the one I like the best. It's a simple C program that uses only the sysfs interface (no APM or ACPI support needed), and it seems to do exactly what I want, which is to keep the CPU running as efficiently as possible, yet give me full speed quickly when a workload demands it.

Since powernowd was not yet packaged for Debian, I've packaged it and uploaded it to the archive. The archive admins accepted the package on 9 November 2003, but a copy of the binary package is available for download here for your convenience. To use this, you need either my kernel or another that has

  CONFIG_CPU_FREQ_GOV_USERSPACE 
enabled. You also need to have the sysfs filesystem support enabled, and sysfs mounted. My /etc/fstab entry looks like
  sysfs /sys sysfs defaults 0 0
Then, all you need to do is install the powernowd package, and the provided init.d script will launch it immediately and then on every boot. Seems to work well for me, though I haven't done any battery timings with it running yet.

Internal Modem

The internal modem seems to work fine with this beta driver from smlink.com. I've crafted a script that does the following to set up the modem:
modprobe slamr
/usr/sbin/slmodemd --country=USA --group=dialout /dev/slamr0 &
ln -sf /dev/pts/4 /dev/modem
With that in place, my ppp config is happy (I'm typing this text while ssh'ed over the internal modem to Earthlink!). To shut things down, I just:
rm -f /dev/modem
killall slmodemd
rmmod slamr

ACPI BIOS support

A new BIOS version released in April 2004, F.26, apparently fixes the problems we had in prior versions. I haven't played with this a lot yet, though.

What Doesn't Work Yet

Well, more honestly, this is mostly just a list of the things I haven't tried yet, sorted in rough order of my concern.
Bdale Garbee, $Id: index.html,v 1.13 2004/01/30 19:09:15 bdale Exp $