Ice Bear SoftNotebook ASUS M6000 a Linux -- oživení hardwaru

Text nebyl přeložen do češtiny a nebude již aktualizován, neboť jsem nainstaloval CentOS 5, o čemž píši podrobně na této stránce.

The setup is based upon information provided by Jan Kasprzak. The document is not finished yet, it describes my first attempts only.

Most manuals contain just instructions what to do. This page is written rather as a short story describing my way how I made the notebook running and trying to explain why things can be made wrong. I hope this will be useful mainly for non-experts.

Obsah

1. Hardware configuration
2. GRUB setup
3. LCD Monitor
4. Parallel port
5. Touchpad
6. Mouse
7. Sound card
8. Battery monitor applet
9. ACPI
  9.1. ACPI installation
  9.2. Suspend and resume
  9.3. ACPI messages
  9.3.1. Síťový vypínač
  9.3.2. Startovací klávesy
  9.3.3. Fn + funkční klávesy
  9.3.4. Ovládací tlačítka přehrávače CD
  9.4. Přepínání displeje, externího monitoru a TV výstupu
10. CD/DVD
11. USB
12. Ethernet
13. WiFi adapter

1. Hardware configuration

As mentioned on the Linux installation page I have originally installed two distributions on my computer. They have different kernels and thence different behaviour. These are listings related to hardware:

Finally I decided to remove Debian and install Fedora Core 2 and compile kernel 2.6.8.1 myself. The kernel configuration provided by Jan Karprzak did not work for me. The first problem was that I somehow got it with DOS line endings and it caused strange error messages. You can get my kernel configuration which almost works. Be sure that you get it with UNIX line endings.

You can also read the list of modules installed automatically by Fedora Core 2.

 Začátek stránky 

2. GRUB setup

After compilation of kernel 2.6.8.1 the computer did not boot, it died with kernel panic because it was not able to mount the root partition. The original kernel still worked. After some time I found that the new kernel cannot mount the partition by the label. I have modified /boot/grub/menu.lst so that it contains the root partition as /dev/hda1. I have also removed rhbt and quiet because I prefer the old-time way of Linux boot messages. Using this menu Kernel 2.6.8.1 boots.

 Začátek stránky 

3. LCD Monitor

The monitor has resolution 1280x800 which is not detected during XFree setup. However, both in Debian and Fedora Core 3, it is sufficient to open /etc/X11/XF86config-4 in Debian or /etc/X11/xorg.conf in Fedora, remove all unused screen sections and edit the active section so that it contains 24bit color depth and the only resolution "1280x800". You can later change the resolution (even to values not listed in the configuration file) from Gnome by the properties dialogue should it be necessary e.g. for connection to a data projector.

This does not help in Fedora Core 2 unless you provide correct monitor parameters during installation. Use the settings provided by Jan Kasprzak, see mainly the ModeLine command. I have the same settings in my xorg.conf file.

 Začátek stránky 

4. Parallel port

The parallel port works fine, no setting is needed. Of course, you have to configure your printer.

 Začátek stránky 

5. Touchpad

The touchpad is not autodetected but it is handled as a PS/2 mouse on /dev/psaux. If the default driver is used, you can operate the notebook both by the touchpad and the USB mouse (see below). I have also compiled the Synaptics touchpad. It works fine. You can get my xorg.conf file.

It is often useful to disable the touchpad when the mouse (see below) is plugged in. Such a script wasa sent to me by Petr Mikulík. Unfortunatelly it did not work on my notebook. It seems that the names of devices depend on the type of the Linux distribution. The names correspond to xorg.conf and can also be obtained by xsetpointer -l. In my notebook it displays

"USBMouse"      [XExtensionDevice]
"Keyboard0"     [XKeyboard]
"USBMouse"      [XExtensionDevice]
"Synaptics Mouse"       [XExtensionDevice]
"Synaptics Mouse"       [XPointer]

The script is as follows:

#!/bin/bash
# switching touchpad on and off
if [ -z $1 ]
then
    echo "Usage: $0 {on|off}"
    exit
fi
    
case $1 in
  on)
    xsetpointer Synaptics\ Mouse
    xsetpointer Synaptics\ Mouse
    exit;;
  off)
    xsetpointer USBMouse
    exit;;
esac
    
echo "Usage: $0 {on|off}"

It can be run by an ordinary user. For some reason the Synaptics Mouse has to be switched on twice in order to make it work.

 Začátek stránky 

6. Mouse

