Linux on Mobile Computers
Just imagine the ability to pick up your Linux workstation and take it with you wherever you want to go. You can do it today. Linux can run smoothly on notebook hardware, taking full advantage of all the goodies that define mobile computing. Just as with desktop systems, however, there can also be challenges to overcome. Fortunately, extensive support for notebooks running Linux is becoming available as interest in seeing Linux on notebook computers continues to grow.
This article is not intended to be an in-depth aid to installation or configuration of Linux notebook systems. Such an article would be nearly impossible to write for desktop systems, and notebooks are no different. Rather, this article introduces both the present Linux desktop user and the Linux newcomer to the support that Linux offers for notebook hardware. Several on-line resources exist for more specific information beyond what is presented in this article, and they are mentioned below. The Linux Laptop Home Page collects pointers to all the information presented in this article and more, and is available at both http://www.cs.utexas.edu/users/kharker/linux-laptop/ (Figure 1) and http://www.redhat.com/linux-info/laptop/ (Figure 2).
Notebook computers can be quite different from desktop systems. One of the most important differences, when it comes to running Linux, is the process of integrating different hardware components. Desktop systems can be built by picking and choosing components that are known to work well with Linux. You can accessorize or replace unsupported hardware with the best cards and adaptors for your needs. Notebooks and laptops, however, are all-or-nothing packages. Aside from PCMCIA cards, there's very little you can do to customize your hardware configuration. There's also little you can do when it comes to controller chipsets or proprietary technologies—an unfortunate fact of life. Don't let this intimidate you, though; the vast majority of hardware on the market works quite well with Linux, and most of the rest works reasonably well with Linux.
Most notebooks have a similar feature set. At the time of this writing, only notebooks with Intel x86 family and compatible CPUs are capable of running Linux. The port to the PowerPC architecture may eventually support Linux. [Both the Linux/SPARC and Linux/Alpha ports have been run on laptops—ED]
Most notebooks feature keyboards with 85 keys, give or take a few, that are usually slightly smaller than those on desktop keyboards. Almost all notebooks come with PCMCIA drives capable of accepting two Type II or one Type III card. Most come with built-in 3.5" floppy drives and/or 5.25" CD-ROM drives. Displays vary widely in size, color depth, video memory, speed, and resolution. Many machines now come with integrated sound cards. Power management features are universal, but vary in implementation and effectiveness. Integrated pointer devices tend to have two buttons and come in three styles: trackballs, nub-shaped joysticks, and touchpads. Almost all notebooks feature a serial and parallel port, and offer some expandability or docking feature. Linux support exists for all these notebook features.
Installation of Linux on notebook computers should not be very much different from installing Linux on a desktop system. Most distributions let you choose from floppy, CD-ROM, hard disk, NFS, and even FTP installation sources. For the most part, choosing a suitable installation method for laptops is subject to the same criteria as for desktop systems.
There are a few exceptions, however. Some notebooks use external floppy disk drives, and there is really no standard interface for them. Most will allow you to boot and begin the installation process, but some do not support DMA transfer. Without DMA transfer capability, you may be able to boot and install from floppy, but the drive will not be useful for mounting other floppies.
Some distributions have boot disks that let you use a PCMCIA Ethernet card for NFS installation, assuming your card and PCMCIA controller are among those more commonly used. As with desktop systems, some early CD-ROM drives in notebooks used proprietary interfaces that are not supported by the Linux community. However, by carefully choosing industry-standard hardware, installing Linux on a notebook is no more or less of a task than it is on desktop systems.
PCMCIA is an acronym that stands for Personal Computer Memory Card International Association. Since this is somewhat awkward to pronounce, PCMCIA cards are also frequently referred to as PC Cards. Physically, PC Cards are about the same width and height as credit cards and only a few millimeters thick. They provide one of the most versatile ways of customizing your notebook computer, and they are not limited to memory cards.
Readily-available PCMCIA cards implement RAM, small hard disks, SCSI adaptors, fax modems, Ethernet, sound, additional I/O ports, and more. Nearly all the cards on the market today are “Type II” cards. A few larger cards, such as those that implement hard disks, are “Type III” cards, and are about twice as thick. Most PC notebooks come with a PCMCIA drive that can handle two Type II cards or a single Type III card. To use a PCMCIA card, your machine needs a PCMCIA drive and some form of “card and socket services” software. The real trick to using PCMCIA cards in Linux lies in the software.
Most notebooks that come with MS-DOS and MS-Windows installed also include the vendor's card-and-socket-services software. This layer of software facilitates communication between the operating system and the drive itself—recognizing when cards are inserted or removed and determining which device driver is associated with which card. In the Linux universe, this software is called Card Services for Linux, and is actively maintained by David Hinds. It is included in most of the popular distributions, including Slackware, Red Hat, Caldera, Yggdrasil, and many others. It is also available at ftp://hyper.stanford.edu/pub/pcmcia/ as well as the Sunsite and tsx-11 Linux archives. The latest version at the time of this writing is 2.8.x. The PCMCIA HOWTO is available on the World Wide Web at hyper.stanford.edu/pub/pcmcia/doc/PCMCIA-HOWTO.html and can also be found on the Linux Documentation Project home page.
Card Services for Linux supports all but a very few custom PCMCIA drives, which are documented in the HOWTO. The support for individual cards is a little less complete. PCMCIA cards are no different from any desktop expansion card in the sense that the card needs a device driver to interface the hardware to the operating system. And like desktop expansion cards, not all PCMCIA cards have device drivers written for Linux.
Fortunately, essentially all PCMCIA fax modems and PCMCIA serial port adaptors operate on the same interface and are therefore supported. At the time of this writing, over three dozen brands of PCMCIA Ethernet cards are supported, as are numerous FLASH/SRAM cards and SCSI cards. You can find a list of supported cards at David Hinds' Linux PCMCIA Information Page at hyper.stanford.edu/~dhinds/pcmcia/pcmcia.html. David Hinds also maintains a mailing list for announcements about updates to the Card Services package and device drivers. Information on subscribing to this service is also available on this page.
The Card Services package also comes with all the current device drivers and several utilities. The most important of these is Cardinfo, a small X11 application that reports on the present state of your card sockets: what is in them, if they are active, what IRQ and I/O ports they occupy and which device (i.e. /dev/cua0) they are using. This is a very useful utility for finding and resolving IRQ or I/O port conflicts.
The latest versions of most Linux distributions include Card Services, but if your distribution doesn't include it, you can install it yourself. To do so, you will need to use kernel 1.2.8/1.3.30 or higher, compiled with support for loadable kernel modules. You must also have the entire Linux source tree to compile the package. Installing Card Services on an existing Linux system is explained in detail in the PCMCIA HOWTO and in the readmes that come in the package. This includes detailed information to help you identify and work around any IRQ or I/O port conflicts. When running, the core PCMCIA module takes up about 48K of RAM.
Card Services for Linux supports hot-swapping cards, and loads and unloads the proper card-specific device driver modules as you insert and remove PCMCIA cards. The Card Services module can also work with the Linux Advanced Power Management driver to help conserve battery life when your PCMCIA drive is inactive.
For those who are interested in hacking, David Hinds also provides some hints and suggestions for writing and debugging PCMCIA card device drivers in his HOWTO and in the PCMCIA Programmer's Guide.
A major concern for many people taking their notebooks away from power outlets is how long their battery will last. Without any power management software, my 486DX4/75 notebook with a NiMH battery will last about forty-five minutes to an hour and a half away from a power outlet. While this will vary from machine to machine, it would be nice if this could be extended.
The goal of power management software is to manage the overall level of power consumption of the hardware by reducing or eliminating power consumption where it is not needed. This process is accomplished by communication between the hardware and operating system through a standard interface. For PC notebooks, this interface is known as the Advanced Power Management (APM) specification, version 1.1 at the time of this writing, and is defined by a document drafted by Microsoft and Intel. The specifications are intended to be operating system independent.
Although the APM specifications are intended to make power management independent of the operating system used, the unfortunate reality of the market is that some notebook manufacturers have decided to implement power management systems that work only with an MS-DOS or MS-Windows operating system.
Usually, new notebooks on the market will implement the specifications correctly, but there are many older models and even a few newer models that do not. If you happen to have one of those machines that does not implement APM correctly or sufficiently, you may be out of luck. Careful research of new machines can ensure that your machine is compatible.
APM works through communication between a properly designed system BIOS and an APM device driver in the operating system. BIOS stands for Basic Input/Output System, and is a Read Only Memory chip on your computer's motherboard. A system BIOS that implements APM can both read and modify the power consumption level of the hardware components in the machine. These components include your CPU, battery, screen, hard disk, floppy drive, PCMCIA drive, I/O ports, sound card, CD-ROM drive, and so forth.
The BIOS can communicate with the operating system's device driver, relaying this information so the operating system and BIOS can together make intelligent decisions about power levels. In this way, the operating system can power down or reduce power to those devices in the system that aren't in use, leaving more battery life for those devices that are in use. In addition, many notebooks feature a Suspend button that lets you manually put the notebook into a state of extremely low power consumption until you wake it up.
The Linux APM driver is maintained by Rik Faith, and the most recent version can be found already in kernel 1.3.46 or later. Support for APM can simply be chosen as a compile option in these kernels. Versions of the driver for older kernels and the 1.2.x kernels do exist as kernel patches, but are no longer supported by Rik and the other developers and lack some of the newer features. Those interested in APM support are therefore strongly encouraged to use a 1.3.x kernel. APM support will be a standard part of the next production kernel series, which will be called 1.4.x or 2.0.x.
In order for the APM driver to work, the system BIOS on your laptop's motherboard must support the APM version 1.0 or 1.1 interface, preferably version 1.1. It must also support 32-bit protected-mode connections. While most late model notebooks meet these requirements, a vendor's marketing claim of APM compliance is not sufficient. While the APM specifications strongly encourage laptop manufacturers to meet these standards, there is some leeway given to them. If APM support is important to you, make sure that the machine you are using meets these requirements.
In addition to the actual APM driver, there are several utilities available that use the APM kernel driver and the /proc/apm directory. These utilities are located at ftp://ftp.cs.unc.edu/pub/users/faith/linux and the current version of the utilities is available in the file apmd-2.1.tar.gz. This package includes a daemon process called apmd that logs battery status, and a utility named apm that simply outputs the information available in /proc/apm including the current battery level. For those running X-Windows, a simple utility called xapm displays a simple graph of battery life. And for those interested in hacking, a C library called libapm.a is provided so users can write their own utilities.
For those who have notebooks that do not have an adequate APM implementation in the BIOS, there is at least one other option available. A simple utility called hdparm is available which sets many IDE parameters, including how much inactivity an IDE drive should wait for before spinning down. The hdparm utility comes with every current Linux distribution, and can be obtained from ftp://tsx-11.mit.edu/pub/linux/sources/sbin/hdparm-2.7.tar.gz This is not true APM, but it's better than nothing. Hard disks use significant power and this simple utility can increase battery life up to 50%, in my experience.
While some Linux users purchase commercial implementations of the X Window System, most people who use X-Windows with Linux choose the XFree86 implementation. XFree86 is a freely distributable implementation of the X Window System server for PCs running Unix and Unix-like operating systems. Odds are your favorite Linux distribution comes with the XFree86 X Window System server.
As anyone who has ever done it before can attest, configuring XFree86 can be quite a complex and occasionally frustrating task. Notebooks can complicate things further; while you can replace an unsupported video card in a desktop system with one known to work well with Linux, laptop owners do not have that option.
Notebooks come in all varieties and use all manner of components, including video chipsets. Some are well supported by the current XFree86 implementation, whereas others may not be supported or may offer only limited support. The Linux notebook community has both development and documentation efforts for the popular notebook video chipsets. Improvements to particular drivers can occur frequently. Acquiring up-to-date information about support for particular video chipsets is possibly the most important aspect of getting X-Windows up and running well on a notebook computer.
The most important source of information for running X-Windows on Linux notebooks is Darin Ernst's World Wide Web page X-Windows and Linux on Notebook Computers available at www.castle.net/X-notebook/index_linux.html (Figure 3). This site contains breaking news and links to numerous development efforts and their status. There are two World Wide Web pages that provide information on XFree86 support for the Chips and Technologies CT655xx series of video chipsets (the most widely used in recently-designed notebooks) as well as a mailing list for developers. Other prevalent video chipsets used in notebooks are produced by Cirrus Logic and Western Digital, and these are documented as well. Links to both these pages and many other sources of information are available from the X-Windows and Linux on Notebook Computers page.
In addition to the resources on the Web (See sidebar), several Usenet newsgroups are of interest to those wanting to run X on notebook computers. In particular, comp.os.linux.x and comp.windows.x.i386unix are the most relevant.
Many of the more recent notebooks come with integrated sound cards that are compatible with popular standards such as SoundBlaster. Many of these sound chipsets are new to the market or are reduced-size variations of chipsets used on desktop sound cards. Support for these chipsets can be found in the most recent release of the Linux sound driver. It is maintained by Hannu Savolainen at personal.eunet.fi/pp/voxware. The sound drivers are updated more frequently than most popular distributions, so checking the documentation at this site can produce pleasant surprises. But just as with desktop machines, SoundBlaster compatibility is often accomplished partly through hardware and partly through MS-DOS-based software. Therefore, you must take the same care when investigating a notebook's sound capabilities as when choosing a sound board for a desktop computer.
Networking with PCMCIA modems using SLIP or PPP is not substantially different from using a desktop machine with an internal or external modem. Simply remember to build SLIP or PPP support into the kernel you use. PCMCIA Ethernet networking is likewise similar to a desktop setup; you must have TCP/IP networking support compiled in your kernel and the appropriate PCMCIA Ethernet card device driver.
One exciting new networking project of which Linux has become a part is Mobile IP. This software supports transparent host mobility across TCP/IP networks and can be found at http://anchor.cs.binghamton.edu/~mobileip/ (Figure 4).
Almost all notebooks on the market today feature integrated pointer devices which vary in size and shape and in how they interface to the rest of the hardware. Most recently-designed notebooks have pointer devices that are PS/2 devices, so linking /dev/mouse to /dev/psaux and ensuring that support for PS/2 devices is in the kernel is all you need to do.
Some older notebooks used special controller chipsets for their pointer devices, some of which are supported in the kernel. If you have one of these older notebooks, your pointer device may or may not be supported. In any case, you can hook up a serial mouse to your serial port and use that.
Many notebooks allow the use of external keyboards or mice, frequently through an external PS/2 style port. Generally, these devices are managed through hardware and should work seamlessly with Linux. Most notebooks support external video monitors as well, and larger resolutions of external monitors can be exploited under X with properly configured XFree86 files.
Linux has a strong tradition of user-based support such as the Linux Laptop Volunteer Support Database available at www.cs.utexas.edu/users/kharker/linux-laptop/volunteer.html. Volunteers provide their e-mail addresses and machine makes and models. Those looking for help can search for their hardware and find volunteers willing to answer installation or configuration questions. This can also be an excellent way to find a working XF86Config file. At the time of this writing there were over 200 volunteers from 36 countries.
The Linux Laptop Home Page that I maintain can serve as a good springboard to the world of documentation and support available for laptops running Linux and is available at http://www.cs.utexas.edu/users/kharker/linux-laptop/ and www.redhat.com/llhp/. Everything mentioned in this article and more can be found from the Linux Laptop Home Page, which is updated regularly.
The world of mobile Linux is very exciting. The ability to take your workstation with you appeals to many people. Concerns that choosing Linux as an operating system might limit access to or benefits from the various features that make notebooks really useful are largely unfounded. Active development and documentation efforts are supporting all aspects of mobile computing under Linux. If you've been considering running Linux on a notebook or laptop computer, there's never been more interest or support than there is now.
Kenneth E. Harker (kharker@cs.utexas.edu) maintains the Linux Laptop Home Page. In his spare time, he is a graduate student of the computer sciences at the University of Texas at Austin, an amateur radio operator, and an avid fan of Babylon 5.