Eric Lee Green
Eric's Home Page

Menu:

Home
UP
EDITORIALS

Links
Contact Info
My Resume
My Public Key
EMAIL Eric

BadTux Portal[et]

Linux on my Laptop

A case study of my Compaq 1800 series (model 18XL580)

Wherein I set up every geegaw and widget under the sun

*NEW* 7-1-2001 Added section on how to get around the eth0 timeout when using the wlan card!

For years I lived without a laptop. Recent events, however, left me with a need for a laptop that was not 5 years old and held together with epoxy and bailing wire. So I took the $2,000 that I got from selling my old Ford Aspire, and went looking for a laptop.

My biggest desire was that every piece of hardware on the laptop be supported by Linux. The other desire was that it be less than $2,000, but I was willing to compromise a little on that. I discarded Sony as a possibility because of Sony's arrogance and lack of support. Due to IBM's vaunted Linux initiative I looked at a couple of IBM models, but I don't like swizzle sticks, I'm accustomed to touchpads. Then Fry's Electronics ran an ad for a Compaq Presario: PIII-800, 192mb of RAM, 20gb hard drive, $1899. I checked Compaq's home page and found out that was an 1800 series laptop, model 18XL580. I checked the Linux on Laptops home page to see whether it was a well-supported platform, and VOILA!

The Laptop

The Compaq Presario 1800 line are Compaq's "home/SOHO" line. They are designed to be inexpensive workhorses. They have a few fancy little gimmicks such as the "Disqplay2" on the front (which supposedly will let you play CD's while the lid is closed), but lack the hot-swap bays, firewire port, and dual PCMCIA slots of more expandable/upscale laptops.

My 18XL580 has a 15" LCD display capable of 1024x768. On the front is a Synaptics touch pad which is supported out of the box by XFree86 but which can also be configured by the tpconfig utility. On the right side is the battery bay (which is a pain to access), a single PCMCIA/ Cardbus slot, headphone out, microphone in, Linmodem, and 100BaseT Ethernet port. On the left side is the floppy, and a DVD-ROM drive. On the rear is 1 USB port, 1 serial port, 1 printer port, 1 mouse/keyboard port, a video out port, and a port expander connector. There's also a fan. It doesn't run most of the time. This doesn't mean it's broken. Compaq says that it only runs when the temperature exceeds 50C, and cuts off when the temperature gets down to 40C. I've noticed it running mostly when I'm charging the battery while doing lots of compiles or other such CPU-intensive stuff.

From Compaq you can get the following accessories for the 18XL580: A port expander (which adds another USB and serial port, as well as having both mouse and keyboard ports), extra battery, and extra power supply. There's no real "base station"/expansion chassis like with some laptops (which adds more PCMCIA slots etc.). That's not the Presario's marketplace. This isn't the most expandable laptop in the world -- and the price reflects that.

Installing