The notebook comes with Logitech USB optical mouse which is correctly detected by hotplug. I suggest to install the system with the mouse unplugged. If you plug the mouse when Linux runs, it is detected and you can use both the mouse and the touchpad. If you connect the mouse before Linux is loaded, the touchpad will sometimes be disabled and you will only be able to use the mouse. It is thus better not to use mouse during system installation. It works always well after you compile kernel 2.6.8.1 provided HID (Human Interface Device) is configured. You can even use the mouse and the touchpad at the same time.

It happens from time to time that the mouse ceases to work after suspend and resume. It is sufficient to unplug the mouse and plug it in again. Hotplug then forces the USB system to recover.

 Začátek stránky 

7. Sound card

Finally I managed to set up the sound card. The first problem was that ALSA drivers in Debian return an error which is not stored in the dmesg output. The volume control cannot be used, it always return to zero.

The sound card works fine in original Fedora Core 2 but does not work in Fedora Core 3. I did not managed to make it work with kernel 2.6.8.1 using the kernel config supplied by Jan Kasprzak. I have noticed that the original kernel in Fedora Core 2 contains the sound drivers as modules. I have therefore decided to include all PCI soundcards as modules (see my kernel configuration). Most of these drivers are certainly unnecessary but hard disks are nowadays large enough. When I rebooted with this new kernel, Kudzu was started and configured the sound card. I was still unable to play audio CD's. The remedy is simple: in the Gnome menu open Sound & Video, open Volume control and adjust CD volume to maximum (it was zero in my preferences). The access rights to /dev/mixer are 0666 but I do not know whether it is important.

 Začátek stránky 

8. Battery monitor applet

The battery monitor applet does not work after original install. It displays "0%" in Debian and "N/A" in original Fedora. It works fine with my confguration of kernel 2.6.8.1 (see above) even without acpi4asus.

Imagine that you notice that you are running out of battery. You suspend the computer (see ACPI below), find your power adapter, connect it and resume. The battery monitor applet will not notice it and will continue to display that you are running on battery. If you are sure that the battery has enough power for a few second, unplug the power adapter and plug it again. The battery monitor applet will notice that the adapter is connected and the correct icon will be displayed.

As will be mentioned further, ACPI does not work with kernel 2.6.9. This may be the reason why the battery applet does not work with Fedora Core 3.

 Začátek stránky 

9. ACPI

Obsah

9.1. ACPI installation
9.2. Suspend and resume
9.3. ACPI messages
  9.3.1. Síťový vypínač
  9.3.2. Startovací klávesy
  9.3.3. Fn + funkční klávesy
  9.3.4. Ovládací tlačítka přehrávače CD
9.4. Přepínání displeje, externího monitoru a TV výstupu

9.1. ACPI installation

I did not manage to compile acpi4asus in Debian due to missing libraries. Later on I have noticed that it requires the kernel sources and I did not have them. As one of Murphy's laws goes, if things do not work, read the manual...

It compiled well in Fedora Core 3 but it had not worked. Jan Kasprzak has reported that it does not work with kernel 2.6.9 but this kernel is used in Fedora Core 3.

It seems to be already included in kernel 2.6.8.1. After reading the README file in the source package I found that function keys Fn+F5, Fn+F6, and Fn+F7 as well as Fn+Ins (for Num-Lock) work. I can switch the LEDs on and off by sending 1 and/or 0 to /proc/acpi/asus/[mw]led, respectively. It is also possible to read their state from the mentioned device.

My DSDT is:

Asus Laptop ACPI Extras Driver 0.28
Model reference    : M2E
SFUN value         : 0x08f7
DSDT length        : 22690
DSDT checksum      : 24
DSDT revision      : 1
OEM id             : A0009
OEM table id       : A0009000
OEM revision       : 0x0
ASL comp vendor id : INTL
ASL comp revision  : 0x20030522

9.2. Suspend and resume

I had some problems with suspend-to-disk. I will write the whole story how it did not work and how I finally succeeded.

I took /usr/local/sbin.swsuspend from Jan Kasprzak and invoked it as root. It worked fine. You can read the kernel messages from resume. Then I created /etc/acpi/events/power containing:

event=button/power.*
action=/usr/local/sbin/swsuspend

When I pressed power off, the computer was just shut down. After switching it on and trying again, suspend-to-disk worked. Almost. Resume was followed by immediate shutdown...

I will not describe a few hours of my experiments, I will give you the explanation. The ACPI daemon reads all files in the /etc/acpi/events/ directory the names of which do not start with a period and remembers all events and associated actions. It is possible to assign several actions to a single event. All of them will be executed but the order is undefined. Originally the above mentioned directory contains sample.conf which assignes shutdown to the power switch. In my computer it was registered as the second action, thus the computer was shut down after resume... You can remedy it by removing the file or, if you wish to keep it, by renaming it to .sample.conf. The files are read when the ACPI daemon starts. if you change the files, you must send SIGHUP to acpid in order to force rereading the files.

However, suspend-to-disk still seemed not to work. After removing sample.conf it resumed to my previous session for a few seconds and then I got a black screen with large cross reacting to the mouse and touchpad but doing nothing else. It took me a long time to understand what happened and how to remedy this sad situation. As a matter of fact the remedy is easy. Read on:

  1. Resume displays the graphical screen for a short time and then falls to a black screen. You should press Ctrl-Alt-F1 to go to the text console and Ctrl-Alt-F7 to go back. The resumed screen will magically reappear. If you suspend and resume again, everything will work immediately without this trick.
  2. The USB mouse usually continues to work. In rare occasions it might freeze. It seems sufficient to unplug it and plug it in again.

Unfortunately, suspend and resume disables the sound card. It is sufficient to change the volume level. As mentioned in the blog on ABC Linuxu (in Czech) it can be done automatically in the suspend/resume script. I have included the suggested code into my /usr/local/sbin.swsuspend.

Sometimes MPlayer does not work after suspend and resume. It resembles TV with lost synchronization. I had to restart the X server in order to make it work again.

Important note: You can have several operating systems on your computer. If they do not share disks, you can suspend one of them, boot another system and later resume the suspended session. Suspend-to-disk does not close filesystems. Mounting suspended filesystems from another OS may cause disaster. You could read in the Linux installation page that I originally had two distributions with shared partitions. It would lead to disaster to suspend one distribution and boot another. Now I have Fedora Core 2 only but with two kernels: 2.6.8.1 and 2.6.5-1.358. Only the former contains ACPI and can thus be suspended and resumed. Look again into my /boot/grub/menu.lst file. It starts with default=saved. Each section ends with savedefault and boot. This ensures that GRUB saves the recently booted variant as default. If you suspend the machine, leave it boot the default OS. It will resume your latest session. If you modify your menu.lst, do not forget to reboot, otherwise GRUB will still remember your old default.

Now suppose that you have two Linux distributions which share partitions and both are able to suspend/resume, and Windows without suspend/resume capability (or implemented in a way not interacting with the Linux method). You should then add savedefault to the Linux sections of menu.lst but not to the Windows section. GRUB will thus automatically boot the latest Linux session but Windows will have to be manually selected from the menu.

Note: Some documents mention /boot/grub/menu.lst, other mention /boot/grub/grub.conf. At least in my computer menu.lst is a symlink to grub.conf.

9.3. ACPI messages

The ACPI messages can be read by:

cat /proc/acpi/event

However, you cannot access it if acpid is running. All messages are logged, thus you can see them by:

tail /var/log/acpid

Using the above command I found the identifiers of the messages. Each message contains two words followed by two 8-digit hexadecimal numbers. I do not understand the meaning of the second number, it seems to be just serial number, therefore I will not report it.

9.3.1. Síťový vypínač

The power switch generates button/power PWRF 00000080. The full log from resume is:

Please consult the The X.Org Foundation support
	 at http://wiki.X.Org
 for help.

/usr/local/sbin/swsuspend: line 13: kill: (4448) - No such process
[Mon Dec 27 15:43:57 2004] END HANDLER MESSAGES
[Mon Dec 27 15:43:57 2004] action exited with status 1
[Mon Dec 27 15:43:57 2004] completed event "button/power PWRF 00000080 00000005"

What is the last line of /usr/local/sbin/swsuspend supposed to kill?

9.3.2. Startovací klávesy

All these keys return hotkey ATKD 000000xx. The following table will report only the last two hexadecimal digits. Remember that the actual keys depend on the model. I report keys which appear on my notebook.

e-mail WWW browser WLAN Pad-Lock Power4 Gear+
50 51 5d 6b, 6a 5c

Note: 6b is used to lock, 6a to unlock the pad.

9.3.3. Fn + funkční klávesy

Here is the list of messages generated by the function keys.

Fn+F1 button/sleep SLPB 00000080
Fn+F2 hotkey ATKD 0000005d
Fn+F5 hotkey ATKD 0000002f -- 20
Fn+F6 hotkey ATKD 00000011 -- 1f
Fn+F7 hotkey ATKD 00000034 (backlight on->off)
hotkey ATKD 00000033 (backlight off->on)
Fn+F8 hotkey ATKD 00000061 -- 67 (?)
Fn+F10 hotkey ATKD 00000032
Fn+F11 hotkey ATKD 00000031
Fn+F12 hotkey ATKD 00000030

