The Gericom Webboy TFT 13.3/14.1
Configuring Hibernation and the Smart Link HAMR5600 AMR Modem under Linux (Mirror)
: This is a copy of the pages originally at tcsa.elte.hu/~takacs/webboy.html
(due to be removed) & mirrored with the Author's permission.
Stylistic changes have been made to fit in with this site's layout, but the text remains unchanged.
Here I describe how to configure hibernation (suspend-to-disk) and the built-in winmodem on the Gericom Webboy under SuSE Linux 7.1/7.2. The instruction here should be easy to adopt for other Linux distributions (e.g. RedHat) as well.
There is already an excellent description of the machine in the SuSE support database:
therefore I restrict myself to a description of the two issues above.
All the configuration steps below need root privilege: therefore, su to root in Linux.
Other links on Gericom Webboy and Linux:
The author disclaims all warranties with regard to this document, including all implied warranties of merchantability and fitness for a certain purpose; in no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use of this document.
the power management of the built-in BIOS (AMIBIOS version 1.02G
) is buggy. Main problems are:
- a) it does not save the status of the video chip. Therefore, on return from hibernation, the video card registers are corrupted. Although Linux restarts, the screen is garbled. In such a case, change to virtual terminal 1 (Ctrl+Alt+F1) and reboot (Ctrl+Alt+Del): this helps. However, hibernation still won't work properly. Windows solves this problem by resetting the video card after resume. However, X and Linux console drivers are not notified of APM events, so this is not possible.
- b) sometimes, the BIOS sends two resume events after returning from suspend, separated by 5-6 seconds. This can confuse programs run by apmd, the power management daemon.
The solution is as follows.
- a) BIOS preparations
The vendor supplies a DOS utility (HDPREPEZ.EXE) to prepare the harddisk for hibernation. This can prepare either a file or a partition for suspend-to-disk. I recommend using it BEFORE you install Linux (say from a DOS/Windows installation or by booting the machine into DOS with an external DOS system disk onto which you have copied this utility). If you have already installed Linux and have no Windows partition to hold the hibernation file, make space for a new partition on your hard disk file (do not create it, just leave unpartitioned space on the disk at least roughly the size of your memory + about 24 Megs). Then you can run the utility. It is going to create a partition on your harddisk which is the 4th entry of the partition table therefore, do not use the 4th entry, put an extended partition into the 3rd if you need more partitions than 3 + the hibernation partition). The type of this partition as viewed from Linux fdisk is "OS/2 hidden drive".
The space allocated for the hibernation partition is the first chunk on your hard disk which is large enough to contain the image of your memory + the necessary overhead. If this is not at the end of the hard drive and you create some partitions starting at higher cylinder numbers, then fdisk will warn you that the partition table entries are not in disk order (the hibernation partition is the last entry, say /dev/hda4, as I said above). Don't worry, however: this is totally harmless. The hibernation partition can be located anywhere on the hard disk (no 1024 cylinder limit like e.g. for LILO).
NOTE: repartitioning your hard drive is DANGEROUS - you can lose your data! If you need to alter your partitions in order to create space, please to not forget to backup your data and read the Linux HOWTOs dealing with partitioning and install.
To activate suspend-to-disk, enter the BIOS setup by pressing Del during boot and choose Suspend Mode (STD) - suspend-to-disk.
- b) Linux preparations
Take care to install the packages apmd (Advanced Power Management Daemon) and svgalib (SVGA graphical utilities).
First configure your Linux to start apmd at boot time. In SuSE, use YaST or some other tool to edit your rc.config. In YaST, choose "System Administration" then "Change configuration file".
Set the following values:
- START_APMD: <yes>
- APMD_LEAVE_X_BEFORE_STANDBY: <yes>
- APMD_LEAVE_X_BEFORE_SUSPEND: <yes>
If you use ALSA (as I do), in order to restart your sound drivers after suspend, set also
- APMD_STOP_SOUND_BEFORE_SUSPEND: <yes>
Now we have to configure suspend/resume actions. In SuSE, apmd is started with an option which tells it to execute the script /usr/sbin/apmd_proxy whenever an APM event (resume/suspend/standby/battery level warning) occurs. A default script is supplied with apmd.
We shall use the svgalib utilities savetextmode and textmode, which save text mode video registers to files in /etc/vga and restore them from there. I use VESA framebuffer both for console and for X (both the Linux console SiS630 driver and the vendor supplied SiS630 X server is broken), see description in the SuSE support database. It turns out that it is enough to restore the text mode registers, together with redrawing the X screen with xrefresh. You have to force svgalib to use VESA by uncommenting the following line in /etc/vga/libvga.config:
- chipset VEGA # nicely behaved Vesa Bioses
In order for xrefresh to be able to redraw your X screen, you must give access to it. Since this is a laptop on which you are probably the only user ever, it is not really problematic (in the sense of security) to add the line
at the start of /etc/X11/xdm/Xsession.
Now we have to modify the script /usr/sbin/apmd_proxy to add the command savetextmode when going to standby/suspend and textmode + xrefresh when resuming. The settings for apmd to leave X before suspend/standby are important for the script to work properly. I also take care of the double resume events by creating a marker file /tmp/just_suspended when a suspend event happens and removing it after a resume event. Therefore the next resume event does not find the marker file and so just exits without performing any action.
My apmd_proxy script (was) here. Copy your /usr/sbin/apmd_proxy to apmd_proxy.orig and move my script in its place (Webmaster note: sorry, script not copied).
My script also takes care of restarting gpm after resume and logs all of its actions in /tmp/apmd_proxy.log for debugging. If we resume after a standby, a single xrefresh is enough; after suspend a second xrefresh is necessary. For some reason, if the first xrefresh (which comes before textmode) is not done, the second does not work properly. I have no idea what the reason is: this is just an observation.
xrefresh does not work if you have the xdm/kdm/gdm login window on your display because of permission problems. It's not hard to solve this, but is not really necessary: you can simply press the standard keysequence Ctrl+Alt+Backspace to restart the X server in this case (since you have no applications running, there's nothing to lose anyway).
- c) What should you see?
Now you can try to suspend either by pressing Fn+F1, or by closing the lid of your laptop. After it switched off, restart it by pressing the power button to turn it on.
Standby (suspend-to-memory) can be triggered by executing apm --standby from a shell (in KDE, you can also call it from a panel applet).
Here is what you should see:
- Standby: virtual terminal is changed to console 1, screen switches off.
- Resuming from standby: console 1 comes back, then if you invoked standby in X, virtual terminal is changed to X and is redrawn.
- Suspend: virtual terminal is changed to console 1, savetextmode is invoked: you should see some white stripes appearing across your screen, then screen blanks. After about 1-2 seconds, BIOS hibernation screen comes up. When finished saving memory, machine switches off.
- On resume from suspend: BIOS boots, resume screen comes up. When memory is loaded, the corrupted linux console appears for a second, then textmode starts: you see white stripes again. Then virtual terminal is switched to X, and the X screen is redrawn.
Don't forget: if anything goes wrong, your Linux is still there - only the screen is garbled! Change to virtual terminal 1 (Ctrl+Alt+F1) and reboot (Ctrl+Alt+Del): this helps! DO NOT JUST SWITCH THE MACHINE OFF! You may get away with an fsck, but if you are REALLY unlucky you may corrupt e.g. your /etc/inittab (happened to me once over the 5 or 6 years that I use Linux), in which case it's a pain to repair it (you need to boot in single user mode or with a rescue disk etc.). By the way, it is in general a good idea to have a backup copy of your /etc directory on a floppy just in case any such problem happens (which is very unlikely, but may happen if you do something really, really wrong).
The modem is a SmartLink HAMR5600
modem, which is in an AMR slot.
You are going to need SuSE's 2.4.4 released kernel. For 7.2, this is one of the choices during installation. For 7.1, it can be found in the update directory
and is called k_deflt-2.4.4-28.i386.rpm
The drivers can be found here or here. (They were accessible from ftp://ftp.smlink.com/pub/linux, but have been removed from there. Thanks to Martin Kubisch for letting me know.) You need the package slmdm-2.03-01_linux_2.4.4.src.rpm (Webmaster note: source- & binary-RPMs are both available). Just download and run
- rpm --rebuild slmdm-2.03-01_linux_2.4.4.src.rpm
This builds the following binary rpms in /usr/src/packages/RPMS/i386
You need to install only the first two of them (the built-in modem is amr, not usb. The usb and the amr packages cannot be installed simultanously.)
The modules can be inserted by hand running /usr/lib/slmdm/load_slmdm. This script needs to modified, beacuse the drivers are compiled for 2.4.4, while SuSE kernel has version 2.4.4-4GB. Therefore, insmod must be forced to insert them. This can be achieved by changing the line
There are no unresolved symbols or similar problems: the modules are inserted and work without problems.
After insertion, /dev/modem will be a symbolic link to the modem device /dev/slmdm. You can configure your applications to use /dev/modem (which is the default in many cases, so you actually do not have to do anything at all).
I wrote a little script slmdm to start/stop the drivers using init during booting and halting the system. You can copy it to /etc/init.d and then use the SySV init editor to configure start/stop at the appropriate runlevels.
Note: in my experience, the modem driver works well for dialing out. However, when used in connection with mgetty for dialing in, it hangs the machine (and then only the power button helps :-(). I am working on finding out the reason for that (it seems that mgetty does not initialize the modem properly). In any case, the driver is suitable to connect e.g. to your internet service provider (which is the most likely application anyway) or to send faxes. Please drop me a mail if you find a solution to this problem.