Linux on the HP nc6000
Last updated: Fri 24 Feb 2005.
The document and all its associated files are licensed under the GPL.
This is a provisional page that provides information on how to get Linux
working on the HP nc6000 laptop
. Since it took me a long time and lots
of testing to figure all this out, I'm publishing it here in the hope
that it will be useful.
NOTE: I have no longer have access to an HP NC6000 since my laptop's motherboard broke in August 2005. Therefore, this information is probably out of date.
Most stuff, e.g. fans, battery and AC adapter, works out of the box.
Processor clock speed modulation
This works using the standard 2.6 API. I use powernowd
to keep the CPU clock down, keep the fans quiet and prolong battery life. You need to compile the cpufreq_userspace
modules for it to work.
If the processor
acpi module is loaded, switching C1/C2/C3 states works, but, at least
on my machine, C3 is almost never used. The main cuplrits are:
- X: the laptop never enters C3 under X. I haven't looked into why, maybe it's due to the drm driver
- USB mouse: when it's plugged in, C3 is entered very rarely
- Ethernet card: if eth0 is up, it stops C3 from being entered more than about 50% of the time
Suspend to disk
I use software suspend 2
I also tried S4 support in the vanilla kernel, but it's much slower, and when it resumes all disk caches are emtpy so the laptop
is sluggish. With swsusp2, when you resume all the apps you have in
cache start instantly.
Currently I'm using swsusp 22.214.171.124
on a 126.96.36.199 kernel and it's solid as a rock. A long time ago I had to set the
Async IO limit to 256 or the machine would hang on resume, but maybe that's the
default now. To suspend I use the hibernate script available from http://www.suspend2.net/downloads/
. My configuration file is here
Little nits remaining are:
I have never been able to successfully and reproducibly suspend and
resume (either to disk or to RAM) without unloading the USB modules, so
I unload them on suspend and reload them on resume. However, the
psmouse module works fine, so you can remove it from /etc/hibernate/blacklisted-modules.
Suspend to RAM (S3)
S3 "suddenly started working" for me when I moved to a vanilla
2.6.11-rc3 kernel, but it seems to be very picky about kernel
configuration. At a minimum, you will need to disable radeonfb, which
hangs the machine on resume. Standard vesafb works fine though.
If you can't get S3 to work, first try my kernel
The laptop comes out of S3 fine, but it doesn't initialize the video
card on resume. You must do it yourself, either by using vbetool
or by adding the acpi_sleep=s3_bios
kernel parameter using lilo or grub. I use vbetool because it's
available for Debian and it can save and restore the console state
properly on suspend and resume.
The script I use for S3 suspend is here
Note that when the machine resumes, acpid will see the ACPI event
caused by the power button (which you have to press to turn the machine
back on), so if you have configured acpid to hibernate when you press
the power button, as soon as the machine comes out of S3 it will
immediately hibernate again! The scripts fix this by creating /var/run/S3
when going into S3 and checking for its presence in the power button script.
Suspending using the sleep and power buttons
To hibernate the machine when you press the power button, just configure acpid
to call hibernate
when the power button is pressed (unless the machine is coming out of S3, see above). The script I use is powerbtn.sh
. On Debian, just put it in /etc/acpi
Entering S3 when the sleep button is pressed requires a little
more work. For GNOME, you first need to map the sleep button to the
"Sleep" function in the Keyboard Shortcuts preferences. When you do
this, GNOME calls the apm
command as the user that is currently logged in. If you are not logged
in as root (which you shouldn't be), you need to use a setuid
application to call the S3 script. I use this simple C program, which I
compiled and installed setuid root in /usr/local/bin/apm: apm.c
I don't know how to to this in KDE, but it shouldn't be too different.
Battery and AC adapter status on resume
When you resume from S3 or S4, ACPI doesn't tell the OS if you have
plugged in or unplugged the AC adapter or the battery while suspended.
This can be a problem if you suspend on AC power and resume on battery:
after resume, you don't know how much battery life you have left.
It's sometimes possible to work around this by reloading the battery
modules, but the best way I have found is to hack the DSDT so it generates ac adapter and battery events in the _WAK
function. This a bit of a hack, but if you want to do it, the patch to the DSDT is here
To decompile and recompile the DSDT, you will need the iasl
compiler (note: if you use Debian you need to install an old version of the flex package to compile iasl itself). To activate the new DSDT, you must add the following lines to drivers/acpi/osl.c
#define CONFIG_ACPI_CUSTOM_DSDT_FILE "/path/to/dsdt.dsl.hex"
or apply the DSDT in initrd patch
and add the DSDT to your initrd.
Graphics card clock modulation
This saves a lot of battery power. To use it you either need to use the ATI proprietary driver (not tested) or the x.org server
. See the graphics section
The integrated broadcom gigabit ethernet is supported by the tg3 driver. I use ifplugd
to bring the interface up when the cable is plugged in. I use udhcpc
as a DHCP client because it's small and fast and doesn't try to renew leases between sessions.
The integrated Atheros 802.11a/b/g wireless is supported by the madwifi
driver (you need to get it from CVS). The wireless switch "just works"
(I think it disconnects the antenna or something). To automatically
connect to wireless networks I use wpa_supplicant
ATI provides a proprietary driver which should work. I don't use it
though, so the following stuff applies to the open source drivers that
This saves a lot of battery power. To use it, you need to use the x.org X server
. If you are using Debian, useful information on how to compile x.org yourself is here
. I think there are also prebuilt .debs somewhere, but I don't know where. To turn this on, just add:
Option "DynamicClocks" "on"
With some versions of x.org, the backlight doesn't turn off on lid close. My lid script
turns it off manually and also throttles the screensaver so as to save CPU power.
I've never been able to get this to work. Any pointers will be much appreciated.
3D sort of works using r300_driver
You need a recent version of x.org (6.8.2 should be fine, but CVS is better) and
Mesa from CVS. However, the machine sometimes locks up hard when
running 3D apps and the quality of the driver is not yet very high.
This just works.
Getting key events
- Lock button: put setkeycodes e00a 152 somewhere in your startup scripts (on Debian, put 01lockbutton into /etc/console-tools/config.d) and configure it to activate the screensaver using the GNOME (or KDE?) keyboard shortcuts preferences window.
- Presentation button: I don't use this. You can use setkeycodes e00a <something>
to map it to a keycode that you can associate using the GNOME (or KDE?)
keyboard shortcuts preferences window. For the list of possible keys,
look in /usr/include/linux/input.h
- Sleep button (Fn+F3). This is already mapped to a keycode, just configure it in the keyboard shortcuts preferences window.
- Battery button (Fn+F8).I don't use this. You can use setkeycodes e009 <something> to map it to a keycode that you can associate using the GNOME (or KDE?) keyboard shortcuts preferences window.
- Volume up and down keys: these are already mapped to keycodes and
can be configured in the keyboard shortcuts preferences window.
- Brightness control buttons: unknown
- Wireless button: this is handled in hardware and causes the
wireless antenna to be connected/disconnected and connects/disconnects
the internal Bluetooth device from the USB bus.
Scripts and configuration files
These are the userspace scripts
and configuration files I use. They are mostly Debian-specific, but you
can probably modify them to fit your needs
- DSDT patch:
to get the battery and AC adapter status to be correct on resume
(Note: it's against BIOS F.11: to apply against F.12, only add the Notify statements).