Debian Linux on a Dell Inspiron 8200





Summary

This is my description of how I installed Debian Linux on a Dell Inspiron 8200 Laptop.

To be transformed in more pretty HTML asap.



Author: Stefan Rutzinger (rutziATfs.tum.de)

Initiated: June 18, 2002



Comments are always welcome!



Updates

August 21, 2002: section Network card, the apm script

August 22, 2002: added section TrueMobile wlan card

September 10, 2002: installed Kernel 2.4.19, several supplements

Septemper 16, 2002: added section about Dell special keys

September 16, 2002: file transferred to html format

September 26, 2002: updated TrueMobile section



Content

0. Disclaimer

1. Hard- and software

Hardware

Software

2. Dual-Boot

Partitioning the harddisc

The suspend-to-disc partition

Bootloader

3. Installing Linux

Initial install

Making a new kernel

Installing X

Network card

Sound

CD-RW/DVD Combo

The TrueMobile 1150 MiniPCI Wlan Card

Dell Special Keys

The IrDA port

The 1394 port

4. Problems



(0) Disclaimer

I am not responsible for any damage on your hardware or data. Whatever You do with your computer is at your own risk. This document ist just a description of what I did with mine, it is by no means a manual for you to follow and blame me if you run in trouble (which does not mean I do not like to hear comments from you).

In addition, this document turns on users who are familiar with linux and debian installation in general. I really only wrote down the specialties of this certrain computer. So if you need basic help on setting up your linux, please turn on other sources, there are many around in the net.

Nevertheless comments and questions are ofcourse alway welcome.



(1) Hard- and software

Hardware

CPU:

Intel P4 Mobile Stepping 04

Chipset:

Intel 845MP

Memory:

512MB ram

Video:

GeForce 4 440Go 64MB

Display:

1600x1200 60Hz UXGA 15"

Audio:

Cirrus Logic/Crystal CS4205

Network card:

3c905 Tornado

Harddisc:

40GB HITACHI_DK23DA-40

CD-RW/Combo:

SONY CD-RW/DVD-ROM CRX810E 16/10/24 8xDVD

Mouse:

Touch-Pad and Trackstick

wavelan card:

TrueMobile 1150 internal miniPCI wireless lan card

Firewire:

TI OHCI conform IEEE 1394 controller



Software

Preinstalled:

Win XP, some Dell tools.

To install:

Debian woody





(2) Dual-Boot

Partitioning the harddisc

Because I did not want wo spend EUR 3000,- for an up-and-running preconfigured device with guarantee, (and for playing bad, bad ego-shooters,) I wanted to keep the preinstalled Windows. The Windows came on a single NTFS partition, with an additional small partition for some DELL stuff at the beginning of the harddisc.

I used Partition Magic 7.0 to cut the NFTS Partition in two pieces and shift it to insert a 32MB /boot Partition. The Linux part of the disc was then split in swap (500MB), / (500MB), /usr (2GB), and /home (17GB) partitions. 2.5GB for the system part of the linux seems to be far enought (at least debian says so), though on all my other machines I sooner or late ran out of space. /boot and /usr are mounted ro which safes lot of time in case of an unclean shutdown.

The nfts partition is mounted ro to have at access at least in one direction to the windows.



The suspend-to-disc partition

First I intended to make one, but then as I tried to understand the Documentation of this Dell tool MKS2D, I think this is only possible with wipeing the whole disc. And for I would probably never use it (suspend to ram is much faster, and I would never leave my laptop alone for such a long time that it would run out of battery), I finally decided to skip this.

Also with not using the S2D feature I shipped around all the Problems with the bootloader at the wakeup.



Bootloader

LILO still does a good job. Install it in the MBR, and it will boot WinXP and Linux without problems.



(3) Installing Linux

Initial Install

Debian from bootdisk (woody compact). I think all hardware except of sound and USB was initially detected. Then continued with network installation.



Making a new Kernel

I made a customized kernel quite early for two reasons: one is that bootup is accelerated quit somewhat because all the hardware-detect of noninstalled stuff which runs in several timeouts is avoided. The other is that when installing the nvidia kernel module one nevertheless must have the kernel source installed (maybe the headers are enough).

Now I upgraded from Kernel 2.2.20 to Kernel 2.4.19. Just for completeness.



