Installing Gentoo Linux on a Dell XPS 1330 Laptop

General Hardware Specs:

Intel Core 2 Duo, 1.8Ghz, 800Mhz FSB Works Works Just use the x86 i686 stages
WXGA White LED Display, 1280x800 Works Works No special configuration
Integrated VGA Webcam Works Works media-video/linux-uvc
Intel Integrated 3100 Graphics Works Works No compiz or framebuffer, but OpenGL works
Nvidia 8400M Graphics Works Works Thanks, OKOX!
2gb DDR-2 RAM Works Works N/A
160Gb SATA Hard Drive Works Works Works, plus DMA
Broadcom NetLink Ethernet Green Works, not for install Does not work for 2007.0 install media
Synaptics Touchpad Works Works Works, plus scroll-zones
8X CD/DVD Burner (DVD+/-RW) Works Works Reading, Writing to CDs and DVDs
Intel 3945 802.11a/g Wireless Card Works Works Works, including WEP/WPA2, but is flaky. 802.11a Not Tested (yet)
Intel 4965 Draft N Wireless Card Works Works Thanks, OKOX!
High Definition Audio Works Works Recent kernel needed, plus good configuration
Multimedia Keys / ACPI Works Works Very nice - the MM keys are keyboard events
TV Tuner + Remote Control Not Tested Undetermined Not tested - yet

Installation

Now that the built-in network card is supported by the Gentoo 2008.0 Release, installation is simple.

Just follow the Handbook and you'll be fine.

Specific Configuration

Integrated VGA Webcam

The first thing I said to myself when I was building the system from Dell was "VGA Webcam - fat chance that'll work in Linux!"
Surprisingly, the webcam works very well and configuration is dead-simple:

First off, you will want to compile your kernel with the following options:

Device Drivers -> Multimedia devices -> [*] Video capture adapters -> [*] V4L USB Devices
If you want to use some of the older players/apps (Recommended), you will want to also enable:

Device Drivers -> Multimedia devices -> [*] Enable Video for Linux API 1 compatible layer
Now, just compile the driver and reboot (or modprobe uvcvideo if you don't want to):

emerge media-video/linux-uvc
You can view the video from the webcam in a number of apps. A dedicated player for USB Video Class devices is: luvcview, however mplayer can also be used to view the video:

mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:fps=10:outfmt=yuy2
Alternatively, with media-libs/aalib and media-libs/libcaca installed, you can view the output of the webcam in beautiful ASCII. I made a quick script to ease launching the webcam here.

Intel 3100 Graphics

This chipset is the "3rd Generation" of integrated mobile graphics platforms Intel has released. There are drivers available for it, however:

Device Drivers -> Graphics Support -> <*> Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL)
I fiddled with getting the framebuffer to work at a decent resolution (take a look at sys-apps/915resolution), but in the end, the laptop boots so quickly, it doesn't matter to me. If you have any steps for how you got it to work and want to share them, please Contact me and I'll put them on the site.

Next, to get the driver to work with Xorg, you have to compile the (experimental) driver:

echo "x11-drivers/xf86-video-i810" >> /etc/portage/package.keywords
emerge x11-drivers/xf86-video-i810

Don't forget to add the following to /etc/make.conf, so you do not end up building every driver possible for xorg:

VIDEO_CARDS="intel i810"
INPUT_DEVICES="synaptics keyboard mouse evdev"

Now, configure /etc/X11/xorg.intel.conf (click the link to see my configuration - this is set up for the card, screen and touchpad)

Nvidia 8400M Graphics

I do not have this chipset in my laptop, so I am not familiar with configuring it. Thankfully, OKOX has provided the appropriate kernel and xorg configuration files. Look for them in the Files section of this page. Thanks, OKOX!

Hard Drive Controller

The hard drive controller in this system has two modes: AHCI or ATA. If you want to dual-boot windows xp and linux, the easiest choice is to just bump the controller down to ATA mode. If you are running Linux alone (or alongside Vista, for some masochistic reason), you can leave the controller in AHCI mode. Both options are in the system BIOS.

Regardless, the kernel options you will want are:

Device Drivers -> <*> Serial ATA Drivers ->
<*> AHCI SATA Support
<*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
<*> Intel PATA MPIIX support

And (for ATA support):

