Installing Debian-AMD64 GNU/Linux on a
Compaq Presario R3000 Laptop
(model R3190US)

UPDATED: December 1, 2004


WARNING!

Any steps described here are to be carried out at YOUR OWN RISK! I believe them to be safe, and have tested them on my own laptop. If your computer breaks, you get to keep the pieces. Please read through the entire document before doing anything to your hardware.

Introduction

This webpage is an overview of the steps necessary to install Debian Sarge/Sid on a very nice (and reasonably priced) Athlon64 laptop- the Compaq Presario R3000 series. This guide will mostly detail the installation of the 64bit port of Debian (Debian-amd64), but I will also mention steps needed to install Debian-i386. Needless to say, bleeding-edge hardware (especially laptops) often requires extra effort with linux. I assume that you are comfortable compiling a kernel and other necessary software. Here is an overview of the hardware for my specific model (R3190US):

The Plan

My goal is to set up a 64bit Debian environment. For the last month I have been running a pure 32bit system so that I could get some work done while Debian-amd64 matured. The time has come to move to 64bits.

I am a graduate student, and this laptop belongs to my advisor's research group. Because someone else may inherit this laptop in the future, I have decided to make it a dual-boot system (with Windoze XP Home). This will allow for easy BIOS updates, etc, and give future users of the machine more options.

Beating Windows Into the Corner

The first step to setting up a dual-boot system (without reinstalling Windows) is to shrink the NTFS partition. The best tool to use for this is "ntfsresize", which is conveniently used by the parted program. I highly recommend using the latest SystemRescueCD for this task. Here are the steps:
  1. Boot into windows and download the SystemRescueCD image (http://www.sysresccd.org)
  2. Burn image to a CD (it even fits on a mini-cd)
  3. Make sure that the NTFS filesystem is in a consistent state. From a shell run "chkdsk /f" which schedules a filesystem check on the next bootup. Reboot.
  4. After the filesystem check, plug in a usb mouse, insert the SystemRescueCD and reboot. The usb mouse is needed because the alps touchpad is not supported without a kernel patch (will get to that later). You may have to specify the "noscsi" boot option to avoid having the hardware detection process die.
  5. After booting the rescue cd, type run_qtparted at the command line (choose usb mouse). This starts up a nice graphical interface where you can resize your NTFS partition. I chose ~17GB for the NTFS partition and left the remainder empty.
  6. After finishing, reboot into windows and let the filesystem check complete (it was scheduled by ntfsresize).
You are now ready to install GNU/Linux. I would highly recommend securing windows a bit first.

Securing Windows

Windows is a piece of garbage as far as I'm concerned, but if you have to have it installed on a computer, it is definitely worthwhile to secure it a bit. I booted up windows on my home network (behind a firewall) and did the following in an attempt to make Windoze suck less:
  1. Disable windows messenger
  2. Enable basic firewall on both network interfaces
  3. Install windows updates
  4. Install Mozilla Firefox, set it as default browser
  5. Install AVG antivirus software
  6. Install Spybot S&D
  7. Install Mozilla Thunderbird
  8. Install OpenOffice, set as default office suite
  9. Install Cygwin

Installing Debian Sid Base System

I began by downloading the "netinst" image for Debian-amd64 here: http://debian-amd64.alioth.debian.org/install-images/sid-amd64-netinst.iso Burn this to a disk, put it in the drive and reboot. At the boot prompt, you need to disable the apic or else you will end up with IRQ conflicts resulting in the ethernet and harddrive being flaky: boot with "linux noapic". Continue with the normal install. Grub may not detect your windows partition- you can add it later. You should also make sure that the "noapic" option gets applied to all kernels. You may find a copy of my menu.lst useful. You should comment out the "splashimage" line, or you can download the splashimage here. This image is a cute picture of baby penguins :-) If you install X, make sure to disable the login servers (xdm, kdm, etc) by commenting out the entry in /etc/X11/default-display-manager. This is a temporary solution until you can get the nvidia and synaptics drivers installed.

(Alternate) Debian i386

If you only want to use half your processor, download the latest Sarge/Sid install CD and use that. You should really only run 2.6 kernels on an Athlon64, as the support is much better. At the boot prompt, select the 2.6 kernel and remember to specify the "noapic" boot option.

Configuration Overview

Since many people are impatient, here is a brief summary of the hardware configuration. This all pertains to kernel 2.6.9. Please read this entire page before starting, as there are many details in the next section.
#> lspci
0000:00:00.0 Host bridge: nVidia Corporation nForce3 Host Bridge (rev a4)
0000:00:01.0 ISA bridge: nVidia Corporation nForce3 LPC Bridge (rev a6)
0000:00:01.1 SMBus: nVidia Corporation nForce3 SMBus (rev a4)
0000:00:02.0 USB Controller: nVidia Corporation nForce3 USB 1.1 (rev a5)
0000:00:02.1 USB Controller: nVidia Corporation nForce3 USB 1.1 (rev a5)
0000:00:02.2 USB Controller: nVidia Corporation nForce3 USB 2.0 (rev a2)
0000:00:06.0 Multimedia audio controller: nVidia Corporation nForce3 Audio (rev a2)
0000:00:06.1 Modem: nVidia Corporation: Unknown device 00d9 (rev a2)
0000:00:08.0 IDE interface: nVidia Corporation nForce3 IDE (rev a5)
0000:00:0a.0 PCI bridge: nVidia Corporation nForce3 PCI Bridge (rev a2)
0000:00:0b.0 PCI bridge: nVidia Corporation nForce3 AGP Bridge (rev a4)
0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 440 Go 64M] (rev a3)
0000:02:00.0 FireWire (IEEE 1394): Texas Instruments TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)
0000:02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
0000:02:02.0 Network controller: Broadcom Corporation BCM94306 802.11g (rev 03)
0000:02:04.0 CardBus bridge: Texas Instruments: Unknown device ac54 (rev 01)
0000:02:04.1 CardBus bridge: Texas Instruments: Unknown device ac54 (rev 01)
0000:02:04.2 System peripheral: Texas Instruments: Unknown device 8201 (rev 01)

