Linux (Gentoo Linux) on the notebook Dell Inspiron 9400 / Inspiron 9400 Royal - HOWTO

from Niels Dettenbach - nd@syndicat.com - Syndicat Internet & Open Source

The DELL INSPIRON 9400 Royal Notebook

The Dell 9k4 (royal) is in state a very modern device with a lot of new and sometimes from linux still unprovided hardware. In the time of the first writing this HOWTO are some of the drivers under strong developement - so every weeks comes updates or news to the different driver projects.

This HOWTO is updated frequently with the target to be your definitive guide for running Gentoo / Linux on the Dell I9k4 (royal). Please help us and other Dell I94k users and share your contributions to this HOWTO too.

last update is from 03-12-2008

This HOWTO

This is my Linux on Laptops HOWTO. It was written from my experiences with the Gentoo distribution but the principe and most configs should usable with any other Linux distributions as well with some corrections. All my test are started first under the linux kernel >=2.6.14 (with udev) - my currently used kernel is the 2.6.22-suspend-r2 with working software and hardware suspend2.

Steps wich are not especially for this device and usually running 'out of the box' with linux without needed (or different) configuration are not covered from this HOWTO. For general Gentoo installation you should read the official Gentoo Linux x86 Handbook or - for the advanced user - the Gentoo Linux x86 Quick Install Guide. I will only show the things wich are required to get the most of the Dell hardware up and configured.

News / issues

Updates on this HOWTO

This document is changing as Gentoo seems to work better and better on this DELL over the time. A lot of drivers are now in the official portage tree wich was in the first days of this HOWTO get by hand from different sources on the net and has to fiddle byself.

Last Changes / Updates

This HOWTO is updated and revided in state of the Gentoo current (2008.1).

Older versions of this HOWTO and config files for older kernels - with more general and complex intallation hints - could be found in our HOWTO file archive.

Hardware overview

Gentoo Linux Installation

This HOWTO uses the standard Gentoo Linux Installation and follows the Gentoo-Linux Installation Manual (for x86 arch) and just adds Dell I9k4 notebook model specific stuff to these instructions. So please open, read and follow (if not done) the:

Depending from your needs you can use / read other related docs and manuals like wireless, bluetooth, KDE, software, System Administrtion a.o.. The best starting point is

Depending from your way of installation (Gentoo offers a lot of different from wich you can choose) you need the Gentoo installtion medium (disk) - downloaded from one of the gentoo mirrors in the nearest of your internet connection. If you have fast connection you should prefer a stage2 installation with the install-x86-minimal-2006.1.iso (~50 MB).
If you have no or a slow internet connection you should get the full installation disk livecd-i686-installer-200x.x.iso (~650 MB) - from somewhere else.

compiler flags and make.conf

I've set the following modified optimization flags in my /etc/make.conf to get the compiled code fitted to the Dell 94k cpu hardware at most my knowledge allow that:

CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
This config should a stable and fast in any case. A second working one with more optimization flags on could be:
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium-m -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"