Installing X

Installation of the nvidia driver is quite simple.

I suggest to start with an xfree installation out-of-the-box and set it up with debconf, using xserver vga, to have a working XF86Config (even if a resolution of 320x200 is crap), and do the nvidia driver installation afterwards.

Download the two files from www.nvidia.com:



NVIDIA_kernel-1.0-2960.tar.gz
NVIDIA_GLX-1.0-2960.tar.gz



First one is the kernel module which provides hardware access to the GeForce4, second one is the xserver. You may also use the precompiled RPMs if you prefer, I had to get the source because I haven't found precompiled ones fitting my kernel version.



Only thing you need to do with both of them is to untar and 'make install', really staight forward. Ah yes, read the README and remove "GLcore" and "dri" from 'Section "Module"' as they are not compatible.



I haven't recognized any problems with apm, suspend, etc... as reported by others on Inspiron 8100s. Maybe they are fixed in the meanwhile.





Crap, with upgrading to Kernel 2.4.19 I also experience problems with APM. The NVdriver refuses to go to suspend if loaded. Don't ask me what has changed in the kernel to produce this. As far as I had a short look at the code, the driver is compiled depending on the CONFIG_PM kernel parameter, which does not exist in 2.2 kernels. So it just does not know that it wants to refuse APM with 2.2 kernels?



As APM apparently seems to work well with the NVdriver module, there is a patch at <http://vergil.chemistry.gatech.edu/~park/dell.html> of Alfred Park who describes that only some return values have to be changed to make the NVdriver module accept APM requests:



Note that the current nVidia driver prevents any APM activity. In order to
activate suspend-to-memory or suspend-to-disk, you must edit the nv.c source
file. First, search for the word "avoiding", you should come across a block
of code like this:

#else
case PM_RESUME:
case PM_SUSPEND:
// printk("NVRM: avoiding suspend request, don't want to shutdown!!\n");
return 1;
#endif
default:
// printk("NVRM: received unknown PM event: 0x%x\n", rqst);
return 1;
}
return 0;
}
#endif

Change both return 1 statements to return 0 statements. It should now look
like this:

#else
case PM_RESUME:
case PM_SUSPEND:
// printk("NVRM: avoiding suspend request, don't want to shutdown!!\n");
return 0;
#endif
default:
// printk("NVRM: received unknown PM event: 0x%x\n", rqst);
return 0;
}
return 0;
}
#endif

Save the file and run make.



In addition, one should be shure to have agp disabled in XF86Config-4:



Section "Device"
Option "NvAGP" "0"



I will try out whether it works nevertheless.



Network card

The network card seems to hang after resuming from suspend. To bring it back to life, ifconfig it down and up while resuming. This script does this via apmd. Put it to /etc/apm/event.d.



#!/bin/sh
#
# /etc/apm/event.d/network - rutziATfs.tum.de 2002-06-16
#
# The network card does not come back after a resume. It's maybe the
# autonegotiation which is lost afer powerdown. Ifconfig can fix this, but
# this erases routing. So just use ifdown / ifup.

if [ "$1" = suspend ]; then
/sbin/ifdown eth0 > /dev/null 2>&1
elif [ "$1" = resume ]; then
/sbin/ifup eth0 > /dev/null 2>&1
fi

# The output of /sbin/if[down,up] must be redirected to /dev/null in my case,
# because I use dhclient for dhcp, and if it can't write to its output
# pipes it breaks up the script somehow, leading to an incomplete or
# disabled network setting.


Works continuously after the kernel update.



Sound

The part which took longest because several things did not work out immediately and produced a lot of confusion. In the end the solution was simple as usual.

The sound chipset is compatible with the intel 8x0 cipset and should work with the intel8x0 driver. The kernel driver did not work for me but the alsa snd-card-intel8x0 module does.

I first tried out the woody alsa packages, but they are currently alsa-0.9beta which is the developement version and did not compile for me. So I went back to the alsa-0.5 packages which compiled well.

So you need to do this:

make a kernel with 'Sound card support' as module (CONFIG_SOUND=m).

install the alsa-0.5 packages:

apt-get install alsa-source-0.5 alsa-utils-0.5
cd /usr/src/
tar -xzf alsa-driver-0.5.tar.gz