Keys Fn+F5, Fn+F6, and Fn+F7 are already handled but you can assigns additional actions to them. Keys Fn+Ins and Fn+Del do not return messages (or they are not reported in /var/log/acpid.) Fn+Ins is correctly handled as Num-Lock, Fn+Del seems to do nothing. The message returned by Fn+F5 and Fn+F6 depend on required brightness (there seem to be 16 different levels).

Notice that Fn+F2 returns the same message as the WLAN launching key.

Key Fn+F8 will be explained in the section dealing with switching display, external monitor and TV.

9.3.4. Ovládací tlačítka přehrávače CD

These buttons return messages hotkey ATKD 000000xx. I will again report only the last two hexadecimal digits.

Rewind Stop Play/Pause Fast forward
40 43 45 41

9.4. Přepínání displeje, externího monitoru a TV výstupu

MS Windows use Fn+F8 to switch graphical output. The key works with ACPI but actually nothing happens. The returned value changes according to the expected mode but the hardware verifies what is actually connected. If nothing is connected, you will always receive hotkey ATKD 00000061. I connected an external monitor (ADI MicroScan G66) and the last two hexadecimal digits were 61, 62, and 63, respectively (in this order). The driver just returns the messages but does not handle them, you must do it yourself. I decided to do it in a different way. I have assigned the action to the Power4 Gear+ key which returns hotkey ATKD 0000005c. In addition I decided to indicate (and store) the state by the mail LED. My /etc/acpi/events/display contains:

event=hotkey.*5c[[:space:]]
action=/usr/local/sbin/disp

The action file /usr/local/sbin/disp is also simple:

#!/bin/bash
mled=`cat /proc/acpi/asus/mled`
if [ $mled = 0 ]
then
  echo 3 > /proc/acpi/asus/disp
  echo 1 > /proc/acpi/asus/mled
else
  echo 1 > /proc/acpi/asus/disp
  echo 0 > /proc/acpi/asus/mled
fi

The computer manual says that the external monitor must be connected before the notebook is switched on. I was able to connect the monitor to the running notebook and it worked.

Recently I have discovered that data projectors are quite smart. It the projector is connected before the notebook is switched on, it is automatically recognized and no manual switching is needed. You will only have to set proper resolution. Jan Kasprzak uses spesial section in his worg.conf but I can live without it. It is sufficient to change the resolution from the Gnome menu to 1024x768 after the data projector is connected and notebook switched on. Communication with the data projector does not survive suspend/resume. It is necessary to kill the X server by Ctrl/Alt/Backspace and start a new one.

 Začátek stránky 

10. CD/DVD

The drive can read both CD and DVD and can boot from both. I managed to burn CD-R and CD-RW using cdrecord dev=ATA:1,0,0. I have not tried to burn a DVD yet.

 Začátek stránky 

11. USB

USB is handled by hotplug. During boot, Fedora Core 2 reports that modules ohci_hcd and ehci_hcd cannot be found but USB works. The output from dmesg reveals that these modules are found by ACPI. In addition to the mouse I tried USB flashdisk which works fine.

 Začátek stránky 

12. Ethernet

The Ethernet card is autodetected properly, no special setup is needed.

 Začátek stránky 

13. WiFi adapter

My notebook comes with Intel PRO/Wireless 2200BG. The PRO/Wireless cards are not sold separately, you can buy them only as a part of the Intel Centrino pack. This means: if you have Intel Centrino, you have PRO/Wireless and vice versa. The cards are replaceable. You can take the card out and use any other miniPCI instead.

The OpenSource driver can be found on Sourceforge.net. Fedora Core 2 creates the sysfs filesystem during installation and contains hotplug scripts which are new enough. My kernel config contains all necessary prerequisites. Compilation of the driver was straightforward. I put the firmware files to the directory as per documentation. I was able to load the module. The WLAN card is identified as interface eth1.

It seems that make install does not work properly. If I add ipw2200 to /etc/modules, the computer complains that it was not able to load the firmware. I removed it from /etc/modules and tried modprobe ipw2200 with the same result. Scripts load and unload from the source directory seem to work.

Configuration of the interface can be done by wireless extensions which are already included in Fedora Core 2. I tried both the unencrypted and encrypted connection (WEP) and everything works. After loading the driver I configured the interface simply by:

iwconfig eth1 mode managed

The card automatically finds the access point as you can verify by iwconfig eth1. If the connection is encrypted, you have to supply the key by:

iwconfig eth1 key s:your-key

More details can be obtained in man iwconfig. Finally I just issued dhclient in order to lease the IP address. The connection even survives suspend and resume.

 Začátek stránky