# Gentoo on the Toshiba Portege m200

## fido

I have had Gentoo on this laptop (table PC, actually) for a few months now, and through my travels I have found ways to get certian thing on may laptop to work, and yet I still have questions for other things. Thus, I decided it might be worth it to start a topic on all of the features that people have gotten to work on this laptop. 

If anyone out there has question/solutions regarding this laptop, post them here. Hopefully some of my solutions can help others out there with this laptop. 

Warning: I take no responsibility if any of this partially/totally borks your system 

Moving on, here are the various thing that I have done that work so far. Keep in mind that these are done using the 2.6.10 kernel.

1. Graphics

The graphics card is an nVidia GeForce FX Go 5200. The nvidia driver works best with this (in my opinion), which is in portage. 

```
emerge -Dav nvidia-glx
```

This will emerge the necessary driver, which can then be called by X using the following lines in your xorg.conf file.

```

Section "Device"

      Identifier    "NVidia GLX Enabled Driver"

      Driver        "nvidia"

EndSection

```

Im not sure on the exact refresh rates for the monitor, but I know that these values have worked for me.

```

Section "Monitor"

      Identifier    "MyMonitor"

      HorizSync     31.5 - 85.0

      VertRefresh   50-120

      # Sometimes this option is needed to make the fonts display in the correct size

      DisplaySize   423 370

EndSection

```

The DisplaySize option was somethign that I had to add in order to fix a problem with the fonts being WAY too big. This might have had something to do with migrating to the nvidia driver as opposed to the nv driver, although I was also using KDE at the time..

2. CPU Throttling

This laptop uses a Intel Centrino processor at varying speeds, depending on when you bought it and exactly what the configuration was. Mine is a 1.5Ghz Pentium M.

You will need to enable cpu throttling and the associated options in your kernel, along with ACPI support (obviously) and the ACPI hardware options (button, AC adapter, etc).

```

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_BOOT=y

CONFIG_ACPI_INTERPRETER=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=y

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_PROC_INTF=m

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

# CONFIG_CPU_FREQ_24_API is not set

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_TABLE=y

#

# CPUFreq processor drivers

#

# CONFIG_X86_ACPI_CPUFREQ is not set

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

# CONFIG_X86_POWERNOW_K8 is not set

# CONFIG_X86_GX_SUSPMOD is not set

CONFIG_X86_SPEEDSTEP_CENTRINO=y

CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y

CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y

# CONFIG_X86_SPEEDSTEP_ICH is not set

# CONFIG_X86_SPEEDSTEP_SMI is not set

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

```

You will also need to emerge 'cpufreqd' to make use of the governers. This will allow you to set cpu governers with cpufreq-set -g governer.There is alot of support out there for setting cpu speed manually and other uses of cpu throttling. 'acpid' can also be a big help with automating all of this.

3. LCD Brightness

The LCD brightness can be set using the toshiba directory in /proc. This requires that you have toshiba support enables in the kernel. Once enabled, the LCD brightness can be set using

```

echo "brightness:0" > /proc/acpi/toshiba/lcd

```

If you dont see the /proc/acpi/toshiba, check that you have ACPI and Toshiba Laptop Extras enabled. They are located in 'Power Management Options-->ACPI Support-->Toshiba Laptop Extras'

4. Fan

The fan can be set in the same way that the brightness is set using /proc/acpi/toshiba/fan

```

echo "force_on:1" > /proc/acpi/toshiba/fan

```

With the CPU throttled all of the way down and the fan on, I am able to get the CPU temp down to 43 C.

5. Screen Rotation

Of course, this is an obvious thing to want.. though I havn't gotten around to figuring this out yet. Expect further posts to cover it. It seems that screen rotation is possible, however, by using a seperate entry in the xorg.conf file and restarting X. I do not see this as a viable option, since I want to be able to rotate the screen on-the-fly and have everything work properly. I am expecting that in the not too distant future, xrandr will be used to do this due to the growing proliferation of table PCs.

6. Function Keys

Getting the function keys to work is still something I am working on. I suspect that the function keys are handled through ACPI, since neither xev nor dmesg show anything when the function keys are pressed.

Well, that is a good start.

----------

## fido

Update on the function keys:

It looks like the package 'fnfx' works with the function keys. It is masked, so you will need to [temporarily] add ~x86 to your ACCEPT_KEYWORDS. I am still working with it, but it looks like fnfx reads the keys and already handles some aspects such as brightness.

----------

## fmtn7

have you got any instructions on how to get the touchscreen to work? having some trouble... also while we're at it, any instructions on how to set up BT would also be welcome... 

thanks!

----------

## barral

This is what I use in my xorg.conf:

```

Section "InputDevice"

    Driver        "wacom"

    Identifier    "Cursor"

    Option        "Device"             "/dev/tts/0"

    Option        "ForceDevice"        "ISDV4"

    Option        "AlwaysCore"         "on"

    Option        "Type"               "cursor"

    Option        "Mode"               "absolute"

    Option        "Speed"              "3.0"

    Option        "Threshold"          "2"

#   Option        "Tilt"               "on"

    Option        "TopX"               "0"

    Option        "TopY"               "0"

    Option        "BottomX"            "24600"

    Option        "BottomY"            "18450"

    Option        "Baudrate"           "19200"

#   Option        "DebugLevel"         "10"

EndSection

Section "InputDevice"

    Driver        "wacom"

    Identifier    "Stylus"

    Option        "Device"             "/dev/tts/0"

    Option        "ForceDevice"        "ISDV4"

    Option        "Type"               "stylus"

    Option        "Mode"               "absolute"

    Option        "Threshold"          "2"

#   Option        "Tilt"               "on"

    Option        "TopX"               "0"

    Option        "TopY"               "0"

    Option        "BottomX"            "24600"

    Option        "BottomY"            "18450"

    Option        "Button2"            "3"

    Option        "Baudrate"           "19200"

#   Option        "TiltInvert"         "on"

#   Option        "DebugLevel"         "10"

EndSection

Section "InputDevice"

    Driver        "wacom"

    Identifier    "Eraser"

    Option        "Device"             "/dev/tts/0"

    Option        "ForceDevice"        "ISDV4"

    Option        "Type"               "eraser"

    Option        "Mode"               "absolute"

    Option        "Threshold"          "2"

#   Option        "Tilt"               "on"

    Option        "TopX"               "0"

    Option        "TopY"               "0"

    Option        "BottomX"            "24600"

    Option        "BottomY"            "18450"

    Option        "Baudrate"           "19200"

#   Option        "TiltInvert"         "on"

#   Option        "DebugLevel"         "10"

EndSection

```

These specifications are for landscape mode. Cursor and Stylus work on my laptop, but Eraser doesn't seem to have any effect (any hints are welcome). For portrait mode, you need to specify separate InputDevice sections and add

```

    Option        "Rotate"             "CW"

```

But I havent't tested this.

----------

## Kiera

Would you be able to post details on the install procedure? I know that the SD drive will boot a .img file on a SD card, and that that's how Debian is installed on the laptop, but what about Gentoo? I don't have access to a CD-ROM and I'm guessing there's a way to create a floppy image file from which to install GEntoo somehow.

----------

## barral

Sorry, I didn't use an SD card for the boot process.

I purchased an external USB CD-RW/DVD-ROM Drive from Toshiba together with the tablet computer (but not because of the install process, I just need a CD drive sometimes), and started the boot process from CD. However, after the boot image was loaded the root file system of the live CD could not be established from the CD, because USB is not configured for this at that stage of the boot process, I guess.

So I took the following steps to successfully boot Gentoo for the first time (minimal install CD 2005.1):

prepare the partitions of the hard disk on an existing Linux system

(I had another Linux computer available, to which I could attach the

hard disk externally). In my case the partitions were

```

       Device Boot  Start       End      Blocks   Id  System                Mountpoint

    /dev/hda1   *       1        99       49864+  83  Linux                 /boot

    /dev/hda2         100      2950     1436904   82  Linux swap / Solaris  -

    /dev/hda3        2951    155061    76663944    5  Extended

    /dev/hda5        2951     17284     7224304+  83  Linux                 /

    /dev/hda6       17285     48004    15482848+  83  Linux                 /usr

    /dev/hda7       48005     56196     4128736+  83  Linux                 /usr/local

    /dev/hda8       56197     64388     4128736+  83  Linux                 /opt

    /dev/hda9       64389     70533     3097048+  83  Linux                 /tmp

    /dev/hda10      70534     76676     3096040+  83  Linux                 /var

    /dev/hda11      76677    152859    38396200+  83  Linux                 /home

    /dev/hda12     152860    155061     1109776+  83  Linux                 /chr

```

   /dev/hda12 is ext3 formatted and holds the live CD root filesystem, which are the following two files:

     livecd

     livecd.squashfs

boot Gentoo from CD. On my system loading of the boot kernel took about 5 Minutes!.  the live CD fs was detected on /dev/hda12 during the boot process, and /dev/hda12 was mounted as the live CD. Note that you cannot use this partition for other purposes as long as the live CD system is running.

From this point on I could follow the usual Gentoo installation.

Maybe it is possible and you can use a simillar strategy with the SD drive, i.e. write the boot image form the minimal install CD on the SD card and prepare the harddisk with a partition to place the livecd.splashfs on.

----------

## barral

I found a way how to make the cross function tablet button work as cursors (up, down, left, right) plus "Return" when you press the button under X11. The definition is not a simple one, because the keycodes that are sent by this button are a combination of "Super_R" and a number. Putting the following key mappings into ~/.xmodmaprc make the button work as a "cursor stick" on my M200 (using Xfce4):

```

! Super_R -> Mode_switch

keycode  116 = Mode_switch Multi_key

! Define actions for the cursor stick

keycode  10 = 1 exclam Down

keycode  11 = 2 quotedbl Up

keycode  12 = 3 section Left

keycode  13 = 4 dollar Right

keycode  14 = 5 percent Return

```

The important settings for the keycodes 10 - 14 are in the third column. Note that the settings in column 2 depend on the keyboard, therefore you should not copy the above code literally (it is valid for a German keyboardi only). Instead use something like 

```

xmodmap -pke | grep " = [1-5]"

```

in order to retrieve your current key mapping for the keys "1" to "5" and exchange the third column with the above settings (Down, Up etc.).

----------