Hardware
or
Feature

Steps to Configure
(Details in Next Section)

Useful Files

CPU

The Athlon64 CPU supports frequency scaling with the powernow-k8 kernel module and the powernowd userspace daemon. However, you will need to enable ACPI "p-states" to determine the cpu frequencies (this is what Windows does). This is needed because the frequency tables in the BIOS are broken.

ALPS
Touchpad

The ALPS touchpad requires a kernel patch and the use of the synaptics X driver. Caution: Use the latest synaptics driver (0.13.6 as of this writing). Earlier versions had problems with the Makefile on 64-bit systems. Alps Touchpad patch

ACPI

The ACPI modules load and successfully report the remaining battery, etc. Unfortunately, I have not yet been able to get suspend/hibernate to work... NONE

Video
Card

The nvidia video card requires the proprietary nvidia drivers. Nvidia recently released version 6111 of their driver, which fixes many problems. You can download it from the Nvidia website. XF86Config-4
NVIDIA README

Wireless

The internal wireless chip is brought to us by Broadcom, who have refused to release any specs on their chipsets. If you use i386, you can install the ndiswrapper kernel module and userspace utilities. This lets you load the the windows driver for the device, which functions well. If you are using amd64, then unfortunately the ndiswrapper code is not 64bit-clean, and the kernel module does not compile. Even if it did compile, I don't know if it is possible to use a 32bit binary windows driver with a 64bit kernel wrapper... Windows driver

USB

Works perfectly. The port on the right side of the laptop is a USB 1 port good for plugging in mice, etc. The two ports on the left are USB 2 ports. NONE

IEEE1394

The controller seems to work and the kernel module loads... I don't have any devices to try with it though. NONE

PCMCIA

The PCMCIA slot works with 16-bit cards after adding some additional memory/IO ranges to the /etc/pcmcia/config.opts file. Cardbus cards may work soon- we need to figure out the proper parameters to use with setpci in order to see the subordinate PCI bus that is there. config.opts

Sound

Sound works well with ALSA drivers. The external volume/mute buttons show up as X keys, and can be configured to adjust the sound levels. NONE

Configuration Details

The Kernel

Since you will need a custom kernel to make use of many features, I recommend this as the first step. I'm going to assume you are starting with the latest stock kernel tree (2.6.9 as of this writing).

First, you will need to apply the Alps Touchpad patch.

To configure the kernel, I recommend that you start with my kernel config and copy it to ".config" in the top level of the source directory. I usually build nearly everything as a module, so you may wish to change things. I am currently NOT using an initrd with this kernel.

To build a kernel the "Debian Way", apt-get and read about the kernel-package tools. Otherwise just build it by hand. After installing the new kernel, make sure that new stanzas have been added to /boot/grub/menu.lst. Reboot and see if it works :-)

ACPI

You should apt-get install acpid. You can configure it to do things whenever an event happens. For example, in the default configuration, a system shutdown is initiated whenever the power button is pressed. I load the following modules in /etc/modules:
# ACPI modules
thermal
processor
fan
battery
ac
button
One of the biggest downsides currently with this laptop is that the ACPI suspend/hibernate features don't work :-( On the bright side, however, the linux ACPI support has come a LONG way, and hopefully these advanced features will improve greatly in the next few kernel releases.

PowerNow

In order to take advantage of the various CPU clock states of the laptop, you should apt-get install powernowd and make sure that the frequency scaling and powernow modules are loaded in /etc/modules:
# CPU frequency
freq_table
cpufreq_userspace
# powernow
powernow-k8
Userspace utilities (like klaptopdaemon) will now be able to set the performance profiles of the CPU.

XFree86

