Quand les plombs ptent : sjt. Debian's Sarge gnu/linux on Toshiba M40X-317


This document, mostly written in November 2005, intends to describe the installation of Debian Sarge onto a Toshiba M40X-317 laptop.

I focused on details that were tricky or unusual ; this document isn't a step by step installation guide for beginners, rather it should help people having matching hardware to tune their debian (or most linux) setup.

Description of the Laptop.

The M40X family at Toshiba's is fairly rich and spread : at almost the same price and same time, when trying to choose the best one, I met some with Celeron others with Pentium-M, some with i915 video chipset, others with ATI Radeon X200 (PCI express ?).

So, at first here's the lspci output (after updating the lspci database with (8) update-pciids) matching my machine :

0000:00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
0000:00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
0000:00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
0000:00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
0000:00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
0000:00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)
0000:00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
0000:00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
0000:06:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
0000:06:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)
0000:06:04.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller
0000:06:04.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller
0000:06:04.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
0000:06:04.4 0805: Texas Instruments PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Secure Digital (SD) Controller

I must say that aiming for stability, I choosed the i915 machine, that also had 1Gb memory and also an Intel(R) Pentium(R) M processor 1.60GHz, rather than the ATI that was (is ?) not yet supported, even by the close-source drivers supplied by the manufacturer.

Shrinking the supplied-in Windows, and partitioning.

My plan was to set a 5Gb partition for the original windows settled on the machine, and everything else for Sarge. If you intent to have only linux on the machine, you can simply partition the disk at your will and skip this step.

The only fast way I found, since I had nothing to preserve on the disk, was to first divide it with the proper sized partitions and to restore the window partition by using the restore disk supplied. The main trick was that the supplied restauration-disk kept erasing the partition table if the first partition wasn't for window, so finally the only attempt that worked was :

  1. boot with Debian Sarge's DVD (you may use F12 key in order to choose the DVD for boot device),

  2. once the ide hardwares are detected, use fdisk to create a single convenient 5Gb, HPFS/NTFS (type 7), primary partition, numbered 1, with boot flag toggled, at the begining of the disk (any other scheme happened to be crushed at the next step...)
    note (02/01/2006) : according to what I discovered about serial-ATA later-on, it should be wise to try to tell the debian-installer to detect ICH6 as a SATA-controller rather than using generic-ide...

    Note that fdisk isn't debian's regular partitioner. As I'm an old dinosaur, I still use it and it is available via the second virtual console that hosts a shell during sarge installation. Beware the naming of devices at this time of installation : the ide disk is somewhere like that: /dev/ide/host0/...../disc instead of the usual /dev/hda).

  3. reboot with the supplied rescue disk and use the advanced tool for restoring the window on that very partition

  4. reboot with Sarge's DVD, and finish partitionning, i.e. added two more primary partitions :

    • a small 24Mb one for the /boot partition,
    • the whole end of the disk (55Gb) for Sarge's root.

    Note that you may need a small additionnal fat32 partition in order to share some datas, like the linux loader, between win and lin (see below)...

  5. reboot again with the Windows restauration disk, and use the small win98 environment that hosts the advanced restauration sofware in order to reinstall a windows master-boot-record. You reach the DOS command-line simply by quiting the restauration sorfware, and then at the prompt :

    W:\ fdisk /mbr

Now, we have a laptop that boots the Windows correctly, and free partitions on which to install Debian. Later-on I'll have to update c:\boot.ini in order to dual boot with Sarge.

Sarge installation from DVD.

Nothing particular to say about installation, every needed hardware was detected and useable during the installation  simply, do not miss the next step if you're sharing the machine winth windows, before the reboot at the end of installation.

Dual Booting.

I couldn't install grub or lilo onto the master boot record -it belongs to windows- so I installed it on the second partition boot sector. In order to boot back on Debian after installation, before rebooting the machine, I saved that boot sector on another machine via the network. To generate that small file I simply used dd :

# dd if=/dev/hda2 of=/tmp/linux.bin bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.071883 seconds (7123 bytes/sec)

# ls -l /tmp/linux.bin
-rw-r-----  1 root root 512 Nov  9 22:23 /tmp/linux.bin

I couldn't manage to read or write on a usb key at this step of installation. Maybe with more knowledge about kernel usb modules I could perform it ? For people who don't have another network machine, it might be wise to have a small regular fat32 partition in order to share the content of that file, since there is no floppy with the laptop.

The next step is to tell windows' boot to offer us a chance to reach the linux loader :

  1. Let the machine reboot with windows

  2. copy the above saved linux.bin onto C:\LINUX.BIN

  3. make the c:\boot.ini appears and be writeable :

    C:\ attrib -R -S -H C:\boot.ini

  4. use notepad and append the c:\linux.bin="my beloved Linux" at the bottom of the file.

    My own looks like this :

    [boot loader]
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows" /noexecute=optin /fast

  5. Now, you can reboot to finish tuning Sarge's installation.

Setting-up X, first step : X11-vesa.

The Toshiba has a nice wide screen, but the default X11 in debian needs some tuning in order to use it.

Aiming to get the nominal 1280x800 resolution of the screen I fisrt installed the vesa driver for X11. By using dpkg-reconfigured xserver-xfree86, I re-configure the XFree86 server, I choosed vesa, auto-detected the mouse, enabled the third button emulation, used advanced monitor detection and supplied those dumb values (I call them dumb because they may cause troubles to the screen if used with silly settings. One should try to reduce those to a safer clock range) :

        HorizSync    31.5-90
        VertRefresh  45-110

Yet the result is still only 1024x768. I had to create a new Monitor entry in /etc/X11/XF86Config-4 to be able to reach 1280x800 (taken from another i915 laptop page) :

Section "Monitor"
        Identifier   "monitor0"
        VendorName   "Generic"
        ModelName    "Flat Panel 1280x800"
        HorizSync    31.5-90
        VertRefresh  45-110

        # Dell D800 and few Inspiron (16/10) 1280x800
        ModeLine "1280x800"  147.89  1280 1376 1512 1744  800 801 804 848
and tune accordingly the mode selection in the same file :
        SubSection "Display"
                Depth           24
                Modes           "1280x800" "1024x768" "800x600" "640x480"

Here's the complete XFree86-4-vesa.

Installing a better kernel.

Though debian's kernel is very ok, it might not be fresh enough to get every recent hardware up and on line. I switched to linux- (note (02/01/2006) : this step might as well be merged with the next paragraph) and used this setup : most of the hardware is detected, still I need some more time to fully state that the hardware is ok.

The main reason for switching to a recent kernel is for getting an i915 agp module in, so that some 3D acceleration can be set, via direct rendering (DRI).

Here's the .config I used.

I also appended idebus=66 in my kernel boot param by adding it to lilo.conf. Some more tunings with hdparm should probably be welcome, I'll dig that soon.

/etc/lilo.conf (extract) :


Installing a better kernel : with SATA enabled.

A few month later, I struggled a little bit with hdparm because I really had the feeling the discs were too slow, and I realised that the machine doesn't use the ICH6 as an ide controller, but rather as a Serial-ATA controller. So toggling libata support in the kernel (in the scsi part of drivers) brought a huge performance improvement : about 30MB/s instead of 3MB/s when transfering datas from hard-disk !

The tricky point was that the generic EIDE support from kernel was able to show the disk during installation though it's support wasn't optimal. Now, when we switch from ide to SATA support, we have to rename every references to the disks, since /dev/hda is now seen as /dev/sda...

I had to change /etc/fstab and /etc/lilo.conf. Both changes are very tricky, so backup each modified file before modification, and verify you have a complete independent way of booting back the machine, with knoppix for example.

The .config for linux-2.6.15.

In order to see the DVD through SATA, I had to tell libata to take care of ATAPI devices, so now my entry in lilo.conf is like this :

/etc/lilo.conf (extract) every "boot" and "root" changed in order to match sata rather than ide... :







        append="idebus=66 libata.atapi_enabled=1"


Setting-up X, second step : Xorg.

Sarge doesn't include Xorg (yet ?), so I downloaded some Xorg backports from Debian Backports, (they used to be there). After asking aptitude to install xserver-xorg and all new packages needed, I configured the Xorg server by asking i810 driver, told there were 128000 kilobytes of memory, the i810 driver isn't aware about kilobyte and uses bytes instead.

After tweaking the Modeline section the same way as X11 vesa driver, I managed to get some decent 3D acceleration with that card. Tuxracer is playable, but it doesn't compare with my Nvidia Ge4200.

Here's the corresponding xorg.conf.

Intel Wireless ipw2200.

The Intel wireless component of the m40x has support shipped with recent kernels, but still needs a firmware supplied and locked by Intel. Read the /usr/src/linux/Documentation/networking/README.ipw2200 supplied with kernels to learn more about it.

In short : I had to compile ipw2200 as a module rather than a build-in feature so that the firmware would load properly at init-time. The firmware also have to match the release number of the ipw2200 driver supplied with the kernel. For example, when writting those lines, I'm using firmware 2.4 matching the 1.0.8 relase of ipw2200 that is supplied with kernel...

For filsystem firmware location, unzipping the firmware into /lib/firmware does the trick.

The result.

The machine is now fairly useable, I still have to validate a lot of hardware in it, but the first goal : getting a decent cheap 3D laptop working with linux, is reached.

Please, feel free to mail me comments, and also to come back soon : I'll update this page as soon as I can provide rock-solid statements about the M40X's components.

Some ressources.

rss-feed for this topic

updated  January 3rd 2006 - Jean-Daniel Pauget Quand les plombs ptent : sjt.