Device Drivers -> <*> ATA/ATAPI/MFM/RLL support -> <*> Intel PIIXn chipsets support
After installing the new kernel, you can verify that you have DMA support (if you're using the controller in ATA mode) by running:

hdparm /dev/hda
and checking for using_dma = 1

If you decide to switch your controller from AHCI mode to ATA mode in the BIOS (or back the other way), don't forget to update /etc/fstab , /boot/grub/grub.conf and any other path-specific files

Network Card

The 2007.0 version of the Gentoo install media did not have support for the laptop's network card yet. Now that it is in the kernel source tree shipped by 2008.0, you just need to enable the following kernel options:

Device Drivers -> Network Device Support -> [*] Ethernet (1000Mbit) -> [*] Broadcom Tigon3 Support
After you install your new kernel, reboot and your card should act like any other network card. If you want automatic link-status configuration (good for laptops), just run:

emerge sys-apps/netplug
The latest baselayout and udev should take care of the rest.

Synaptics Touchpad

From working on other friends' Dell laptops, I noticed they seem to use Alps touchpads a lot. Having never configured an Alps touchpad for Xorg, I was looking forward to getting it working for this laptop. I was surprised, then, when I saw that this laptop comes with a Synaptics touchpad! Configuration is quite straight forward, and there are lots of options for tweaking its behavior:

emerge x11-drivers/synaptics
This will compile and install the Xorg driver for the touchpad. You will also need to configure it in /etc/X11/xorg.conf. Click the link for my configuration (configured for the intel graphics chipset, screen and touchpad of the M1330)
You will also want to enable the following options in the kernel:

Device Drivers -> Input Device Support -> <*> Event interface
Device Drivers -> Input Device Support -> [*] Mice -> [*] PS/2 mouse

If you plan to plug in a USB mouse, enable "USB Human Interface Device Support" under Device Drivers -> HID Support as well.

Intel 3945 a/b/g Wireless

Intel is well known for their good support of wireless adapters on Linux. Unfortunately, the stable driver is not completely free software at the moment, but it does work for WEP/WPA2.
First, make sure the framework in the kernel is there:

Networking -> Wireless ->
<*> Generic IEEE 802.11 Networking Stack (mac80211)
<*> Generic IEEE 802.11 Networking Stack
<*> IEEE 802.11i CCMP support
<*> IEEE 802.11i TKIP encryption
<*> Software MAC add-on to the IEEE 802.11 networking stack

This will give you a few extra options, but you might eventually want them for the future driver.
The driver for the 3945 chipset is in 3 parts: the kernel module (mostly GPL), the card microcode, and the userspace control daemon (Binary only). You will want the latest version, so run:

echo "net-wireless/ipw3945" >> /etc/portage/package.keywords
echo "net-wireless/ipw3945-ucode" >> /etc/portage/package.keywords
echo "net-wireless/ipw3945d" >> /etc/portage/package.keywords
emerge -a net-wireless/ipw3945 net-wireless/ipw3945-ucode net-wireless/ipw3945d

The module should be loaded by udev on your next reboot, and then you will have access to the card (eth2 on my system).

Note: These instructions are for the ipw3945 driver. There are a few bugs (it sometimes crashes after heavy usage), but for the most part it works just fine. Another driver, currently in development, is trying to get rid of the ipw3945d binary-only daemon requirement. Learn more about the project here: iwlwifi project

Intel 4965 Draft N Wireless

I do not have this card, so I am not familiar with its configuartion. OKOX has kindly provided a kernel configuration file, found in the Files section, which should work for your card.

High Definition Audio


This was where I ran into the most trouble. The codec for the sound card is particularily nasty - drivers for it do not even exist for Windows XP.
Basically, I needed to patch the kernel source for the snd_hda_intel driver and then load the module with an option to get it to work.
As I understand it, the patch has made it into the kernel tree and it is no longer required for the latest stable gentoo-sources kernel. In case you need the patch, you can find it: here

In order to get the driver to work, you will want to compile it as a module so it can be loaded with different options at boot:

Device Drivers -> Sound -> Advanced Linux Sound Architecture -> PCI Devices -> <M> Intel HD Audio
Now, you will want to get it to load at boot:

echo "snd_hda_intel" >> /etc/modules.autoload.d/kernel-2.6
Now, add the sound card model to /etc/make.conf:

ALSA_CARDS="hda-intel"
This should get the sound card working. Don't forget to install media-sound/alsa-utils and add alsa to your default runlevel.

Multimedia Keys / Processor Throttling

Getting the multimedia keys to work is a common source of frustration when trying to get Linux onto a laptop. Thankfully, the beautiful touch-sensetive keys for the 1330 just generate keyboard events (same thing goes for the included IR remote), and ACPI support is already in the kernel:

Power management options (ACPI, APM) -> ACPI (Advanced Configuration and Power Interface) Support ->
<*> AC Adapter
<*> Battery
<*> Button
<*> Fan
<*> Processor
<*> Thermal Zone

Take a look at OKOX's scripts, mute, xbindkeysrc and keyboard_xps, to help you automate the mapping/activity process for some of the extended multimedia keys. Many thanks to OKOX for the excellent, customized scripts!

You will also probably want processor frequency scaling - a major feature of this laptop/processor. It supports 4 States - 1.81 GHz, 1.8 GHz, 1.2 GHz and 800 MHz:

Power management options (ACPI, APM) -> CPU Frequency Scaling ->
[*] CPU Frequency scaling
<*> CPU frequency translation statistics
<*> 'powersave' governor
<*> 'userspace' governor for userspace frequency scaling
<*> 'conservative' cpufreq governor
<*> ACPI Processor P-States driver
[*] /proc/acpi/processor/../performance interface (deprecated)

Now, you can use some application to monitor/change the speed of the processor. I use e_modules-cpu for the E17 window manager.

TV Tuner and Remote Control

I haven't spent a lot of time on trying to get this to work. I might give it a try some time, but until then I have no information on the TV Tuner that is offered as a bundle.
If anyone has any information, please Let me know and I'll add it to this page. Thanks!

Other Information

Special thanks to OKOX for providing the configuration files for the nivida graphics chipset and the 4965 wireless card as well as multiple utility scripts.
Another thank you goes out to Dusdan for providing the mute.sh script.

Slackware Linux 12.0 on the Dell XPS m1330
Excellent website, covers a lot of the information I outlined here in greater depth. Nice job, Philip Langdale!

Files

Here are some of the files that might come in handy if you are trying to get Linux on your XPS M1330:

/etc/X11/xorg.conf - configured to support the 1330 graphics, touchpad and screen dimensions
/etc/X11/xorg.conf - same, but for nvidia graphics (provided by OKOX)

webcam.sh - mplayer launching script for the integrated webcam
keyboard_xps - script for mapping the M1330's extra keys (provided by OKOX)
mute - mute/unmmute script, customized for the M1330's audio chipset/configuration (provided by OKOX)
mute.sh - another mute/unmmute script, using dcop instead of amixer (provided by Dusdan)
xbindkeysrc - enables functionality for the Multimedia Keys (provided by OKOX)
alsa-stac.diff - patch for older kernels, adds sound support for this card

kernel.conf - configuration file for the Intel 4965 Wireless card and the Nvidia 8400M Graphics card (provided by OKOX)

See the whole files directory

lspci and lsusb output

lsusb:

Bus 002 Device 002: ID 05a9:7670 OmniVision Technologies, Inc.
lspci:

00:00.0 Host bridge: Intel Corporation Mobile Memory Controller Hub (rev 0c)
00:02.0 VGA compatible controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)
00:02.1 Display controller: Intel Corporation Mobile Integrated Graphics Controller (rev 0c)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 02)
00:1c.5 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 6 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f2)
00:1f.0 ISA bridge: Intel Corporation Mobile LPC Interface Controller (rev 02)
00:1f.1 IDE interface: Intel Corporation Mobile IDE Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation Mobile SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)
03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
03:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 12)
03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)
09:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express (rev 02)
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

ChangeLog

July 11, 2008 - Gentoo 2008.0 Shipped a few days ago. The network card now works out of the minimal boot install.
March 19, 2008 - Added Dusdan's mute.sh script. Thanks, Dusdan!
March 16, 2008 - Added 3 scripts (keyboard_xps, mute, xbindkeysrc) to the "Files" section - Many thanks, OKOX!
December 3, 2007 - Updated information on the audio card - the module option is not needed any more with a recent kernel
November 20, 2007 - added xorg.conf, added information on /etc/make.conf options to graphics and sound card setup
November 19, 2007 - Initial release of site. xorg.conf to be placed up in a few days once it's cleaned up a bit

Contact Info

If you need help or have feedback for this page, feel free to drop me a line at:
matt (at) manjos (dot) com
I also use MSN. That address is matt (at) manjos (dot) com
The folks at irc.freenode.net in #gentoo are also a great help, and can probably sort out any problems you have.