How To: ACPI Suspend to RAM on Dell Latitude D800 with Fedora Core 3
Intro
BIOS on Dell Latitude D800 is ACPI only, in other words APM is not supported by BIOS.
ACPI supports following suspend/sleep modes:
- S1 - power to CPU maintainded but no instructions are executed. In Microsoft Mode Standby
- S2 - currently not in use
- S3 - Suspend to RAM: All power to the cpu is shut off, and the contents of its registers are flushed to RAM, which remains on.
- S4 - Suspend to disk, aka Hibernate. CPU power shut off as in S3, but RAM is written to disk and shut off as well.
- S5 - Soft off. System is down. Some power may be supplied to certain devices to generate a wake event, for example to support automatic startup from a LAN or USB device.
Note that despite some ACPI support in 2.4 Linux kernel, S3 sleep mode is not supported on 2.4 Linux kernel
I’ve got on my notebook 1GB ram, so Hibernate mode is not really interesting( it would take hell lot of time to dump whole RAM contents to disk.
I’ve managed to get S3 mode running stable.
Current Software/Hardware Setup
- Dell Lattitude D800 (no built in wireless)
- Onboard Nvidia GeForce4 Ti 4200 Go AGP 8x graphic card
- Onboard Broadcom NetXtreme BCM5705M Gigabit Ethernet NIC
- Fedora Core 3. (did work with FC1 and FC2, in FC3 S3 is most stable)
- Kernel 2.6.10-1.741_FC3
S3 mode configuration
Graphic Card driver
Problems:
Open Source “nv” module doesnt play nicely with S3 mode. In particular i’ve seem to be unable to get screen back after waking up from S3 mode. Solition is to use Binary nvidia drivers
Another problem here is that default linux AGP drivers has some issues with either ACPI S3 mode wakeup or with Nvidia Binary drivers waking up after sleep. it will mean that text consoles
will loose blacklight. But graphical consoles work without problems. To solve problems with console you need to recomplie kernel and specify agp driver to be build as module. So you can
use AGP driver which comes with Nvidia binary drivers
- Step 1. Binary Nvidia driver installation
Dowload and install binary Nvidia drivers from Nvidia site. I currently use version 6629.
- Step 2. X.org configuration
Next step is to setup Xorg to use binary Nvidia Drivers. Edit /etc/X11/xorg.conf and make sure that Section device looks similar to this one
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
Option "NvAGP" "1"
Option "NoLogo" "true"
Option "RenderAccel" "On"
VendorName "Videocard vendor"
BoardName "NVIDIA GeForce 4 (generic)"
EndSection
Note that Option “NvAGP” “1″ is needed only if you recompiled kernel with default AGP driver built as module.
USB modules
Following usb modules tend to create problems after waking up: uhci_hcd ehci_hcd hci_usb. Solution is to remove them before going to sleep and insert them back after wakeup.
Since other modules might depend on these modules, dependant modules have to get removed first. This is true for Linuxant modem modules for my built-in WinModem.
HAL service
HAl (aka Hardware Abstraction Layer) gets confused then usb modules get removed from running kernel. After wake up HAL needs restart.
Time
To do not screw up time on system, hw clock should be synced to the software clock. After wakeup time shoul be synced from hw clock to software clock.
Buffer cache
Just for case when kernel hangs or crashes during sleep/wakeup disk cache should be written to disks. This done by executing sync command.
ACPI scripts
I’ve wrote an acpi script to address all this issues. You can download tarball here.
To install them simply run :
cd / tar xvfz <full path to acpi-scripts.tgz>
Tarball contains 3 files:
/etc/sysconfig/acpi-sleep - configuration file for acpi
/etc/acpi/events/sleep - description of what to run in sleep even
/etc/acpi/scripts/sleep.sh - script itself