Introduction
An early laptop receiving a weather chart,
somewhere in the Pacific
during my circumnavigation, circa 1990
As time passes, putting Linux on a laptop is becoming easier, because:
- The Linux kernel is growing up and showing more awareness of the nature of the machines on which it is installed.
- The technical distinction between a laptop and a desktop is becoming smaller.
- The percentage of overall PC sales represented by laptops is becoming bigger, forcing a recognition of their requirements.
I remember early laptops and how profoundly they differed from desktops. I also remember early Linux kernels and how they would strangle on anything but a small number of widely known desktop models.
Early laptops tended to be very expensive for their abilities. They gave the dinstinct impression that they were an imitation of the Real Thing™, sort of like a dollhouse instead of a house — a rehearsal for desktop reality.
Laptops also tended to have rather short lives compared to desktops. I can't tell you how many laptops I've thrown away after embarrassingly short service lives, including perhaps half a dozen, now sleeping with the fishes, tossed overboard as I sailed around the world.
Some of these issues are present in current laptops, but to a lesser degree. They're still more expensive than desktops of the same capacity and processing speed, and they do tend to expire more quickly, but manufacturers are reacting to their popularity by engineering them better, and well-understood market forces are making them less expensive.
Given the history of laptops as a plaything of wealthy early technology adopters, perhaps it will surprise you to know that MIT's Nicholas Negroponte has chosen laptops for his much-discussed
One Laptop per Child project, meant to make modern computer technology available to third world children.
Mr. Negroponte very clearly sees a tipping point in laptop design, in which laptops will become less expensive to own and operate than equivalent desktops. This hasn't happened yet, and at the moment his project is long on hope and short on hardware, but I think Mr. Negroponte got one thing right — as to personal computers, laptops are much more personal than dekstops.
Laptops as Desktop Replacements
Some modern laptops meet a demand exemplified by the laptop being discussed here — as replacements for desktop machines. This trend in laptop design, just getting started at the time of writing, shows that manufacturers are responding to consumers' dislike for the giant-breadbox model of personal computing.
I have two recent Dell desktops in my computer room (Dell Precision 450), and over time their patent ridiculousness is slowly dawning on me. They are each about six times larger than they need to be, and their interiors are mostly air.
To be specific, the desktops each occupy almost 2000 cubic inches of space. By contrast, the subject of this article (Dell XPS M170) occupies about 305 cubic inches (that's about 1/6th the volume), and yet it delivers most of the performance of the bigger machines.
This particular laptop is also more expensive than an equivalent desktop, so I have to justify it to myself, but that is not difficult. I spend much of my time on the road (or on the water), places I can't take a desktop. For example, each year I take my boat to
Alaska, where for about four months I don't have either the space or power for a desktop machine.
Readers may wonder how important a laptop can be in the wilds of Alaska. After all, how many wireless access points are there? My answer is that I use the laptop for open-ocean navigation. My boat has a GPS (Global Positioning System) satellite receiver that tells the laptop where I am, the laptop contains a huge repository of nautical charts in electronic form, plus some routes I have created that I want the boat to travel along, and finally, leaving nothing to chance,
the laptop steers the boat. So yes, if I can get a better or more reliable laptop, try to stop me. :)
In the past I have disliked the typical small laptop displays and poor resolution, and absolutely hated the little keyboards and the little touchpad stand-ins for mice, but some of these issues are going away. In fact, I just noticed that this new laptop has a display equal in size to my standard desktop panels (17 inch diagonal). I have always used an ordinary mouse instead of the provided touchpad, which means I rarely try to use a laptop in its eponymous locale (that is to say, "in my lap").
Installing and Running Linux
Dell XPS M170. Notice the silly blue lights.
Apparently someone at Dell saw "The Fast and the Furious".
Now for the essence. Obviously I could have accepted the default operating system that comes with all modern PCs, thereby supporting the continued existence of a vast and evil empire, but I prefer Linux, in both a practical and philosophical sense.
As to Linux, Dell Computer is slowly coming around, now offering some desktops with Linux pre-installed, but this isn't true for laptops yet. I would like to ask those of my readers who are inclined, to specifically request Linux on each and every machine they purchase from Dell. I think over time Dell will get the message.
I have been running various flavors of Red Hat Linux since about 1995, and used other Linux or Unix versions before that. Over time I have had one or another version of Windows installed on a dual-boot machine, or two machines, one running Windows, one Linux or Unix.
I ran Windows for the simple reason that there were some programs only available for Windows, programs I was too lazy to write myself. But my personal turning point came when XP was released (or perhaps it escaped), and (because of something called "product activation") I realized I would have to ring up Darth Vader to allow me to install his product. At that moment I laid plans to evict Windows from my life, and after a period of withdrawal I have managed to do without Windows almost completely. (Doesn't this sound like the rant of a recovering alcoholic?)
I am now running Fedora Core 4. That's as close to the cutting edge as I want to get, and I find it manageable with various tweaks I will be discussing later on. I don't have much difficulty installing it (and its predecessors) on the various desktop and laptops I own. And I am accumulating a pile of Windows XP OEM disks. :)
Now to the specifics. The laptop is a Dell XPS M170 with an 80 GB hard drive, 1 GB of RAM and a Pentium "M" processor with a 2 GHz clock. After installing Fedora Core 4, in preliminary tests I found that both the hard drive and the CD/DVD drive were way below expectations in read/write performance. I knew I had to solve this problem.
Some preliminary notes. For those of you who don't do much Linux system testing, I have some suggestions. In the list below, the symbol "$" means "run in a shell as a normal user", and "#" means "run as root". I'll be using this notation convention through this article. And ... please, avoid running commands as root if you possibly can.
- Find out what clock speed the system is currently using:
$ cat /proc/cpuinfo | grep MHz
cpu MHz : 1995.391
- Test the performance of a hard drive:
# hdparm -t /dev/sda
Timing buffered disk reads: 122 MB in 3.02 seconds = 40.45 MB/sec
- List system PCI devices:
$ /sbin/lspci
(long list of PCI bus devices)
- List system USB devices:
$ /sbin/lsusb
(long list of USB bus devices)
The above "hdparm" test result is for the Dell XPS laptop as it is now, but at first there were several differences. One, the hard drive read test result was very poor, as in about 2 MB/sec. Two, the drive was associated with the device "/dev/hda", not "/dev/sda". The difference? It turns out that the /dev/hda assignment means the kernel thinks the drive is ATA (or, equivalently, IDE), the older, slower drive type. I happened to know this drive was SATA (serial ATA), a recent big improvement in bus interfacing, at least in principle.
Digression. Find out if a system has a SATA controller:
$ /sbin/lspci | grep -i sata
00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
I decided to remedy the hard drive performance deficiency. My first step was to browse Google postings on this topic. Through reading what other people had done to squeeze maximum performance out of their SATA drives, I produced a successful strategy that I will summarize here.
The basic issue is that a Linux kernel with default option settings will assume connected drives are ATA, but this safe, conservative assumption backfires if the drives are SATA. In the case of SATA drives, the default kernel behavior will result in slower drive performance than the older ATA technology drives, even though SATA drives are much faster if handled correctly.
After applying some of the first steps in the list below, I managed to get the hard drive up to expected speed, but the CD/DVD drive was a tougher nut to crack. The entire list below was required to get both the hard drive and the CD/DVD drive performing at top levels (and resulted in both drives being identified as SCSI):
- Get a suitable kernel source and install it. Try http://www.kernel.org/. My examples here were with respect to kernel version 2.6.13.1, some details will change over time (and I don't aggressively replace my kernel on a regular basis).
- Create/edit (source path)/.config, either by hand or by using the "menuconfig" or "xconfig" kernel configuration helper apps.
Here's an easy way to move to your current kernel's source directory in the various incarnations of Fedora:
$ cd /usr/src/linux-`uname -r`
Here are the primary changes to the kernel configuration. In /usr/src/linux-`uname -r`/.config, make these changes:
- Select "SCSI device support", not as a module.
CONFIG_SCSI=y
- Select "Serial ATA (SATA) Support", again, not as a module.
CONFIG_SCSI_SATA=y
- Deselect ATA/ATAPI/MFM/RLL support:
CONFIG_IDE=n
CONFIG_BLK_DEV_IDE=n
The strategy here is to force the kernel to treat both drives as SCSI/SATA, rather than making the default ATA assumption.
With the above changes, the hard drive will be treated as SATA, and it will be fast. But to get SATA support for the CD/DVD drive, we need to edit one of the kernel source files:
- Edit /usr/src/linux-`uname -r`/include/linux/libata.h.
Change these lines:
#undef ATA_ENABLE_ATAPI
#undef ATA_ENABLE_PATA
to this:
#define ATA_ENABLE_ATAPI
#define ATA_ENABLE_PATA
- Recompile and install the new kernel.
If you have taken all the required steps, the hard drive and the CD/DVD drive will have new device assignments:
Before -> After
/dev/hda -> /dev/sda
/dev/hdc -> /dev/scd0
And your "hdparm" test should produce the result listed above, e.g. disk read speed about 40 MB/sec, which approaches the performance of a modern desktop.
Testing a CD/DVD drive is more difficult, and the "hdparm" read test doesn't reveal much, because a CD/DVD drive doesn't actually have a very high read/write speed, but the performance improvement is there nonetheless. I personally test both a computer's display and its DVD drive by playing a DVD movie using Xine or another similar video player program. To play a DVD without glitches or dropped frames, a computer has to be properly tuned in a number of ways. On that topic, to really test a DVD drive, run Xine from the command line like this:
$ xine --verbose=3 dvd:/
If there is anything wrong with your system's configuration or kernel options, Xine will complain about dropped frames in the shell output, or the sound won't synchronize with the video, etc.. In extreme cases Xine will launch an XWindows dialog to complain about your crappy system.
Display and XWindows Issues
There were no big surprises here, and (after installing the
NVidia driver that can't be included with Fedora) I was able to get the full display resolution of 1920x1200 without much difficulty. Here are some interesting entries in /etc/X11/xorg.conf:
- An entry to turn off the annoying touchpad (I can't stand them — I always use a regular mouse):
Original Line (in "Section 'InputDevice'"):
Option "Device" "/dev/input/mice"
Change to:
Option "Device" "/dev/input/mouse2"
- The block that specifies the monitor:
Section "Monitor"
Identifier "Monitor0"
VendorName "Dell"
ModelName "LCD Panel 1920x1200"
HorizSync 31.5 - 100
VertRefresh 30.0 - 90.0
Option "dpms"
Option "UseEdidFreqs" "yes"
EndSection
- The block that specifies the driver (NVidia in this case), and that activates the TwinView option (see below for more on this):
Section "Device"
Identifier "Card0"
Driver "nvidia"
VendorName "nVidia Corporation"
BoardName "Unknown Board"
BusID "PCI:1:0:0"
Option "RenderAccel" "True"
Option "TwinView" "1"
Option "MetaModes" "1280x1024,1280x1024;1024x768,1024x768"
Option "SecondMonitorHorizSync" "31.5-100"
Option "SecondMonitorVertRefresh" "30-90"
Option "ConnectedMonitor" "CRT,CRT"
Option "TwinViewOrientation" "Clone"
EndSection
To disable TwinView, simply don't have a second monitor attached, or select "TwinView" "0".
- The block that specifies the screen:
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1920x1200"
EndSubSection
EndSection
A depth of 24 pixels is an option, of course. I use 16 because many graphics-intensive programs run faster with a depth of 16.
One use for the "TwinView" feature
Some notes:
- I don't list all the possible resolutions I might want to use in the "Screen" section, instead I edit the configuration on the fly using a Perl script and then restart XWindows, for the single resolution of interest. That way, the desktop resizes along with the display (someday XWindows will allow a meaningful change of resolution without restarting).
- I use NVidia's TwinView feature to drive a second, larger monitor on my boat, one that I can see while I am watching out for logs and icebergs in Alaska. Just comment out the TwinView lines if you don't want this feature.
When I took this laptop to my boat for testing, I had left it in the 1920x1200 pixel, full-resolution mode, but when I plugged in the second monitor and turned on the system, the XWindows boot-up routine detected the second monitor, noted my wish for TwinView, assessed the capabilities of the connected monitors and chose a resolution they could both share, exactly as I had hoped. I was astonished.
Wireless Adaptor Issues
I had ordered this system with one of the wireless adaptors that Dell offers in their slick online ordering system, but once I started configuring it, I realized I had made a mistake. The default wireless interface choice was an Intel 2200BG, which I must say I haven't had much luck with. I tried both the
Linux native driver and an approach that uses the Windows driver managed by a program called
ndiswrapper, but regardless of the setup, the signal levels were far too low and the interface misbehaved in a bunch of ways.
At that point, I realized I was repeating a prior experience on a laptop of a different make, but using the same wireless interface — I mean exactly the same experience, even the part about low signal levels. On the earlier occasion I had completely disassembled the laptop, thinking there was something wrong with the wireless antennas, only to realize the problem was the Intel interface.
But for the Dell, I realized I had some spare interfaces that I trusted, even though the manufacturer (Broadcom) steadfastly and notoriously refuses to reveal any hardware details that would allow a native Linux driver to be created. I popped a Broadcom BCM4306 into the Dell, set up a combination of the Windows driver and
ndiswrapper, and the problems disappeared.
Overall Impressions
The urban spoiled-rich-kid race car as computer.
The computer as urban spoiled-rich-kid race car.
Now that it's been tuned up, this laptop is quite a performer. Its overall speed (meaning a combination of processor, RAM and hard drive speeds) rivals my desktop systems. Ironically, something I didn't realize when I ordered it, its display has the highest resolution of any monitor I own, and its 17" diagonal display is really quite large for a laptop, but that's all right with me, because I don't use laptops as laptops — I don't pack one around with me and I don't have to make it work sitting on my lap. And I always use them plugged in, so I don't care about battery life either.
One more thing. I don't know whose idea it was to put the six groups of froo-froo lights on this system, but (mostly because of my age) I know I'm not the right audience for this "feature". But, after due reflection, I figured out how someone came to believe this functionless gimmick would sell computers.
This system is sort of pricey, so its natural audience is people like me, people who actually need a terrific computer.
But, for a small additional cost, Dell could attract another audience, the same people who think the cars in "The Fast and the Furious" (a movie seemingly about urban street racers) actually need to have those cool colored lights underneath to go faster.
When I first noticed the lights and as a first impression, I thought someone at Dell had lost his mind. The computer business is really quite cut-throat, worse than the TV manufacturing business and more so each day, and no one wants to risk professional suicide by adding a gewgaw to a design that won't pay for itself in the finished product.
But after some reflection, I realized the designers had actually thought it over before adding the lights, realizing someone like me wouldn't care much one way or another, but they would surely attract an entire additional group of customers: spoiled rich kids (SRKs).
If you don't understand the SRK phenomenon in its full dimensions, you have to go see "The Fast and the Furious," a movie that is only apparently about urban car racing. It is in fact a well-designed celebration of conspicuous consumption and diligent avoidance of reality. It is also, in some measure, a commentary on Los Angeles — nowhere on earth do people worship cars as they do in Los Angeles.
One character in the movie, played by Vin Diesel, can afford his race cars only because he steals whole truckloads of merchandise right off the highway, so his character at least touches a sordid kind of reality, but the rest of the characters are obviously congenital SRKs — no visible means of support, bored, shallow, attracted like moths to any sort of superficial attraction ... for example, colored lights.
What I am saying is I figured it out. Because SRKs are real, and because they shop, Dell's decision made sense. Someone will buy this computer based on its resemblance to a tricked-out urban race car. But don't let all the pandering turn you away. This is actually a terrific laptop.