Linux on the Dell Latitude C840 Laptop

Matt Housh (jaeger at morpheus dot net)

NOTE: I no longer own this laptop and do not update this page. I leave it here to keep the information available.

Last edited: 06.16.04

*EDIT*: Updated 04.03.03 with Suspend-to-RAM information from Chris Osgood!

Kernel Configuration

Here is my kernel config file. This information is entirely based on linux kernel version 2.4.20.

This is where the important stuff comes in. All the devices in this laptop are supported in linux, as far as I know, but I don't have information on all of them, so I will include what I do know. If you know something I don't or have info on one of the devices I don't, feel free to email me.

Make sure you include the experimental stuff:

[*] Prompt for development and/or incomplete code/drivers

You can get access to and control over the fans and some of the function keys on Dell laptops (including this one) using i8k utilities, which I'll go into later on. To enable this functionality, include Dell laptop support in the "Processor type and features" section:

<*> Dell laptop support

PCMCIA-CS Support

First off, in "General setup", make sure you have hotplug enabled:

[*] Support for hot-pluggable devices

Then, in "General setup -> PCMCIA/CardBus support", enable pcmcia, cardbus, and the bridge:

<M> PCMCIA/CardBus support
[*]   CardBus support
[*]   i82365 compatible bridge support

Advanced Power Management (APM) Support

In "General Setup", enable APM support, builtin or modules:

<*>   Advanced Power Management BIOS support

NOTE: ACPI support seems to have problems with some configurations. I do not use it, so I do not provide any information about it here.

IDE SCSI Emulation (CD-RW/DVD Combo Drive) Support

In "IDE, ATA and ATAPI Block devices", enable IDE cd and scsi emulation support as modules:

<M>   Include IDE/ATAPI CDROM support
<M>   SCSI emulation support

In "SCSI support", enable SCSI cdrom and generic support as modules:

<M> SCSI support
<M>   SCSI CD-ROM support
<M>   SCSI generic support

FireWire Support

In "IEEE 1394 (FireWire) support (EXPERIMENTAL)", enable firewire support, the device driver, and whatever protocol drivers you think you'll need, something like so:

<M> IEEE 1394 (FireWire) support (EXPERIMENTAL) (NEW)
<M>   OHCI-1394 support (NEW)
<M>   OHCI-1394 Video support
<M>   SBP-2 support (Harddisks etc.) (NEW)
<M>   Ethernet over 1394 (NEW)
<M>   OHCI-DV I/O support
<M>   Raw IEEE1394 I/O support (NEW)

Getting FireWire support working is pretty simple once your system is up and running. I only had one FireWire device available to test with, a QPS external CD-RW, which worked excellently. I loaded the ieee1394, ohci1394, and sbp2 modules, and I was able to use the FireWire CD-RW with no trouble. If you want this process to be automatic, install a hotplug manager like murasaki.

*UPDATE 04/24/03*: I have had the opportunity to use a few more firewire devices, including a DV/VHS VCR, an external 3.5" drive enclosure, and a DV camera. All of them work great using the kernel modules listed above.

Network Card Support

There are multiple network configurations Dell laptops can have. Mine happens to have an internal Mini-PCI (NOT PCMCIA) 3Com network card in it, so I will go over that here.

In "Network device support -> Ethernet (10 or 100Mbit)", enable ethernet support, 3com cards, and the 3c59x pci driver:

[*] Ethernet (10 or 100Mbit)
[*]   3COM cards
<M>     3c590/3c900 series (592/595/597) "Vortex/Boomerang" support (NEW)

Wireless Networking Support

My C840 came with a Dell TrueMobile 1150 Wireless ethernet card, which works excellently with both my home and work wireless networks. Unlike the 3Com mini-PCI card, it *IS* a PCMCIA device (thus requiring pcmcia support) and uses the orinoco_cs module, which we get with the following options in "Network device support -> Wireless LAN (non-hamradio)":

[*] Wireless LAN (non-hamradio)
<M>   Hermes chipset 802.11b support (Orinoco/Prism2/Symbol) (NEW)
<M>   Hermes PCMCIA card support

Modem Support

More on this later, I have not had an opportunity to test the modem yet. Tentatively, in "Network device support":

<M> PPP (point-to-point protocol) support
<M>   PPP support for async serial ports (NEW)
<M>   PPP support for sync tty ports (NEW)
<M>   PPP Deflate compression (NEW)
<M>   PPP BSD-Compress compression (NEW)

Infrared Support

NOTE: I have no infrared devices to test this driver and support with, but I am told it works, so I include this info here. If I ever get the chance to verify it, I will update the page with pertinent information.

