Gentoo Linux on the Sharp Actius PC-MM10
John Lee (jjl |at| mit |dot| edu)
Last updated: 10/12/03
Introduction
The machine came a couple of days ago. I'm impressed with it's thinness. The screen is tiny, but that is to be expected of a machine like this. The native resolution is 1024x768 though, so it really strains your eyes. It's extremely light and easy to carry around. For whatever reason, there's a magnet on the right side of the screen, for those times when you feel like randomly sticking the MM10 into a box of paper clips (actually I don't know what it's for). The lid is also a bit annoying because when it closes, the size of the lid doesn't match the size of the base, so the base sticks out just a little, making it hard to put your thumb on the lid switch. It's also too light to open with one hand, so you'll need the other hand to hold the base down while you put the lid up.
Summary
Working
- Network card (RealTek RTL8139)
- Wireless card (Intersil Prism2)
- ACPI (battery, AC, lid switch, power button, temp sensor)
- XFree86 4.3.0 (Silicon Motion SM720 Lynx3DM)
- USB (OHCI)
- Sound (Acer Labs ALi M5451)
- Touchpad (Synaptics)
- External USB CDRW/DVD (Lite-On LSC-24081MX)
- Kernels 2.6.0-test5, 2.4.22
- LongRun/CPU frequency scaling
Not yet tried/In progress
- Sleep/Suspend
- The cradle (reported to work, but haven't tried myself)
- PCMCIA stuff (don't have any PCMCIA cards, except for..)
- Included PCMCIA V.92 modem (I will probably never use it)
Not working
Installation
My machine came with an external USB 2.0 Lite-On 24081MX CDRW/DVD drive. My old Latitude X200 had a firewire one, which is better because it doesn't need an external power supply. Nevertheless, I doubt I'll be carrying around the drive anyway so it doesn't matter much.
Turn the thing on, hit F2 to enter the setup, and change the boot order so it boots off of the USB CD drive. Stick in the Gentoo 1.4 LiveCD, and start it up. I found the framebuffer to be annoying, so I booted the nofb kernel. I also added the noapm to skip autodetection. The MM10 does not have APM BIOS. ACPI works fine though; more on that later.
The installation was straightforward. The USB drive is detected by the LiveCD, as is the network card.
Hardware
Network
The network card is an RTL8139 (the kind you can buy in a 99 cents store nowadays), which is 8139too.o as a module.
The built-in wireless is a Prism2, so any driver that can do those should work. The HostAP drivers have been reported to work (see Johnny Cuervo's page in the links section). I got the linux-wlan-ng drivers working without a problem too, but they're annoying to use. Eventually I realized that the orinoco_pci driver built into the kernel also worked. So I just use that. They say it's buggy, but I haven't had problems with it yet.
Video
The video card is a Silicon Motion SM720 Lynx3DM. You can use the "siliconmotion" driver. Click here to get my XF86Config file. It's pretty much the same as Johnny Cuervo's (I got a lot of info from that site, because it's the only other Linux MM10 site that I've seen).
USB
USB works with usb-ohci. To make it so that you can use the touchpad and an external mouse at the same time, you'll need the modules mousedev.o, usbmouse.o, and usb-ohci.o. In the XF86Config, add a section like this:
Section "InputDevice"
Identifier "ExternalMouse"
Option "Protocol" "IMPS/2" # IMPS/2 for the scroll wheel; this may be different for you
Option "Device" "/dev/input/mice" # may be different for you if you don't use devfs
Option "ZAxisMapping" "4 5" # scroll wheel"
EndSection
To the ServerLayout section, add the line InputDevice "ExternalMouse" "AlwaysCore" and you should be fine.
CDRW/DVD
Works as far as I can tell. Make sure you have the ehci-hcd.o kernel module for the USB 2.0 as well as usb-storage.o. You will also want sr_mod.o and you can mount the device (/dev/sr0). I haven't tried burning a CD yet, but I'm reasonably sure it'll work. Here is what Linux sees:
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: Slimtype Model: COMBO LSC-24081M Rev: 3M3C
Type: CD-ROM ANSI SCSI revision: 02
sr0: scsi3-mmc drive: 10x/24x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 5
ACPI
For whatever reason, I couldn't get it to work using the -ac patch (which I usually use for kernels). However, it works fine under 2.4.22 and 2.6.0-test5. Make sure to include the ACPI stuff in the kernel and leave out APM. It can detect the battery, the AC adapter, the power button, lid switch, and even has a nifty little temperature sensor. I just use the acpi client program to access it, but you can also easily write a quick script that looks in /proc/acpi.
Sound
The chip is an Acer ALi M5451. Under Gentoo, you'll need the latest ALSA drivers. Unfortunately, they're only in the unstable branch, because the one in the stable branch (0.9.2) will do really weird things to your video and will render it unusable. To install ALSA, run the following:
$ env ALSA_CARDS='ali5451' ACCEPT_KEYWORDS=~x86 emerge alsa-driver
When that's done, install the alsa-utils package. Then, edit your /etc/modules.d/alsa and put in the line
alias snd-card-0 snd-ali5451
Then add alsasound to the boot runlevel if you want it. I really don't use the sound, so I haven't put it there; I just start alsasound manually if I ever need sound.
9/19: I have finally gotten the 2.6 kernel to work without problems. Read on...
10/12: Compiled and tested 2.6.0-test7. Works fine, except for one thing. Scroll to the end of this section to see how to fix it.
The 2.6 Kernel
Get my config here.
Many of the things here may not be exclusive to kernel 2.6--they may very well be features present on other kernels, but I haven't tried them yet because 2.6 is working so well for me.
Wireless
You will need to make sure that CONFIG_PCI_HERMES is set (you'd probably want to build it as a module) for the wireless, which will give you the orinoco_pci.o module. Same as 2.4.
The touchpad
This is pretty nice. You can double tap to click-and-drag (I'm pretty sure it's like this on many others) but you can also move your finger up and down the right side of the pad to imitate a scroll wheel. Same with the bottom and horizontal scrolling. Pretty neat, and convenient since there's no PageUp or PageDown button (you have to hit Fn+UpArrow or Fn+DownArrow which can get annoying at times). Here is what Linux sees:
Synaptics Touchpad, model: 1
Firware: 5.9
180 degree mounted touchpad
Sensor: 34
new absolute packet format
Touchpad has extended capability bits
-> multifinger detection
-> palm detection
input: Synaptics Synaptics TouchPad on isa0060/serio4
Do not forget to include Input device support-->Event Interface support (evdev.o). The touchpad will NOT work as it did in 2.4. You will need to download and install the XFree86 Synaptics touchpad from here. It is conveniently packaged in both binary and source form, so you won't need a complete XFree86 source tree to install the driver. Once that's done, edit your XF86Config so that it loads the "synaptics" module, and change the "InputDevice" section so that the protocol is set to "auto-dev" and the device is set to "/dev/input/event0". Here is the snippet from my config file:
Section "Module"
-snip-
Load "synaptics"
-snip-
EndSection
Section "InputDevice"
Driver "synaptics"
Identifier "Mouse1"
Option "Device" "/dev/input/event0"
Option "Protocol" "auto-dev"
Option "LeftEdge" "1900"
Option "RightEdge" "5400"
Option "TopEdge" "3900"
Option "BottomEdge" "1800"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "VertScrollDelta" "100"
Option "MinSpeed" "0.02"
Option "MaxSpeed" "0.18"
Option "AccelFactor" "0.0010"
Option "Emulate3Buttons"
Option "Emulate3Timeout" "50"
EndSection
Sound
2.6.0 has ALSA built in, so you don't need to install them separately. Easy!
Transmeta LongRun
The Crusoe can adjust its own clock speed to save power when processor load gets low. There are 2 modes for this: performance and economy. Using the economy mode will save battery life, but it takes longer to speed the processor up when under load. I will soon be testing just how much this helps, though it really depends on how you use it.
In the kernel config, enable /dev/cpu/*/cpuid and /dev/cpu/*/msr support. If /dev/cpu does not exist, you will need to do mkdir -m 0755 -p /dev/cpu/0, and then create the msr and cpuid devices. Do that with the following:
mknod /dev/cpu/0/msr -m 0444 c 202 0
mknod /dev/cpu/0/cpuid -m 0600 c 203 0
You will need to install the longrun package (in Gentoo, just emerge longrun). Type longrun -p to show the status. To switch to economy mode, type longrun -f economy. For performance mode, use longrun -f performance. You can also set performance windows (i.e. if you want the Crusoe to never run at 100% speed so you can save battery power, type longrun -s 0 50 to set the window to 0 (low) to 50 (high)). By default the window is 0-100. Here is a table showing what the performance levels are (you can get this info from longrun -l):
# % MHz Volts usage
0 300 0.800 0.114
19 433 0.875 0.196
33 533 0.950 0.285
52 667 1.050 0.435
71 800 1.150 0.626
85 900 1.250 0.832
100 1000 1.300 1.000
Kernel 2.6.0-test7 and on
In order to get the touchpad working, you need to patch the kernel. I tried using 2.6.0-test6 some time back, and realized that I had to do a bit of kernel hacking. By the time I finished, it was mostly working, but I haven't had the time to post any patches. Anyway, 2.6.0-test7 is out, and the people that make the Synaptics driver have already put out patches. To get them, go here: http://w1.894.telia.com/~u89404340/patches/touchpad/2.6.0-test7-bk2 The patches should be applied sequentially.
Do not forget to include "Synaptics Touchpad" support in the "Input Devices" section, which is now in the "Device drivers" subsection. The "synaptics reset failed" message no longer shows up while booting, and it works exactly the way it did before. Yay.
Dealing with minor annoyances
Small console fonts
The screen is small enough as it is. If I try to run it in 80x25 (no framebuffer) the screen is centered in the middle of the display with a thick black border, even if I tell the BIOS to stretch images below 1024x768 resolution. If I use a 1024x768 framebuffer (vga=773, 791, etc) then the 8x16 fonts are even smaller. There are two ways around this: in the kernel, use the "Select compiled-in fonts" option and look for the 12x22 Sparc font, or you can just edit the CONSOLEFONT line in /etc/rc.conf to use a different font (on my machine it was iso01-12x22).
Keyboard
The Alt key is too small and I always find myself hitting the Windows "Menu" key. So I remapped that key to Alt. To do so, edit the default keymap file (/usr/share/keymaps/i386/qwerty/us.map.gz or whatever is in your /etc/rc.conf) and add "keycode 127 = Alt" to the bottom. If you'd like, you can also remap the other windows key, which is keycode 125. I have also mapped the Caps Lock key to Control, but I do that on all of my computers. Takes a lot of strain off of your left hand, especially if you use emacs a lot.
To do this for X, you have to first tell X that you have a 104-key keyboard (look in my XF86Config). Then, in a file in your home directory (mine is called .xmodmap) put the following two lines:
keycode 117 = Alt_L Meta_L
add mod1 = Alt_L
And in your .xinitrc file, put xmodmap ~/.xmodmap so it'll read it every time you start X.
The Synaptics driver
Compared to the generic PS/2 driver, this driver has more features, but acts differently on the default settings. For me, the pointer moved way too fast and was a bit too sensitive, and it sort of had a life of its own even if my finger wasn't touching the pad. I started experimenting with the X configuration. This is most likely documented somewhere in detail, but I haven't gotten around to looking for it. To adjust the pointer speed, look into changing the MinSpeed and MaxSpeed options. Mine are currently set to 0.02 and 0.14, respectively. Also, check out AccelFactor, which controls the nonlinear pointer acceleration. Mine is currently set to 0.0006.
You can control the scrolling with the Edges option and VertScrollDelta. I kept mine default, but sometimes the vertical scrolling is too much, so you may want to decrease VertScrollDelta a bit.
Another feature that I just discovered is that you can emulate a middle mouse button click by tapping the touchpad with two fingers. I also discovered (using xev) that you can emulate a right mouse click by tapping with three fingers. The touchpad is so small, though, that it's hard to do this, and it will often be confused with a 2-finger tap, or a middle mouse click. I will look more into how to get the driver to detect stubby fingers better, but for now I just use the buttons below the touchpad.
Miscellaneous stuff
Security
I chose to use GRUB for my bootloader. It comes with a nifty feature that lets you chain config files together, using a password to get from one to another. Of course, as far as security goes, all bets are off once someone has physical access to the machine, but what I have done is probably enough to thwart most thieves and dumb people that will buy the device from them. First, go to the BIOS and set a supervisor password. This is probably the least secure part of it, but there's nothing that can be done about that. There's an undocumented BIOS feature that lets you disable parts of the boot sequence. In the "Boot" menu for example, go to "Network boot" and hit Ctrl+1 (exclamation mark). That will put a ! symbol next to it, preventing it from being accessed at boot time. Do the same for all, leaving just the hard drive. To be safe, put the hard drive at the top of the boot sequence as well.
I chose to not set a BIOS user password because I wanted a message to be displayed along with a password prompt (rather than just "Enter Password:"). My /boot/grub/grub.conf file looks a bit like this:
password --md5 PASSWORD_GOES_HERE grub2.conf
title This device belongs to John Lee. Please return it to:
lock
title [my address here]
lock
title --
lock
title [some menacing message that will scare away dumb people, like..]
lock
title This machine is equipped with an active internal tracking device (etc.)
lock
title [you can probably come up with a more creative menacing message]
lock
The PASSWORD_GOES_HERE is an MD5-encrypted password. To get an encrypted string, you can use the command grub-md5-crypt. The password command in the config file has an optional argument that, if the correct password is given, will load a second configuration file. My grub2.conf file is what you'd expect to see in a normal grub.conf, but the password must be entered to get to it. With this setup, the only way (as far as I know) is to open up the machine and manually reset the BIOS, which even I wouldn't have the courage to do.
My compilation flags
Here are the CFLAGS I used for my /etc/make.conf:
CFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer -mpreferred-stack-boundary=2 -falign-functions=0 -falign-jumps=0 -falign-loops=0"
CXXFLAGS="${CFLAGS}"
Conserving battery life
Battery life on the road is affected by many things. Most of them are obvious, some are not so well-known.
- Turn off the wireless antenna when you're not using it. You can do this by hitting Fn+F1. The machine saves this setting when you power the machine off, so rather than just leaving it on all the time, I always make sure to turn off the antenna before the machine powers off. That way, I'll only have the antenna on when I need it on.
- Use LongRun effectively. I use two runlevels--one for when it's plugged in, one for when I'm on the road. On the "minimal" runlevel, I start as few services as possible, and I also start a script that sets the processor to economy mode. Actually, by default, it is put into economy mode every time it boots so I don't need to worry about that, but I also put longrun -s 0 71 there to underclock it just a bit. If I ever need more power on the road, I can simply set the window back to 0-100 manually. When it's plugged in (default runlevel for me), the script sets the LongRun flag to "performance" and sets the performance window to 71-100.
- Dim the screen whenever you can. It saves a lot of battery power.
- If you are using ext3 (like me), the default commit interval is 5 seconds. This isn't really necessary, unless for some weird reason you're running a server on it that does a lot of disk I/O. I set the commit interval to 30 seconds to save some power. You can do this with the command mount -o remount,commit=30 /dev/hdaX, or you can add the commit=30 option to your /etc/fstab.
Links
Johnny Cuervo's MM10 site - The only one (other than this one) that I know.
Linux on Laptops - Great site for finding information on getting Linux on all sorts of laptops.
TuxMobil - Linux on laptops, PDAs and mobile phones