The computer came with Windows ME on two partitions, a 15gb Windows partition and a 5gb Windows partition. Under Windows I created a boot recovery diskette and copied fips.exe onto it off of the Red Hat 7.1 disk 1. I then rebooted onto the diskette and shrunk the first partition down to 3gb. I figure that'll hold all the Windows stuff that I'll ever do. I decided not to make my laptop Windows-free because many things that on other laptops would be adjusted via the BIOS are adjusted via Compaq utilities that are Windows based. I popped out the diskette, booted into the Red Hat install, and allocated the other 17gb for Linux. I made a 10mb boot partition and a 3gb root partition. I kept the rest reserved -- you'll see why in a few minutes. Upon reflection, if doing it again I'd probably expand the root partition to 4gb -- Red Hat Linux really *IS* a pig, my / partition is currently 83% full (albeit that's because I have every development tool under the sun installed there).

Red Hat 7.1 slid on immediately. "X" detected my video, touchpad, and display, the network card was detected, the sound was detected on first reboot. I then formatted a 1gb /home partition and 12gb /usr/local partition using the Reiser filesystem (Red Hat 7.1 *STILL* does not support the Reiser filesystem in its install). In my opinion the Reiser filesystem is the best filesystem available for Linux today -- its journalling design means that it is much less likely to lose data upon a system crash, and its tree-structured design means that a 500 byte file doesn't end up taking up 4K or 8K on disk. I have lots of small files, so I appreciate this. So that's why I delayed until *after* the Red Hat install.

The next piece of hardware to get working was the modem. I downloaded the LTwinmodem driver for the Lucent Winmodem chip and installed it. I have no idea whether it works though -- I don't have anybody with a modem to call. It SHOULD work, though.

By this time I had a laptop that worked fine on my home network. It mounted file shares off my fileserver, it printed to that file server's print spools, etc. But when I took it to work, things spewed all over the place. My resolv.conf was wrong, etc. So I created an /sbin/ifup.local script. It checks the ifconfig to see whether 192.168.5. (my local network) or 192.168.1. (my work network) is the one. It then hacks the correct address for ssh'ing to my fileserver into my /etc/hosts (my fileserver can be ssh'ed from outside the firewall, via port forwarding -- that's the only port open on my network -- I use that to do cvs and check EMAIL from work), and the script also sets the /etc/resolv.conf to the appropriate value. It also hacks my /etc/fstab so that if I'm at work, it doesn't try to mount my NFS file shares.

At this point every piece of hardware that came with the laptop was working, and working properly. Next came some accessorising.

Emulators

I have two emulators installed:
  1. Win4Lin: for checking things out via Internet Exploder and doing Windows development as needed.
  2. User Mode Linux: So I can compile Red Hat 6.2 programs (because everything done for work has to be compiled for Red Hat 6.2 first).
Win4Lin is the easiest one. It runs a real copy of Windows under Linux. It hacks the kernel (via a few modules) to support the Windows virtual memory model and I/O, and uses a couple of directories in your home directory as the "hard drives". You then install a real copy of Windows into this "virtual machine". The result is impressively swift. As long as you're not designing 3d graphics programs, it works quite well, or as well as Windows ever works (grin). The problem nowdays is getting a copy of Windows to run in it -- Microsoft has done their best to insure that you no longer get an installable copy of Windows with your system, so you end up either a) buying a second copy of Windows (what? Pay the Microsoft tax *TWICE*?!), or b) if you are a developer working for a MSDN subscriber, and you will be using Windows for developing and not for anything else, you can use the MSDN version of Windows.

User Mode Linux is a bit harder to deal with, but getting easier by the minute. To understand User Mode Linux, it's useful to think of each program under Linux as running on its own seperate virtual machine. This virtual machine has some additional instructions compared to the base "raw" machine, such as open(), fork(), read(), and write(), but you can port Linux to this virtual machine just as you can port Linux to any other kind of machine -- and some sick mind did exactly that (grin).

User Mode Linux is a version of Linux ported to the Linux virtual machine architecture. It's that simple. It uses big files as its "hard drives", and uses the Linux "tap0" ethertap device (with a suitable helper running on the host OS to handle the ARP forwarding and routing) as its network interface. For its console, it uses the "X" window that you opened it with. You can set your DISPLAY variable inside that console to point to your "real" Linux machine, and voila! (Note: To do this, you must first configure "X" to listen to a TCP socket, via setting the appropriate option in /etc/X11/fs/config , and then restart "X").

You need to download two pieces to get it working: a kernel, and a root disk. I downloaded the RH62 root disk, but ended up tarballing my development machine (running Red Hat 6.2) at the office, untarring it into a 2gb file named 'root1' mounted via the loopback device as a Reiser filesystem, and making the changes in that 2gb to /etc/fstab needed to deal with the differing device names. I also created a 128mb swap file using dd and 'mkswap'. I then unmounted the device, booted up with linux ubd0=root1 ubd1=swap1 mem=64m eth0=ethertap,tap0,,192.168.1.11, and voila! Note that you need two IP addresses for the UML -- the tap0 address (the 192.168.1.11 used above), and an internal IP address (used within the virtual Linux), 192.168.1.10 for example. And my laptop lives at 192.168.1.100 or some such, so my machine now uses three IP addresses on the network, sigh... but you can see how this will be useful for ISP's and others in the future, as well as interesting for the security implications. Heck, you can even define virtual clusters to test out clustering software -- without having to buy extra machines!

Neat Hardware

What's the use of a laptop if you have to plug it in everywhere? So I dropped by Fry's Electronics and bought another couple of pieces of hardware - an Addtron AWS-110 wireless access point, and an Addtron AWP-100 PCMCIA wireless network card. This is a generic Intersil/Harris Prism2-based setup, capable of 11mb/s. The compatibility list on the AWP-100 said "Windows 95/98/NT/2000/ME, WinCE 3.0 or higher, Linux (Red Hat)" so I figured it would work. It did, eventually, but only after wasting my whole weekend on it.

Hint: Do not try plugging a 10baseT wireless access point into a 100baseT fixed-speed hub! It doesn't work. Believe me :-). When I moved the AWS-110 up to the switch, so it could run at 10baseT speeds, it worked MUCH better. Chalk it up to having too many devices on my home network (grin), so that I need both a switch and a hub to hold them all. One hint: The current Linux drivers do *NOT* do WEP encryption yet (he's working on it, so that may have changed by the time you read this, but for the moment let's try without WEP), so disable the WEP on the base station and set it to "Open Network". Set the ESSID to something unique to you like your home phone number when you were 5 years old (the one the kindergarten teacher made you memorize and you have never forgotten it since).

Once I got *that* fixed, then I booted under Windows, initiated communications, and everything worked. So I knew both the base station and the card worked. But when I booted under Linux, the network card did *NOT* work. So I spent a day figuring that out. It turns out that the drivers for this setup are very immature. If you compile them in the wrong order or with the wrong options, you get modules that refuse to load. I finally managed to hit the magic order though.

Here's the condensed version:

  1. Compile the latest 2.4 kernel with all the desired options from ftp.us.kernel.org (or whatever national kernel mirror you use). Don't forget to apply Win4Lin patches first if you want to use this kernel with Win4Lin! Also don't forget to compile the PCMCIA modules (I could not get this working with the pcmcia-cs package, alas).
  2. Boot under that kernel.
  3. Get the latest pcmcia-cs package from SourceForge. Extract it and do a 'make config' and 'make all'. Do *NOT* do a 'make install'!
  4. Get the latest WLan drivers from linux-wlan.org. I used linux-wlan-ng-0.1.8-pre13. Extract it and do a 'make config'. Tell it where your pcmcia-cs and kernel sources are, tell it that you're using the kernel pcmcia implementation, then do a 'make all' and 'make install'.
  5. Edit /etc/pcmcia/wlan-ng.opts. Set the DesiredSSID to the same value as you set the ESSID to on the base station. Make sure that PrivacyInvoked is still set to 'false', and that authtype is 'opensystem'.
  6. Insert the card. It should beep, then make a 'bonk' sound as it fails to initialize.
  7. Run 'netcfg'. Edit interface 'wlan0' to have the desired IP address etc. then save and exit.
  8. Pop the pcmcia card out, then back in. You should hear it beep. It should now be working! If not, well, you heard me say that this was definitely beta-quality drivers, right?
So now I can carry my laptop to the breakfast table, flip it open, and be on the Internet while eating breakfast, all with no wires, Ma! Pretty cool. Pretty geeky. The only real glitch is that my eth0 is DHCP-configured, so it takes a minute for my laptop to get past that point during boot. That's the disadvantage of a built-in network card. If it were a PCMCIA card, I'd just pop it out, pop in the WLAN card, and voila. But it's not. I can't pop it out. It's permenant. So I live with the one-minute delay :-(.

How to get around that one-minute delay:

Okay, this is some serious hacking of the startup scripts and such. The first thing I did was hack my /etc/lilo.conf to create "linux.wlan" label:
image=   /boot/vmlinuz-2.4.5
   label = linux.wlan
   read-only
   root = /dev/hda3 
This points to the same kernel that I use for normal boots.

Next, I hacked the very top of my /etc/rc.d/rc to check the $BOOT_IMAGE variable. Note that /etc/rc.d/rc is the very first thing run upon system boot.

# eric mods this is a hack/kludge/etc.!:
if [ "$BOOT_IMAGE" = "linux.wlan" ]
then
   cp /etc/modules.conf.wlan /etc/modules.conf
else
   cp /etc/modules.conf.lan /etc/modules.conf
fi
Finally, I created an /etc/modules.conf.wlan that omitted the eth0 entry,and copied the pre-existing /etc/modules.conf to /etc/modules.conf.lan.

Now all I have to do is choose the "linux.wlan" item in the boot menu, and voila, Linux no longer knows about my built-in Ethernet interface. All attempts to access eth0 fail with a "cannot access device" failure, and I thus skip the ugly 1 minute wait!

Conclusions

So far this laptop has been a workhorse. It's not fancy, but it does what it was designed to do, does it well, and does it well with Linux. I can definitely recommend the Compaq Presario 1800 series laptops for use with Linux.

-- Eric Lee Green


Note that everything on this page is Copyright 1997-2003 Eric Lee Green and represents my own opinions and nobody else's. Reproduction without permission strictly prohibited.

Created with PHP 4. Last modified Fri, 06 Dec 2002 10:27:39 -0500.