Add the following support in the "IrDA (infrared) support" section:

<M> IrDA subsystem support
<M>   IrLAN protocol (NEW)
<M>   IrNET protocol (NEW)
<M>   IrCOMM protocol (NEW)

Infrared-port device drivers:
<M> IrTTY (uses Linux serial driver) (NEW)
<M> IrPORT (IrDA serial driver) (NEW)

Soundcard Support

The soundcard in the C840 is a pretty common card which uses the linux i810_audio driver. Enable it in the "Sound" section:

<M> Sound card support
<M>   Intel ICH (i8xx), SiS 7012, NVidia nForce Audio or AMD 768/811x

USB Support

USB support on this laptop also works flawlessly. I have tested it with numerous mice, a trackball, my digital camera, and my visor handspring. Enable support for the UHCI controller and devices you'll use in the "USB support" section:

<M> Support for USB
[*]   Preliminary USB device filesystem
<M>   UHCI (Intel PIIX4, VIA, ...) support (NEW)

For USB mouse support, add:
<M>   USB Human Interface Device (full HID) support
[*]     HID input layer support

NOTE: You'll need input core support and mouse support in the "Input core support" section of the kernel config as well for mice.

I also add support for my handspring visor in "USB Serial Converter support":
<M> USB Serial Converter support
<M>   USB Handspring Visor / Palm m50x / Sony Clie Driver

That's all I can think of right now, I will gladly consider additions, suggestions, or corrections if they're emailed to me.

XFree86 Configuration

Here is my XF86Config file.

XFree86 configuration is rather easy (though it can occasionally be time-consuming) with XFree86 version 4. My C840 has an nVidia GeForce 4 440 Go in it, which is relatively painless to get up and running at the LCD's default resolution, 1400x1050. I realize that some C840s might have different screens, but as I only have experience with the 1400x1050 LCD, that is the one I will discuss here.

First off, you'll need to install the nVidia closed-source linux drivers. These are available in the CLC ports tree under stable/, but if you're not running CRUX, grab them from nVidia's website. In the CLC ports, they are called nvidia_glx and nvidia_kernel. If you're downloading them from the website, get the kernel and glx packages appropriate for your system. I will not detail the install here as nVidia's documentation is good for that, except to say that CRUX users should add the following line to /etc/modules.conf:

alias /dev/nvidia* nvidia

NOTE: Please notice that this line has changed with the latest release of the nVidia linux drivers (4191 as of this writing), it USED To be NVdriver instead of nvidia.

Once the closed-source nVidia drivers are installed, you should be able to generate a semi-useful XF86Config file using the command 'XFree86 -configure'. This will probe your hardware and attempt to figure out your video card, monitor timings, and mouse. It's somewhat successful on the C840, and we will fill in the rest.

nVidia GeForce 4 440 Go

To run in its native resolution of 1400x1050, this latitude needs a modeline to tell XFree86 its timings. The following line is what I use. I did NOT write it up, I found it on the net using a google search. I don't know XFree86 timings, so try searching before you ask questions. :) Anyway, here's the one that works on my C840:

Modeline "1400x1050"  129  1400 1464 1656 1960 1050 1051 1054 1100 +Hsync +Vsync

NOTE: This Modeline goes in the "Monitor" section of the XF86Config file. Refer to my XF86Config file linked above.

NOTE 2: John Voltz emailed the following extra tips: "you can run xvidtune to dynamically change the modeline, and you can use gtf to calculate it from input values." (see gtf(1) and xvidtune(1))

PS/2 Touchpad

The builtin touchpad on the C840 works as a ps/2 mouse. Your mouse configuration section should look something like this:

Section "InputDevice"
   Identifier  "Mouse0"
   Driver      "mouse"
   Option      "Protocol" "ps/2"
   Option      "Device" "/dev/misc/psaux"
   Option      "Emulate3Buttons" "true"
EndSection

USB Mouse

If you want to use a USB mouse in X in addition to the touchpad on the laptop, you'll need to do a little extra work. If you haven't already done so, install a hotplug manager such as usbmgr (available in CLC ports) or murasaki to handle automatic loading and unloading of USB modules.

Add a second mouse section after the first one that looks like this:

Section "InputDevice"
   Identifier  "Mouse1"
   Driver      "mouse"
   Option      "Protocol" "imps/2"
   Option      "Device" "/dev/input/mice"
   Option      "ZAxisMapping" "4 5"
EndSection

This assumes your USB mouse is a microsoft (optical) wheel mouse or a similar model such as logitech's optical wheel mouse or trackball. Alter the second mouse section as necessary to match your hardware.

In order to get the two mice to work concurrently in XFree86, you'll need to also alter the "ServerLayout" section of the XF86Config file. Basically you'll need to tell XFree86 you have 2 mice and that one of them is the main pointer. The second one sends pointer events, but can be removed. Logically, the touchpad should be your core pointer and the USB mouse the secondary one. So, you should have two mouse configuration lines in the "ServerLayout" section like these:

InputDevice    "Mouse0" "CorePointer"
InputDevice    "Mouse1" "SendCoreEvents"

Leave the rest of the "ServerLayout" section as it is. Now both mice should work concurrently.

TV-Out (TwinView) Support

There are numerous ways you can set up TwinView with nVidia video cards, so I'll only describe the way I use it to save space and time. Besides, the nVidia linux driver documentation has quite a bit of info on this subject, so check there if you need more.

I use my laptop sometimes to play DivX or other movie files on my TV at home. I prefer to use linux to do just about everything on my laptop, so I needed X to work with the TV-Out, not just windows. Fortunately, TwinView solves this problem perfectly. I set up XFree86 to display 1024x768 on both my laptop screen and the TV when the TV-Out cable is plugged in, and to revert back to 1400x1050 when the TV-Out cable is NOT plugged in. Note that restarting X is required to switch between them.

The important bits of configuration go into the "Device" section of the XF86Config file. Refer to my linked XF86Config above.

Option     "TVStandard" "NTSC-M"
Option     "TVOutFormat" "SVIDEO"
Option     "TwinView"
Option     "TwinViewOrientation" "Clone"
Option     "SecondMonitorHorizSync" "30 - 50"
Option     "SecondMonitorVertRefresh" "60"
Option     "MetaModes" "1024x768,1024x768"

Assuming you have X already configured and working, these lines will allow you to use the TV-Out in "Clone" mode, meaning the TV and the LCD display the same picture at all times. If you want to change that, refer to nVidia's documentation and change the "TwinViewOrientation" option. "TVStandard" refers to your TV's output standard, which you should already know or be able to find out easily. For North America, where I live, "NTSC-M" is the appropriate setting. Consult your TV manual if you're unsure. The rest of the options should be self-explanatory, though if you want to change them, I again suggest referring to nVidia's documentation.

I will not detail the rest of X configuration as the nVidia and XFree86 documentation should cover everything else.

Suspend to Disk / Suspend to RAM

Suspend to Disk - I have no idea if this works correctly on this laptop. I do not have an S2D partition, nor do I intend to create one.

Suspend to RAM - This DOES work correctly, even in X, with modifications to the nvidia kernel module source. Thanks to Chris Osgood for this information, he emailed it to me.

Download the nvidia kernel source (I'm using 1.0-4349 now) and edit nv.c. At line 1729 (in version 4349) in the nv_kern_pm() function, change return 1; to return 0;.

Look for this to make sure you're at the right line:

nv_print(NV_DBG_INFO, "NVRM: received unknown PM event: 0x%x\n", rqst);
return 1;

Compile and install the driver and you should now be able to suspend to RAM using the Fn-ESC key combo. I've heard reports that this can hang the machine if the lid is closed, but this DOES NOT happen to my C840. YMMV. The only problem I have with it is that my pcmcia drivers do not function correctly after a suspend, making my wireless network card useless until I reboot the machine.

Fan Control / Function Keys

Accessing the i8k fan and audio functions is very simple. First, install the i8kutils package (available in CLC ports). The two main things we'll worry about are i8kbuttons and i8kfan (symlink to i8kctl). Both have excellent man pages, but I'll mention a couple of helpful things. First, i8kbuttons can be made to monitor the audio function keys (up, down, mute) and run a program when you press one of them. I have mine set to raise, lower, and mute the soundcard volume using aumix. This is accomplished like so:

# i8kbuttons -u "aumix -v +10" -d "aumix -v -10" -m "aumix -v 0"

Secondly, i8kfan can be used to check or change the laptop's fan speeds. The C840 has two fans, so running i8kfan with no options will show you something like the following:

# i8kfan
1 1
#

Altering the speed of the fans is simple. i8kfan takes the following arguments: 0, 1, 2, and -. 0 means off, 1 is low speed, 2 is high speed, and - means ignore this fan. So, for example, to set the first fan to high speed and ignore the second fan, do this:

# i8kfan 2 -

If you run i8kmon, there's no need for or reason to use i8kfan. i8kmon will monitor and change the fan speeds automatically. Check this init script for examples of running i8kbuttons and i8kmon.

Valid XHTML 1.0! Valid CSS!