But works slower for my setup (especially vmware wont work usable fast enough). It is not easy to find the correct compiler options for the Intel CPU (cpuflags don't work too) - it seems undocumented until today. If there someone has better performance optimized options please let me know...

build your own kernel

In order to get you optimized linux kernel with all neccessary drivers (and optional suspend2 functionality) you have to build your own kernel as usual.

Here you should be at the chapter Installing the Kernel of your Gentoo Installtion Guide.
Download the kernel sources, download and use our prepared kernel config file (f.i. config-2.6.24-gentoo-r3) , compile and install it into your boot loader - like

emerge -av sys-kernel/suspend2-sources
cd /usr/src/linux/
cp /path/of-our/config-file ./.config
make && make modules_install && make install

If you use lilo instead of the more comfortable modern grub as your bootloader run

lilo

to write the changed kernel config. Grub needs no reload.

basic drivers and modules

system and CPU

To get the SMP functionality under the Intel Duo core up 2 run be shure to use or compile your linux kernel with SMP and HyperThreading support as a i386 / PIV family processor. Because the CPU provides the speedstep tech. for power saving you can compile in this options into your kernel too. If needed you will find my 2.6.24-gentoo-r3 kernel .config here for download and fitting to your needs. Copy this to your kernel source directory (i.e. under /usr/src/linux/) and make a make oldconfig to use my .config with your own kernel source.

SATA hard disk subsystem

In order to get the linux system properly booting you have to compile in the SCSI support and the pii-sata drivers (SCSI -> low level drivers -> SATA -> Intel PIIX/IHC SATA support) into your kernel or - in the case of module - you have to load it into you ramdisk at bootup. I prefer - even when i use ramdisks at boot - the compiled in driver to prevent problems during the boot process.

get external needed software

emerge the required drivers ports (the 'short' way on gentoo)

Just

 emerge -av nvidia-drivers ipw3945 ipw3945d ipw3945-ucode ipw3945-firmware \
 cpuspeedy alsa-lib alsa-oss alsa-utils alsa-tools alsa-headers \
 alsa-plugins nvidia-settings cpufreqd bluez-utils bluez-libs
 

For some drivers you need still a "ACCEPT_OVERLAY="~x86" to get new enough versions installed:

(emerge alsa-drivers is obsolete with the current kernel 2.6.22 because alsa is updated in kernel)

to bring in the needed drivers (from the portage tree) in the net on your system.


load the kernel modules

Load the kernel modules first time by hand with

 modprobe -v modulename
 

This is my /etc/modules.autoload.d/kernel-2.6.

The others would be loaded from other init (like ALSA) scripts or the coldplug / hotplug mech. byself. For further kernel rebuilds or updates i prefer the gentoo tool module-rebuild wich take care of automatic rebuild / update of all emerged kernel modules by portage in case of kernel rebuilds or updates. After

emerge module-rebuild
Give a
module-rebuild populate
To let the portage system figure out wich drivers it has to (re)emerge in case of any later kernel builds. After such build just put in
module-rebuild rebuild
To build all the modules against the new freshen kernel tree. Take a look in module-rebuild -h wich is self expl. enough for itself.


Ethernet

Your ethernet card drives is the b44 now - older kernels use the bcm4400 driver from the Gentoo portage tree.

modprobe -v b44
ifconfig

should give you the eth0 interface.


Wireless Intel Centrino drivers

UPDATE:

The ipw3945 drivers and subsystem are now available in the GENTOO portage tree. ONLY if you run in problems with them you have the option to get them from the source and build them by hand.

To make shure the Intel wireless deamon is starting at bootup, do a

rc-update add ipw3945d default

Bring em up for now with:

/etc/init.d/ipw3945d start

If all goes right (driver ipw3945 loaded and ipw3945d is up) you should see now a new wireless ethernet interface eth2 (ifconfig -a / iwconfig -a)

If you re networking with WPA/WPA2 wifi encryption you have to emerge -av net-wireless/wpa_supplicant and configure it for your nets too.

In this state the needed drivers for the 3945 WIFI device are under developement and not part of actual kernels and not in the portage tree. You have two options to install these drivers for you Dell 94k:

(the following chapter is obsolete but not removed for reference)
build them by generic way
(obolete from now - not longer needed anymore!)

Fetch the drivers from the SF project site on http://ipw3945.sourceforge.net/ and follow the README and INSTALL documents for installation hints. As documented therein - in order to get this drivers installed, you have to fetch the newest IEEE 802.11 sources from too. The install script of the ieee subsys will remove some original ieee modules from your kernel, switch off the ieee modules from your .configure file and substitute them with the own / new one. It would be wise to make a copy of your /usr/src/linux to anywhere - in case you like to rebuild the kernel on my sys it wont work with these modified sources.

build them by emerge (gentoo way)

In time of writing this HOWTO there was still some overlay gentoo ports around wich could be used to install these drivers on the gentoo way. Just take a look if them are still in your portage tree - otherwise fetch them from the net into your overlay tree. You have to place the portage ebuilds into your overlay directory and configure them as you configure all overlay ebuilds (if this is your first contact with overlay ebuilds take a look in the gentoo docs). The ebuilds could be fetched from http://ipw3945.sourceforge.net (questions to me welcome).


Touchpad and Mouse

To bring up your touchpad and/or your external mouse you can use the mouse deamon gpm:

emerge sys-libs/
rc-update add gpm default

Make shure to set

MOUSE=ps2
MOUSEDEV=/dev/input/mice

in /etc/conf.d/gpm - then start the mouse deamon by

/etc/init.d/gpm start

NVIDIA GeForce 7800 Go Graphics adapter and X11 / XOrg

The nvidia adapter runs with the kernel drivers as well - but things like hardware acceleration and some other nice things works only with the original nvidia drivers from http://www.nvidia.com (download area or now from the portage tree) - in the current portage you dont need to download the NVidia drivers by hand anymore. You can use this original nvidia drivers by the portage system with the ebuilds nvidia-drivers (should be done from above) wich installs all the driver stuff and configure your xorg.conf plus the openGL config automatically.

I use the following NVidia module options (to set in /etc/modules.d/nvidia)

options nvidia NVreg_NvAGP=1 NVreg_Mobile=1 NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1

Don#t forget to make a

update-modules

to load your changes here.

If you install the drivers from the origs you have to change the 'driver' in your /etc/X11/xorg.conf as follows:


# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (root@gongo)  Sun Mar 18 01:30:23 CET 2007

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "0"
EndSection

Section "InputDevice"

    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "Auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LPL"
    HorizSync       30.0 - 75.0
    VertRefresh     60.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"

        # test aus forum:
    Identifier     "Videocard0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce Go 7800"
    #Option        NvAGP "1"
    Option         "RenderAccel" "true"			# hardware Render acceleration
    Option         "AllowGLXWithComposite" "true"	
    Option         "backingstore" "true"		#[] prevent artifacts?
    Option         "TripleBuffer" "true"
    Option         "AddARGBGLXVisuals" "True"
    Option         "Coolbits" "1"
    Option         "NoLogo" "1"				# prevent NVIDIA startup Logo
    Option         "DPMS" "TRUE"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "metamodes" "1920x1200_60 +0+0"
    Option         "UseEvents" "false"
    Option         "RenderAccel" "true"
    Option         "DisableGLXRootClipping" "True"
    Option         "AddARGBGLXVisuals" "True"
    SubSection     "Display"
        Depth       24
        Modes      "1920x1200" "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "enable"
EndSection


Don't forget the glx module for 3D graphic acceleration under X11. Just make shure to have set

...
Section "Module"
        load "glx"

to get the glx accelerator driver up.

The mouse pointer device works on me with the above xorg.conf for the touchpad and external USB mouse as well with. I can plug off or in while X11 is running and both pointer devices could be used (kernel module "usbmouse" must be loaded).

If you expect problems with your mouse / pointer (/dev/inout/mice) device, try the psaux config like:

Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"
    Driver      "mouse"
    Option      "Protocol"    "PS/2"
    Option      "Device"      "/dev/psaux"

In older X11s you have to place this somewhere (at the end?) of your xorg,conf to give all users access to DRI:

 Section "DRI"
     Mode 0666
 EndSection
 

To configure your opengl subsys to your NVIDIA card make a:

  eselect opengl set nvidia
 
so your X11 sould work as needed.


Intel HDA sound

Unti the 1.11 ALSA version i got different problems with the driver and sound system. Sometimes it hangs and most it didn't gives any sound out. Several other HOWTOs and postings around talks about problems like not proper function of the Mic and line inputs or with the bass speaker. I got it solved as far as i can test it.

So i have contacted to the ALSA devel lists and fiddeled with some patches on the CVS sources to get the SigmaTel up to work. After the next ALSA update this problem was fixed (see CHANGES of ALSA 1.0.10 to 1.0.11) - there was a bunch of several works on snd_hda_intel driver. While other notebook user have to set different extra module options on the Dell 94k intel_hda (SigmaTel) are no module options needed anymore. To save time by (re)emerging the alsa drivers you can bring in ALSA_CARDS="hda-intel" to your make.conf (in my case i lost the bass channel and control with this option - so i work without this currently).

After installing the drivers you have to

alsaconf
your sound devices. Don't forget to unmute the mixer levels because the newer ALSA drivers load the sound system in muted state (i.e. use alsamixer). To store your mixel levels permamently use
alsactl store 0
By
rc-update add alsasound default 
to start the sound at boot time.

Some peoples reported that they have to use options snd-hda-intel position_fix=1 in the module config file /etc/modules.d/alsa

echo "options snd-hda-intel position_fix=1" > /etc/modules.d/alsa
modules-update

CD- and DVD burner drive

Cdrecord shows it as a ATAPI device at 0,0,0. So you have to configure it in /etc/defaults/cdrecord or /etc/cdrecord.conf as

cdrom=	ATAPI:0,0,0     -1      4m      ""


MMC/SD Card Reader

The card reader (Ricoh Co Ltd R5C822) works with kernels since 2.6.19 but is currently in developement state. However - it seems to work for me. If you use our kernel config for >=2.6.22 (and suspend2) kernels the drivers are still there.

internal Modem

The internal modem should work with the snd-intel8x0m driver module from the alsa project. The author has not testet the modem functionality because of lack of a non-digital (analog) phone line.

Do activating the driver (if not done as in above step) by modprobe snd-intel8x0m

Please email me if you have more experiences or details about the modem stuff.

Laptop special Buttons

(under work until now)
All the front panel buttons (media buttons) are providing special keycodes when pressed - so them could be used with setkeycodes.
Depending from your used GUI, window manager and media applications there could no universal configuration provided for all users. So i will try to give you some ideas of how the buttons could be used for your favorite applications.
More details will follow soon here...

update from one of our older HOWTO kernels

Otherwise you have to set these kernel options and rebuild your kernel:

Code maturity level options  ---> 
     [*] Prompt for development and/or incomplete code/drivers
Device Drivers  --->
     MMC/SD Card support  -->
          <*> MMC support
          [ ]   MMC debugging
          <*>   MMC block device driver
          <*>   Secure Digital Host Controller Interface support  (EXPERIMENTAL)
          < >   Winbond W83L51xD SD/MMC Card Interface support
File systems --->
     <*> DOS FAT fs support
     <*>   MSDOS fs support
     < >     UMSDOS: Unix-like file system on top of standard MSDOS fs
     <*>   VFAT (Windows-95) fs support
 

Add your user to the disk group to give him access to the medias:

gpasswd -a  disk

Suspend2 on the Dell Inspiron 9k4 royal

(alpha state - usuable but still something correctable in some parts)

Supend2 seems now working on the Dell Inspiron 9400 as suspend 2 RAM and suspend 2 disk.

Personally i use suspending with the notebook lid and as auto suspending in critical battery power state. Because i have to use my book often mobile for a small task in less time - so booting is not nice and often just to long to wait for me (and booting is significantly consuming more battery power too) it is very nice for me to just drop down the notebook lid and the sytem is suspending to disk in 2-4 seconds. As the book is suspendig to disk the power is "switched off" so the suspended OS should be available instantly over a long time without required reloading of battery power.

When reopening the book my KDE desk is back within the same time - just a cool feature...

I prefer to use a separate disk (linux swap type) partition on the disk (/dev/hda5) wich i have created by shrinking the former partitions and i set it in the kernel-config in:

 --- Suspend2
        ---   Image Storage (you need at least one allocator)
        [*]   File Allocator
        [*]   Swap Allocator
        ---   General Options
        (/dev/sda5) Default resume device name
        [*]   Allow Keep Image Mode
        [*]   Replace swsusp by default

as the default suspend2 partition. You have to change it to your suspend partition or delete it in the kernel config to set it by hand in the bootloader. Instead of the partition you can use a swapfile for suspending.

For installing suspend2 please follow the Gentoo HOWTO Software Suspend v2 and use the special instructions here. If you used our last kernel-config file with the suspend2-sources for your own kernel all the required kernel related stuff is still ready. Otherwise:

emerge -av acpid sys-kernel/suspend2-sources
rm /usr/src/linux
ln -s /usr/src/linux-2.6.24-gentoo-r3 /usr/src/linux
cp config-2.6.24-gentoo-r3 /usr/src/linux/.config
cd /usr/src/linux
make && make modules_install && make install

to build you a current kernel with suspend2 features (Dont forget to chage, fit or delete the default suspend partition / file to your needs!).

Download and use the following configs for your Dell 9k4 royal from me:


known issues on the suspend2

Currently my suspend2 installation have some issues wich should be fitted in the next. Any help from your side is very welcomed here - please send me a short mail.


Dell laptop fan control

The former i8k tools for Dell Inspiron laptops won't work for me on the 9400 series.
Lee Wilmot wrotes a userspace deamon / tool dellfand wich allows to control the laptop cooling fans within two speed steps - depending from two selected device temparatures.

» dellfand project page - with download, install instructions and usage

dellfand installation and usage

For testing purposes you can call dellfand from command line in the foreground with:

dellfand 0 2 30 38 48
Normal usage is:
dellfand [mode] [sleep-seconds] [off low high]

You can start the deamon with

/etc/init.d/dellfand start


TODO

There are several things to do to bring the full notebook hardware up 2 run under Linux. If you have some ideas or own better or newer experiences on the Dell 9k4 royal please send me your tips and informations to help me to fullfill this HOWTO for the Linux user community. Thank you!


Links and useful stuff

other Dell 9k4 HOWTOS


special thanks to... ...the Alsa project team, Syndicat, Lee Wilmot, Sascha Teske, Bill Giannikos a.o.

Date: 03-06-2006
Last Update: 03-07-2007 Author: Niels Dettenbach - nd@syndicat.com
Syndicat IT&Internet
distributed under GPL

Linux On Laptops TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones