# thinkpad x40

## melbaum

Has anyone put Gentoo on the ibm thinkpad x40? I'm wondering about the external monitor support. I want to buy one for the size, but only if I can put one desktop on the tiny LCD and a different one on the external monitor when I'm at work. not mirrored, not xinerama, but A and B. I know it can be done on the X31 in xp, but the X31 has an ATI card where the X40 uses the Intel Extreme 2. I'd compromise as far as buying the X31, but not further to entering xpland.

thanks for any help!

Michael

----------

## geertn

Yes, I did this. I currently have trouble setting up bluetooth, all other stuff basically works. (except framebuffer)

----------

## melbaum

Thanks.  Did you manage it on the X31 or the X40. I found some web-clues on the Intel Extreme 2 that says it's not possible to run the external monitor at all, and a page on sourceforge with a development project for just that purpose:

http://sourceforge.net/projects/i855crt

Could you post the XFree86Config, or whatever else was needed to make it work?

----------

## Gherald2

I have an x40 and am very pleased with it so far but I use the vesa driver because it doesn't add garbage to the top of the screen like the Intel every time you close the lid.  That garbage isn't a huge problem...  you just have to Ctrl+Alt+F# to the console and then back to X for it to go away, but I found it annoying enough to resort to vesa.

Sound and gigabit work nicely; can't comment on the wireless or bluetooth yet but I was lucky enough to get an Atheros a/b/g chipset (pcconnection.com where I bought it only said "b/g" so I had expected something nastier like an Intel)

The optional docking station with a DVD-CDRW combo is nice, though I haven't figure out yet if there is a way to hot swap it w/o crashing the system.

Wish I could tell you about using an external monitor but I have many desktop machines with large screens so I don't think I'll get around to that anytime soon.

The net is raving with reviews so I won't bother you with specifics but the bottom line is that other than the display driver issue, which can only improve viz. the sourceforge page you linked to, I have nothing negative to say about this notebook... it just plain rocks.

----------

## geertn

I have the X40. I can do presentations with beamers allright, but indeed there is garbage at the top of the screen. I can run enemy-territory with reasonably fps:)

My xconfig:

```

bash-2.05b# cat /etc/X11/xorg.conf

# $XdotOrg: xc/programs/Xserver/hw/xfree86/xorgconf.cpp,v 1.1.6.1 2004/04/02 21:47:17 eich Exp $

#

# Copyright (c) 1994-1998 by The XFree86 Project, Inc.

#

# Permission is hereby granted, free of charge, to any person obtaining a

# copy of this software and associated documentation files (the "Software"),

# to deal in the Software without restriction, including without limitation

# the rights to use, copy, modify, merge, publish, distribute, sublicense,

# and/or sell copies of the Software, and to permit persons to whom the

# Software is furnished to do so, subject to the following conditions:

#

# The above copyright notice and this permission notice shall be included in

# all copies or substantial portions of the Software.

#

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL

# THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF

# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

# SOFTWARE.

#

# Except as contained in this notice, the name of the XFree86 Project shall

# not be used in advertising or otherwise to promote the sale, use or other

# dealings in this Software without prior written authorization from the

# XFree86 Project.

#

# $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $

# **********************************************************************

# This is a sample configuration file only, intended to illustrate

# what a config file might look like.  Refer to the XF86Config(4/5)

# man page for details about the format of this file. This man page

# is installed as /usr/share/man/man5/xorg.conf.5x

# **********************************************************************

# The ordering of sections is not important in version 4.0 and later.

# **********************************************************************

# Files section.  This allows default font and rgb paths to be set

# **********************************************************************

Section "Files"

# The location of the RGB database.  Note, this is the name of the

# file minus the extension (like ".txt" or ".db").  There is normally

# no need to change the default.

    RgbPath     "/usr/X11R6/lib/X11/rgb"

# Multiple FontPath entries are allowed (which are concatenated together),

# as well as specifying multiple comma-separated entries in one FontPath

# command (or a combination of both methods)

    # For XFS, uncomment this and comment the others

    # FontPath  "unix/:-1"

    FontPath    "/usr/share/fonts/local/"

    FontPath    "/usr/share/fonts/misc/"

    FontPath    "/usr/share/fonts/75dpi/:unscaled"

    FontPath    "/usr/share/fonts/100dpi/:unscaled"

    FontPath    "/usr/share/fonts/Type1/"

    FontPath    "/usr/share/fonts/TTF/"

    FontPath    "/usr/share/fonts/CID/"

    FontPath    "/usr/share/fonts/Speedo/"

    FontPath    "/usr/share/fonts/75dpi/"

    FontPath    "/usr/share/fonts/100dpi/"

# ModulePath can be used to set a search path for the X server modules.

# The default path is shown here.

#    ModulePath "/usr/X11R6/lib/modules"

EndSection

# **********************************************************************

# Module section -- this is an optional section which is used to specify

# which run-time loadable modules to load when the X server starts up.

# **********************************************************************

Section "Module"

        Load    "v4l"

        Load    "GLcore"

        Load    "bitmap"

        Load    "dbe"

        Load    "ddc"

        Load    "dri"

        Load    "extmod"

        Load    "freetype"

        Load    "glx"

        Load    "int10"

        Load    "record"

        Load    "speedo"

        Load    "type1"

        Load    "vbe"

        Load    "xv"

        Load    "pex5"

EndSection

Section "dri"

Mode 0666

EndSection

# **********************************************************************

# Server flags section.  This contains various server-wide Options.

# **********************************************************************

Section "ServerFlags"

# Uncomment this to cause a core dump at the spot where a signal is

# received.  This may leave the console in an unusable state, but may

# provide a better stack trace in the core dump to aid in debugging

#    Option     "NoTrapSignals"

# Uncomment this to disable the <Crtl><Alt><Fn> VT switch sequence

# (where n is 1 through 12).  This allows clients to receive these key

# events.

#    Option     "DontVTSwitch"

# Uncomment this to disable the <Crtl><Alt><BS> server abort sequence

# This allows clients to receive this key event.

#    Option     "DontZap"

# Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching

# sequences.  This allows clients to receive these key events.

#    Option     "DontZoom"

# Uncomment this to disable tuning with the xvidtune client. With

# it the client can still run and fetch card and monitor attributes,

# but it will not be allowed to change them. If it tries it will

# receive a protocol error.

#    Option     "DisableVidModeExtension"

# Uncomment this to enable the use of a non-local xvidtune client.

#    Option     "AllowNonLocalXvidtune"

# Uncomment this to disable dynamically modifying the input device

# (mouse and keyboard) settings.

#    Option     "DisableModInDev"

# Uncomment this to enable the use of a non-local client to

# change the keyboard or mouse settings (currently only xset).

#    Option     "AllowNonLocalModInDev"

# Set the basic blanking screen saver timeout.

    Option      "blank time"    "10"    # 10 minutes

# Set the DPMS timeouts.  These are set here because they are global

# rather than screen-specific.  These settings alone don't enable DPMS.

# It is enabled per-screen (or per-monitor), and even then only when

# the driver supports it.

    Option      "standby time"  "20"

    Option      "suspend time"  "30"

    Option      "off time"      "60"

# On some platform the server needs to estimate the sizes of PCI

# memory and pio ranges. This is done by assuming that PCI ranges

# don't overlap. Some broken BIOSes tend to set ranges of inactive

# devices wrong. Here one can adjust how aggressive the assumptions

# should be. Default is 0.

# Option   "EstimateSizesAggresively" "0"

        Option "AllowMouseOpenFail"

        Option "RandR" "on"

EndSection

# **********************************************************************

# Input devices

# **********************************************************************

# **********************************************************************

# Core keyboard's InputDevice section

# **********************************************************************

Section "InputDevice"

        Identifier      "Keyboard0"

        Driver          "keyboard"

        Option          "CoreKeyboard"

        Option          "XkbModel"      "pc105"

        Option          "XkbLayout"     "us"

EndSection

Section "InputDevice"

        Identifier      "Mouse0"

        Driver          "mouse"

        Option          "CorePointer"

        Option          "Device"                "/dev/input/mice"

        Option          "Protocol"              "ImPS/2"

        Option          "ZAxisMapping"          "4 5"

EndSection

# **********************************************************************

# Monitor section

# **********************************************************************

Section "Monitor"

        Identifier      "Monitor0"

        HorizSync       28-49

        VertRefresh     43-72

        Option          "DPMS"

EndSection

# **********************************************************************

# Graphics device section

# **********************************************************************

Section "Device"

        Identifier      "Card0"

        Driver          "i810"

        VideoRam        16672

        Option "Accel"

EndSection

# **********************************************************************

# Screen sections.

# **********************************************************************

Section "Screen"

        Identifier      "Screen0"

        Device          "Card0"

        Monitor         "Monitor0"

        DefaultDepth    16

        SubSection "Display"

                Depth           1

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

        SubSection "Display"

                Depth           4

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

        SubSection "Display"

                Depth           8

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

        SubSection "Display"

                Depth           15

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

        SubSection "Display"

                Depth           16

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

        SubSection "Display"

                Depth           24

                Modes           "1024x768" "800x600" "640x480"

        EndSubSection

EndSection

# ServerLayout sections.

# **********************************************************************

# Any number of ServerLayout sections may be present.  Each describes

# the way multiple screens are organised.  A specific ServerLayout

# section may be specified from the X server command line with the

# "-layout" option.  In the absence of this, the first section is used.

# When now ServerLayout section is present, the first Screen section

# is used alone.

Section "ServerLayout"

        Identifier      "Layout0"

        Screen          "Screen0"

        InputDevice     "Keyboard0"

        InputDevice     "Mouse0"

EndSection

```

----------

## melbaum

Thanks. I'd almost given up on the X40. Still, what I want/need is to put DIFFERENT windows and applications on the LCD and external monitor. Xinerama would be fine, or something more primitive. It would be nice to be able to drag them from one space to the other, but not absolutely necessary. Mirroring the LCD to a beamer is really a lower priority since I could use another OS (in silent shame) for the occasional presentation.

----------

## noleti

 *Gherald wrote:*   

> 
> 
> Sound and gigabit work nicely; can't comment on the wireless or bluetooth yet but I was lucky enough to get an Atheros a/b/g chipset (pcconnection.com where I bought it only said "b/g" so I had expected something nastier like an Intel)

 

an atheres here too, although it should be an Intel 2200BG.. I wonder if there are any x40 with the intel chipset. But i wont complain, it just worked after 5 minutes!

----------

## Gherald2

Hmm, what's the quickest way to get it working? 

I emerge net-wireless/madwifi-driver-0.1_pre20040514 but...

```
root # modprobe ath_pci

WARNING: Error inserting ath_hal (/lib/modules/2.6.7-gentoo-r8/net/ath_hal.ko): Invalid module format

WARNING: Error inserting wlan (/lib/modules/2.6.7-gentoo-r8/net/wlan.ko): Invalid module format

FATAL: Error inserting ath_pci (/lib/modules/2.6.7-gentoo-r8/net/ath_pci.ko): Invalid module format
```

----------

## noleti

i used the cvs access to get the latest driver, sorry i cant remember where i have got the links...

----------

## noleti

this is getting a bit offtopic, but still fits the topics title...

I used the xorg-config from geertn, but when i suspend with apm by closing the lid, more often than not the x-session is messed up when resuming. I found out that with the vesa-driver enabled in the xorg-conf this wouldnt happen, so i decided to use them, resulting in getting only ~250 frames from glxgears instead of ~1300. Also the i810fb doesnt work for me but the vesa does. Has anyone managed to get either Problem solved?

A useful hint: you can configure the navpoint to act like in Win by adding "EmulateWheel" "on" and "EmulateWheelButton" "2" to your xorg.conf .But this seems to disable the wheels of external mouses...

Im also al little bit uncertain if my approach to frequency scaling is right, I used APM and userland scheduling with cpudyn and cpufreqd, but the behaviour is odd. Has anyone got it working?

----------

## Gherald2

I only use the vesa driver, both for X and fb.... I went through a long period of time where that was the only driver that worked on my lastest-and-greatest desktop Radeons, so I'm kind of used to the idea.  It's not a problem for me on this laptop, as I have no intention of using it for gaming.

Thanks for the emulate wheel tip, I think I'll do that since I rarely use an external mouse.

As for frequency scaling, I've got it to work in the following fashion:

1) Turn the laptop on with the AC plugged in, and it goes to 1198 mhz

2) Turn it on w/o AC and it goes to 600 mhz.

If you need to switch, reboot!

Let me know if you get it to actually work  :Smile: 

PS. Should ACPI be completely disabled for apm to work properly?  Right now I'm depending on a simple alias to check power status:

```
acpi="cat /proc/acpi/battery/BAT0/*; acpi -V"
```

I'm not really sure how I'd do that with APM... all my other machines have working ACPI so that's what I'm used to.

----------

## noleti

if found the link to the thread with the EmulateWheel here

IMO ACPI should be disabled completely... APM tells me my battery status as well,try /proc/apm. My little applet (xfce4-batterymon) work with that, too.

besides, who also accidentaly killed his IBM-toolpartition while installing Gentoo? I only moved it with PQ Partition Magic... more space for Linux! (I also heard IBM ships CD´s with the Image for with within warranty)

Another thing not working: the atheros LED  :Sad: 

A friend of me has the T41p with the same WLAN-Chipset an it works for him...

@Gherald: got the atheros to work? I also found this again

Back to the external Monitor: When I push the button the output changes from notebook to external Monitor, but neither they both show the same nor 2 different desktops...

last but not least: i found somewhere that enabling suspend to disk should be easy... rereading the docs from ibm i discovered that what the guy says might be very well true, the docs say the same (for win<2000&XP). Tonight i will move my Win partition and try his suggestions...

----------

## Gherald2

I heard that to enable the wifi LED you have to do

```
export COPTS=-DSOFTLED
```

before compiling the driver.  The T41 probably has a "HARDLED" or somesuch, meaning it is hardware controlled...

Speaking of compilation, I fetched the CVS source but have no clue how to poceed other than running "make", which isn't very helpful and gives me old .o style modules which of course also cause "Invalid module format" errors when I try to modprobe them.

Is there a guide for this sort of things somewhere, or can you just ell me what you did?

----------

## noleti

i know the -DSOFTLED variable, but i just didnt work for me...

about your Problem: maybe it the kernel you are you using? I am running 2.6.5-gentoo-r1 (because of problems with the cisco vpn client in 2.6.7). and, yes, building from cvs is only make && make install. Have you enabled wireless network interfaces in you kernel?

I uploaded my .config for reference.

Apart from that: I GOT HIBERNATION TO WORK!

[Warning - May mess up your thinkpad - you should know what you do]

I cant believe its so easy, i love those thinkpads...

Here is how:

1. Mess up your Partitions: Create a primary partition right at the start of your Harddrive with the type A0 (thinkpad hibernate or something like that) should be as big as your Ram an some megs spare

2.  Get this Utility. Compile it an run it without options to get help. 

3. Just run tphdisk 550>/dev/hda1

4.reboot

5. Press Fn+F12 and watch in awe how he hibernates...just like that!

Many thanks go to jcs at this site about OpenBSD on the x40

Time it takes to hibernate: ~35 secs with 512 MB RAMLast edited by noleti on Mon Jul 12, 2004 2:56 pm; edited 4 times in total

----------

## Gherald2

Hmm, how long does it take to suspend to disk with 512mb?  I have 1.5gb so I'm not sure it's worth the trouble of setting up...

----------

## noleti

my hdparm says ~20MB/s-> 550 MB in 27 seconds if the RAM is full... but i think hes faster, i hope he saves only what is in RAM. I will stop the time for you  :Very Happy: 

But hibernate should be faster than loading it all again, just a guess. 

dont miss my link the my config in my above post, i was just editing it as you replied

/edit: top says 240 MB RAM used, he takes 35 sec to suspen->he saves all RAM->for you its gonna be 90 seconds  :Sad: 

----------

## geertn

I use speedfreqd in combination with ACPI to set the frequency scaling with the workload. Works fine. Also use ipw2100 drivers. Kernel 2.6.7.

Problems are now: 

- Keyboard is sometimes messed up

- Bluetooth does not work. Which driver do I need?

Dual monitor I dont know, guess I should be diving into it also.

----------

## noleti

unluckily i havent the onboard bluetooth, but according to this it should be easy

----------

## geertn

Well I have been fiddling with it, but I get the following usin gthe usb-hci driver in the 2.6.8-rc2 kernel:

```

Bluetooth: HCI USB driver ver 2.6

usb 4-1: adding 4-1:1.1 (config #1, interface 1)

usb 4-1:1.1: hotplug

kobject_register failed for hci_usb (-17)

 [<c01e55db>] kobject_register+0x5b/0x60

 [<c025b000>] bus_add_driver+0x50/0xb0

 [<c025b5ef>] driver_register+0x2f/0x40

 [<c0116f5b>] printk+0xfb/0x130

 [<c0290bff>] usb_register+0x3f/0xa0

 [<f8ce6028>] hci_usb_init+0x28/0x4f [hci_usb]

 [<c012b8b8>] sys_init_module+0xe8/0x1b0

 [<c0103f6f>] syscall_call+0x7/0xb

usbcore: error -17 registering driver hci_usb

hci_usb_init: Failed to register HCI USB driver

usb 4-1: adding 4-1:1.2 (config #1, interface 2)

usb 4-1:1.2: hotplug

hci_usb 4-1:1.2: usb_probe_interface

hci_usb 4-1:1.2: usb_probe_interface - got id

Bluetooth: HCI USB driver ver 2.6

kobject_register failed for hci_usb (-17)

 [<c01e55db>] kobject_register+0x5b/0x60

 [<c025b000>] bus_add_driver+0x50/0xb0

 [<c025b5ef>] driver_register+0x2f/0x40

 [<c0116f5b>] printk+0xfb/0x130

 [<c0290bff>] usb_register+0x3f/0xa0

 [<f8ce6028>] hci_usb_init+0x28/0x4f [hci_usb]

 [<c012b8b8>] sys_init_module+0xe8/0x1b0

 [<c0103f6f>] syscall_call+0x7/0xb

usbcore: error -17 registering driver hci_usb

hci_usb_init: Failed to register HCI USB driver

Bluetooth: HCI USB driver ver 2.6

kobject_register failed for hci_usb (-17)

 [<c01e55db>] kobject_register+0x5b/0x60

 [<c025b000>] bus_add_driver+0x50/0xb0

 [<c025b5ef>] driver_register+0x2f/0x40

 [<c0116f5b>] printk+0xfb/0x130

 [<c0290bff>] usb_register+0x3f/0xa0

 [<f8ce6028>] hci_usb_init+0x28/0x4f [hci_usb]

 [<c012b8b8>] sys_init_module+0xe8/0x1b0

 [<c0103f6f>] syscall_call+0x7/0xb

usbcore: error -17 registering driver hci_usb

hci_usb_init: Failed to register HCI USB driver

```

----------

## geertn

FYI it works now, despite these errors:)

----------

## cdine

I just ordered an X40.. my only concern is booting and installing gentoo, or any distro.. I ordered a USB CD Burner/DVD Rom from newegg, a Nu Technologies one for $89.

----------

## Gherald2

Does anyone have a bona fide x40 docking station?

I do and am at a loss as to how to undock while the system is running... it just crashes.  It's even difficult under XP.

And when I hot-dock, I dunno how to get /dev/hdc and the parrallel port to be usable.

----------

## noleti

i tried it with xp right after i got the notebook and it worked quite well. With Linux at the moment hot-swap is not possible, but someone posted on the linux-thinkpad mailing list he is developing an acpi driver endabling this. Botting with the docking station gives me normal access to the cdrom

----------

## Gherald2

Wtih XP it crashes unless I wait 1-2 minutes for the software to undock.

----------

## geertn

No docking station here. I got bluetooth working quite nicely, the only thing I still need is syncing my calender with my phone.

----------

## BlinkEye

am i missing something? does my X40 have bluetooth?!

----------

## noleti

it could have... easiest is probably to check for the bluetooth LED, not every x40 has bluetooth (mine doesn't have it for example)

----------

## Gherald

I've been looking at this extended life battery.

Does anyone have experience with it or think they know whether it'd be hot-swapable?

I know the dock isn't hot swapable, which is why I haven't ever used it since after installing  :Sad: 

----------