and compile the modules as explained in the INSTALL file:

cd modules/alsa-driver-0.5-0.5.12a-2
modprobe soundcore
./configure --with-cards=intel8x0
./snddevices
make
make install


It is important that if something fails you really do a 'make clean' before every retry. I had the problem that I first compiled all cards, and some of them did not resolve dependencies, but with simple retry these bad guys were copied again and again to the modules directory, until I really wiped away all stuff with 'make clean'.

Do 'modprobe snd-card-intel8x0' to load all alsa modules.

Now use alsamixer (or amixer) to set volume levels and unmute the channels (for navigation see man alsamixer, esp. use cursor keys to navigate / set values and M to toggle mute), otherwhise you won't hear anything.

At this point I was able to play sounds with 'aplay something.au'.

But the *-oss modules are not loaded automatically, so almost everything else, esp. 'cat something.au > /dev/audio' failed. Do



modprobe snd-pcm-oss
modprobe snd-mixer-oss


to have access to /dev/audio and /dev/mixer by programs that do not speak 'alsa' but 'oss'.

To have the modules loaded automatically when needed, certain entries need to be made in /etc/modules.conf. Fortunately alsa-0.5 automatically generates a list of modules.conf entries when being compiled. It is placed in /etc/alsa/modutils/0.5. Link this file to /etc/modutils/alsa and run 'update-modules' to integrate it into modules.conf.

Now the mixer settings have to be restored after every module unload, especially at system startup. To do this I inserted a script



/etc/init.d/alsa:
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
ALSACTL=/usr/sbin/alsactl-0.5
NAME=alsa
DESC="alsa mixer settings"

test -x $DAEMON || exit 0

Set -e

case "$1" in
start)
echo -n "Restoring $DESC: "
$ALSACTL restore
echo "done."
;;
stop)
echo -n "Storing $DESC: "
$ALSACTL store
echo "done."
;;
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
#restart|force-reload)
#
# the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
#;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac

exit 0


and linked it in the appropriate /etc/rc* directories.

I haven't thought about half/full duplex yet.

After the kernel update from 2.2 to 2.4 I had to run the alsa configuration again to link the snd- modules to the new kernel. Maybe sound will now work with the kernel modules, but as everything is well running I am not in the mood to try this out.



CD-RW/DVD Combo

CD read access works well even already in ide mode, but if you want to burn CDs you need to compile a kernel with ide-scsi emulation and scsi-cdrom driver



CONFIG_BLK_DEV_IDESCSI=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SR=y


and have 'append="hdb=ide-scsi" in your lilo.conf.

Haven't tried playing DVDs yet.

As expected after the kernel update everything still is fine.



The TrueMobile 1150 MiniPCI Wlan Card

I got this nice thingie last week. Built it in immediately and it's doing fine under windows.

In fact the card is an Intersil PRISM2 card, and is connected via a TI PCI1410 onboard carbus controller. It's something close to the Lucent orinoco card.

I just can't get it running with kernel 2.2.20. The Cardbus to PCI Bridge, the Texas Instrument PCI1410 does not work propperly and doesn't accept any IRQ setup. Seems I need to upgrade the kernel to 2.4.

Took some time but now I had a closer look to the wlan card. To bring it to the point: kernel 2.4.19 supports is, Yenta is the name of the driver for the PCI1410 cardbus bridge, and the kernel needs to be compiled with:



CONFIG_NET_RADIO=y
CONFIG_HERMES=y
CONFIG_PCMCIA_HERMES=y



The rest worked out of the box and the card could be configured with the standard tools iwconfig, ifconfig etc.



Dell Special Keys

The I8200 has two volume keys and four CD-player/function keys, located close to the power button. The volume keys are equivalent to the Fn-Volume and Fn Mute keys on the keypad. To apply functions to these keys, the volume keys and the CD-player keys need to be treated seperately.



1. Volume/Mute Keys

Functions to the volume keys and the Fn-Mute key are applied via the 'i8kbuttons' daemon. Therefor the package 'i8kutils' must be installed, and the kernel must be compiled with 'CONFIG_I8K=y' (Processor type and features -> Dell support). The daemon executes certain commands if one of the keys is pressed. They are defined at daemon start, for debian testing in /etc/i8kbuttons:



#
# /etc/i8kbuttons
#
# 15.09.2002 Stefan Rutzinger <rutziATfs.tum.de>
#
# defines programs to be executed at dell volume/mute buttons events
# loaded at system startup
#

# Volume Up/Down Key
# Set with aumix, this is capable of increment/decrement volume
I8KBUTTONS_UP_CMD="aumix -v +3"
I8KBUTTONS_DOWN_CMD="aumix -v -3"

# Fn-Mute Key
# This is a script which detects mute status and toggles on/off using amixer
I8KBUTTONS_MUTE_CMD="/usr/local/bin/amute"

# Timeout intervall (ms) at which the daemon checkt the button status
# I8KBUTTONS_TIMEOUT=100

# Repeat value for keys, after 250ms delay.
I8KBUTTONS_REPEAT=100



In addition I created a Script which detects the current mute state of the master volume and toggles it. So I have a real mute/unmute function with only one button Fn-Mute.



#
# /usr/local/amute
#
# 15.09.2002 Stefan Rutzinger <rutziATfs.tum.de>
#
# Toggle mute of audio device. Done by amixer, because aumix is not capable
# of setting mute. Problem: amixer can only mute and unmute, but not toggle
#

AMIXER=amixer-0.5

$AMIXER get Master | grep Front | grep mute >/dev/null

case "$?" in
0)
# echo "Audio is muted (off)"
$AMIXER set Master unmute > /dev/null
;;
1)
# echo "Audio is unmuted (on)"
$AMIXER set Master mute > /dev/null
;;
esac



I use the mixer program 'aumix' for increasing and decreasing the master volume and amixer (alsa) for muting and unmuting, because the one function is not implemented in the other mixer program and vice versa.



2. CD-Player/Function Keys

First, the scancodes of the four Function Keys Play/Pause <I01>, Stop <I02>, Forward <I03> and Rewind <I04> must be assinged to the keycodes 129, 130, 131 and 132. For debian sarge this is already set in /etc/X11/xkb/keycodes/xfree86.

Next, any keysym (e.g. F13 .. F16) can be assigned to the keycodes of the Function Keys. This can be done for example system wide in /etc/X11/Xmodmap:



keycode 129 = F13
keycode 130 = F14
keycode 131 = F15
keycode 132 = F16

Now these keys can be assigned to certain events or functions in the window manager.

Outside X, it seems to be more tricky to get access to the Function Keys.



Amendment: I mainly use xmms to play cd's and mp3's, and now I put the keys „x, v, y, b“ to the buttons, as they are the keys to controll the xmms player. It's not optimum, as the xmms needs to be running, and the focus needs to be on it. But it's better than binding a stupid window manager function to them which I use very seldomly.



Appendix: Keyboard Repetition Rate

The keyboard repetition rate of my debian distro is set really slow by default. For some reason a init script to tune it seems to be missing, so I just wrote my own one:



#! /bin/sh
#
# /etc/init.d/kbdrate.sh
#
# 16.09.2002 Stefan Rutzinger <rutziATfs.tum.de>
#
# Set keyboard repetition rate to a non-boring value.

KBDRATE=/sbin/kbdrate

test -x $KBDRATE || exit 0

echo -n "Setting kbdrate: "
/sbin/kbdrate -r 30 -d 250



Link it into /etc/rcS.d to let it run at system boot.

It also needs to be run after every resume event, to put this in /etc/apm/event.d:

#!/bin/bash
# /etc/apm/event.d/kbdrate

if [ "$1" = "resume" ] ; then
/etc/init.d/kbdrate.sh
fi




The IrDA Port

compiled kernel with



CONFIG_IRDA=y
CONFIG_IRLAN=m
CONFIG_IRCOMM=m


and modprobe did not complain while loading the modules. In the bios setup, the 'Infrared Data Port' must be set to one of the four COM interfaces.

But had no chance to test it yet.



The 1394 port

The controller seems to be some Texas Instruments OHCI conform IEEE 1394 controller. But I don't know more than this up to now.



(4) Problems

### these points are valid for 2.2.20 kernel. not tested with 2.4.19. ###

Now I have compiled USB support as modules. As long as I don't need USB this ships around the Problem. And in case, /etc/apm/apmd_proxy can be configured

in a way it unloads / loads critical modules before and after a suspend.

### ###