Getting X up and running is a pain. You need to use the proprietary Nvidia graphics driver and use special parameters for the Alps touchpad. The first step is to install the latest Nvidia driver. Download this from the Nvidia website. Run the install script. Choose the options to NOT download a pre-compiled module. It will ask if you want to compile the module for your running kernel - say YES. Before you can use the nvidia module, make sure that you have the following devices in /dev (they should be created by the install script):
crw-rw-rw- 1 root root 195, 0 May 21 10:20 /dev/nvidia0
crw-rw-rw- 1 root root 195, 1 May 21 10:20 /dev/nvidia1
crw-rw-rw- 1 root root 195, 2 May 21 10:20 /dev/nvidia2
crw-rw-rw- 1 root root 195, 3 May 21 10:20 /dev/nvidia3
crw-rw-rw- 1 root root 195, 4 May 21 10:20 /dev/nvidia4
crw-rw-rw- 1 root root 195, 5 May 21 10:20 /dev/nvidia5
crw-rw-rw- 1 root root 195, 6 May 21 10:20 /dev/nvidia6
crw-rw-rw- 1 root root 195, 7 May 21 10:20 /dev/nvidia7
crw-rw-rw- 1 root root 195, 255 May 21 10:20 /dev/nvidiactl
If you don't have these, create them with mknod. For example:
mknod /dev/nvidiactl c 195 255
for nn in 0 1 2 3 4 5 6 7 ; do
    mknod /dev/nvidia$nn c 195 $nn
done
chown root.video /dev/nvidia*
chmod 0666 /dev/nvidia*
Now add the following to /etc/modutils/aliases
# nvidia driver
alias char-major-195 nvidia
and then run update-modules.

In order to use the touchpad, first make sure that you load these modules in /etc/modules:

# Touchpad
tsdev
evdev
psmouse
Next, install the latest synaptics driver for X (I'm using version 0.13.6).

The Alps touchpad uses the "event" interface in /dev/input/event*. In theory, loading the above modules should enable the touchpad, but I have found that the only way to make the touchpad show up is to reload the module by hand. I have created a simple startup script that does this. First get a copy of the findmouse script and put it in /usr/local/sbin. Then simply copy my alps-setup script to /etc/init.d and then update the rc links with

#> update-rc.d alps-setup start 89 2 3 4 5 . stop 02 0 1 6 .
Finally, you are now ready to tweak your XF86Config-4 file. I'd recommend starting with mine, and modifying it to suit your needs. The Nvidia README is invaluable for this. Using my config file, you can go into "normal" mode by running "startx". To go into "TwinView" mode with an external monitor/projector connected, first PLUG IN THE EXTERNAL MONITOR and then specify the server layout like this:
$> startx -- -layout twinview

Wireless Networking (i386 only)

The wireless networking in this laptop is provided by a Broadcom chip. Broadcom has basically given the Open Source community the middle finger. Not only will they not release specs, they also will not develop a binary driver. For now, the only way to use the wireless is to install the ndiswrapper and ndiswrapper-source packages.

After installing the packages, go into /usr/src/modules/ndiswrapper/ and do a "make" and a "make install". This will build the kernel module and put it in the right place in /lib/modules. You can load the module at start up by adding this to /etc/modules:

# Wireless
ndiswrapper
Note that this only loads the "wrapper", you then must load the windows driver. To do this, you can download my gzipped tarball and move it to /etc/ndiswrapper/. Then extract it and you should now have a directory /etc/ndiswrapper/bcmwl5a/. To make sure the driver is registered do this:
#> ndiswrapper -i /etc/ndiswrapper/bcmwl5a/bcmwl5a.inf
Now you have a fully functioning wireless interface. It shows up as wlan0. Press the external button to turn on the transmit power- even the blue LED works :-)

Sound

To get sound working well, apt-get install alsa-base, alsa-headers, and alsa-utils. Then go into /etc/alsa/modutils/ and create a file named "0.9". Here is mine that you can use. Now make a link to this file and update the global module configuration:
#> ln -s /etc/alsa/modutils/0.9 /etc/modutils/alsa
#> update-modules
The next time you boot up, the alsa modules will be used, and you can change the sound levels using alsamixer (or kmix, etc).

USB

Works with no problems.

IEEE1394 (FireWire)

I have no devices to test, but the controller seems supported, so I would imagine everything works fine...

PCMCIA

PCMCIA currently works with 16-bit (ISA) cards. You need to add an extra memory and IO range to your /etc/pcmcia/config.opts. You can get mine here. Also, if you want to use any orinoco_cs cards you'll have to download at least version 0.15rc1, which fixes a problem with 64bit kernels. Several people are currently working on getting cardbus support functioning. I believe it will be possible, just have to hack at it a bit...

S-Video

Not tested.

Flash Media Reader

I believe this device is unsupported, but we'll have to see once we get cardbus support working ;-)

Modem

The modem is an Agere/Lucent winmodem. There may be drivers available for it, but I have not tested it yet, as I don't really need it...

Useful Links



Go Back To Ted's Main Web Page