jblum.com

Home ] photography ] about ]


 

Command line Linux on a laptop powered by 4 AA batteries [06/13/2004]

Or, why command line can be your best friend, and how to do it with an ancient Gateway Handbook.

In college, I used a Gateway Handbook 286 laptop to type my papers. It was the size of a large pencil box, had a decent keyboard, and would run on AA batteries in a pinch. To my lasting regret, I sold it toward the end of college and moved on to chunky Windows laptops. Thanks to eBay and more hours of fiddling than I'd ever admit, I've retrofitted a Gateway Handbook 486 laptop with modern components to transform it into a swanky command line Linux box that can go with me anywhere. I keep a journal, compose emails, and work on text documents. The setup:

  • Easily slips into a day bag, and weighs less than three pounds.
  • Processes text with very powerful tools: command line Linux with emacs.
  • Displays 34 lines of 80 column text.
  • Is comfortable for touch-typing - 85% the size of a full-size keyboard.
  • Runs on 4 AA NiMH batteries - no need to lug an AC adapter around.
  • Has a PCMCIA slot that makes it easy to transfer files to and from another machine.
  • Has no moving parts to break - the hard drive is replaced with an 800MB flash drive.
  • Is absolutely silent - no fan, hard drive is removed, and the speaker is disconnected.
  • Resumes in a few seconds, and never has to be rebooted, even when changing the battery.
  • Is Y2K compliant, at least with Linux - dates past 2000 work fine. (DOS may have more problems here...)
  • Is dirt cheap so I don't have to worry (too much) about breaking or losing it.

I find it refreshing to have a very straightforward machine that only does text. No distractions, no accessories to worry about, no crashing or rebooting, and requires only a spare set of AA NiMH batteries and tiny AA charger to keep it going indefinitely. Want one for yourself?

GET A GATEWAY HANDBOOK 486 AND FLOPPY DRIVE

First, take a look and make sure this is really what you want. Gateway has specifications on their site, and Google is always your friend. eBay is your best bet for buying one. I bought a set of 6 mostly working Handbooks for around $45 including shipping, but I've seen individual ones in good shape go for as much as $100. There are several processor speeds available, ranging from a 486SX-25 to a 486 DX2-50. I use a DX2-50, but the others would likely work fine as well. I keep a DX2-40 as a spare in case my current one breaks, but I haven't tried setting it up.

You may be able to get by without a floppy drive, but only if you like banging your head against a wall. Updating the BIOS, running Linux install disks, and transferring files before the machine is fully set up are all much easier with the external floppy drive. If you don't get the floppy, you'll have to remove the hard disk and install DOS on it on another machine, do your installs over the serial port, or hope that the OS that happens to be installed in the hard drive will recognize the PCMCIA slot and let you use a memory card to move files back and forth. You'll keep your sanity with a floppy drive handy.

UPDATE THE BIOS

You want to update to BIOS 1.25 - earlier BIOS versions had trouble with power management and other important issues. Instructions and the BIOS update program can be found on the Gateway website.

UPGRADE THE RAM

If you're only going to run DOS, the built-in 4MB of RAM should be sufficient. For Linux, you'll want to max out the memory to 20 total MB with a 16MB RAM module that plugs into the bottom of the machine. Luckily, www.kahlon.com sells the 16MB module for $12 at the time of this writing (inexplicably cheaper than a 4MB module), including shipping.

Installation is easy - but first you have to run a utility that prepares the laptop to recognize the new memory. I think this just shuts everything down so that a cold boot happens next time, but who knows. I've installed RAM modules without doing this first, and just poked the hard reset button on the bottom of the machine with a paper clip, but your mileage may vary. To be safe, run the utility.

Next, open the RAM hatch with a screwdriver. The hatch is on the bottom of the machine, sort of under the arrow keys. Be careful not to plunge the screwdriver into the machine when the hatch pops off, as you'll stab the memory connector or the mainboard, neither of which are designed to withstand a sharp-edged onslaught. Put the memory module into the slot, and push it down to seat it under the catches that hold it in place. Replace the hatch cover, and you're good to go. Make sure the machine boots up and tests all of the RAM.

OPEN UP THE MACHINE

Unlike the 286 Handbook, this isn't too hard:

  1. Turn off the machine & remove the battery.
  2. Turn the machine upside down, and remove all 4 screws on the base of the machine.
  3. Remove all the little screws in the battery compartment.
  4. Gently wiggle the battery release catch until it comes out - you must do this, or the machine won't open.
  5. With all screws removed, turn the machine right-side up.
  6. Flip open the covers for the serial and floppy ports.
  7. Open up the screen so the keyboard is exposed (as if you were going to use it).

Now for the hard part. The machine doesn't open easily - there are plastic catches all the way around that will sound like they are snapping as you open the machine. Some of them may break, which isn't a disaster, but be careful. You want to open the left side of the machine first - the cables connecting the two halves are all on the right side, so you want to lift the left side up, and rest the top half vertically on the right side of the machine. It is much easier to do this with the screen open. You may need to insert a screwdriver between the two halves to get some of the catches to pop. I haven't found a foolproof way to do this - just wiggle and pry gently until you've separated the two halves, being careful not to stress the cables connecting them.

Details on all of the following appear in later sections, but here's the basic rundown of important stuff inside:

  • CMOS battery that you'll probably have to remove and replace: the blue-edged disc toward the left.

  • Speaker you may want to disconnect to help silence the machine: the small connector with black and white wires (hard to see in the picture) immediately to the right of the CMOS battery.

  • The hard drive has been removed from this machine, but would fit in the blank area in the lower left corner.

  • The keyboard is also not connected in this picture - there are two ribbon connectors on the right side that would normally be connected when you open the machine, which is why you need to open it up and tilt  the keyboard/screen up and to the right.

When you put the machine back together, the battery release catch will actually appear to fit fine even if you put it in upside down. However, this will make it very difficult to slide the switch, so before screwing the release catch down, make sure it slides back and forth easily.

REPLACE THE HARD DRIVE WITH A FLASH DRIVE

The hard drive is probably 80-250MB, but is power-hungry, noisy, and almost certainly well past its design lifetime. I replaced the hard disk with a Sandisk 800MB flash memory disk, purchased on eBay for $40 including shipping. This took some fiddling - the BIOS wasn't made to recognize large hard drives. I partitioned the 800MB flash drive into a 208MB ext2 (Linux) and a 550MB FAT (DOS) partitions. It may be easier to get the drive to work if the first partition is smaller than 250MB, but this is just a guess.

You may need to write the MBR to get the drive to boot - this also took some fiddling. Every time I cold boot the machine it now says that it can't find an operating system on the drive, but when I press F1 to continue, Linux happily boots with no problems. For a while, before I wrote the MBR using the Slackware install disks (there is an option to do this during setup), the machine would just hang on a blank screen unless you booted from the floppy drive. Very frustrating. With enough fiddling, I got it to work, but don't really know what specific step finally made it work.

An alternative to a 2.5" flash disk drive is a Compact Flash to IDE converter. I got this to work with a Sandisk 128MB Compact Flash card, but it also took some fiddling before it would boot.

There are rails screwed onto the original Gateway drive that you'll want to remove and install on the replacement drive. With the CF->IDE adapter, this wasn't possible, but it seemed to be fine loose inside the machine - it was so lightweight that it didn't put much stress on the connector. That said, I do feel better with the 2.5" flash disk completely screwed down.

NOTE: Before you screw down the flash drive, do the following two steps - they are easier to complete with the hard drive entirely removed, or at least not screwed down.

When you boot the machine up with a new drive, you may need to re-run the BIOS installer to get it to be recognized.

REPLACE THE CMOS/RAM BACKUP BATTERY

A great feature of the Handbook is its instant resume, even if you remove and replace the main battery. With this, you can be working along, hit the power switch, remove the main battery, replace it, and you'll be right back where you were next time you fire it up. I haven't rebooted my machine in...well...I can't remember, but multiple months. Unfortunately, the small rechargeable battery that makes this possible has been dead on every Handbook I've seen. Also unfortunately, the battery is welded onto the motherboard, so is difficult to replace. If you're going to damage something in the machine, this is probably when you'll do it.

The battery is the little round one just above the hard drive, with a blue plastic edge around it. The best way I found to remove it was to use a small flat screwdriver to pry the welded tab off the top of the battery. This takes some real prying, but eventually it snaps, freeing the top of the battery. Try not to torque the tab too much, as it is only held on the motherboard by two small contact points, and if you break them, the machine won't work at all.

Instead of snapping the bottom connection, I used a metal cutting scissors to snip the tab off, again being careful not to torque it too much and break the connection to the motherboard.

I ordered a similar rechargeable coin cell from Digikey, part # ML2020/G1A. Note that this is not exactly the same as the original - it only has half the capacity. The data sheet also indicates that it only really produces about 2.5v for much of its life, but it seems to work fine in my Handbook for preserving RAM and CMOS settings while changing the main battery, and typically shows around 3V on a multimeter. It MAY be possible to use a standard lithium coin cell such as a CR2032, but these cells are not made to be recharged. I considered it too risky to simply use one of these, so I spent the extra few bucks to get an actual rechargeable coin cell.

My wife (who solders much better than I do) soldered long wires between the battery's solder tabs and the motherboard. After making sure all the connections were solid, and wrapping the leads and entire battery in electrical tape, it fit by the flash drive, out of the way of everything. Decide where you want the battery to finally end up, and make sure your wires are long enough.

DISCONNECT THE INTERNAL SPEAKER

Just to the right of the backup battery, on the edge of the motherboard, there is a small tan connector with two wires leading down under the motherboard to the speaker. I wanted my Handbook to be completely silent, so I disconnected this speaker. The connector is very, very difficult to disconnect, but if you twist it a bit with a jeweler's screwdriver, it eventually comes out. I haven't noticed any bad effect from disconnecting this, and I like the fact that there is NO WAY that speaker is going to beep in the middle of taking notes during a lecture.

BUILD A 4 AA NiMH BATTERY PACK

You can use the Gateway Handbook battery, but finding a good one may be difficult, and it can only be charged with an extremely non-standard power supply designed specifically for the Handbook. You won't find an adapter with the right connector at Radio Shack - I don't know of anyone that makes the connector. Gateway did make a 6-AA cell battery pack for the 286 Handbook, but batteries back then really didn't have enough oomph to make it useful on a Handbook 486. These are almost impossible to find, but I do have one. It works fine with NiMH AA cells. The problem is that most battery chargers only charge 4 cells at a time, so 6 is an inconvenient number. Plus, the 6-cell pack just steps down the voltage anyway, so you may as well start with 4 cells.

First, I tried prying the two halves of a battery pack apart with a screwdriver and an X-acto knife. Big mistake - the plastic is thick, and this would have taken a VERY long time. A rotary tool with a cutting wheel worked much better. The original cells in the pack go right up to the plastic, however, so you need to be VERY CAREFUL not to cut into the cells and spray battery innards all over. You always wear goggles when using your rotary tool, right? The cells in the pack I took apart had a green cardboard covering - so when you see green, STOP CUTTING. In addition, the cells are connected to the contacts on the top of the battery pack with a flexible orange circuit. I just snipped most of it off, including a component I believe was a heat fuse in case charging ran wild or something. Then, the positive and negative terminals of the battery pack were soldered to the matching connections at the top, and the connections super glued into the top of the pack, since they are only held in by the large cells in the original pack.

The battery holder is a Keystone 4-AA cell holder part # 192K-ND, epoxied into the bottom of the battery pack. It is very stiff to get batteries in and out of, but after you get the knack, it isn't too difficult. I used copious electrical tape to make sure that shorts would be nearly impossible. Make sure the wires are long enough to allow the pack to open and close for easy battery replacement.

I could have tried to leave the AC adapter connector in place, but decided not to mess with charging the cells in the pack - I just remove them and charge them in a separate charger. I suppose if you were using the machine all day, this would get tiresome, and you'd want an AC connection. An alternative to the AC adapter would be to wire in a USB connector (which provides 5V) and use that instead. Since I wouldn't want to mess around with the charging circuit, I'd just put in a switch to toggle between running off of the AA batteries and the USB power. Not the most elegant solution, but at least you wouldn't have to use the bulky Handbook AC adapter.

Originally, I thought I'd need to completely reseal the case and slide the batteries in through an opening, which is why there is a cutout in the upper-righthand corner. It turns out that after taping the hinge edge in the picture above with high quality black gaffer's tape, I can just open it up and change the batteries, then hold it closed as I insert it into the laptop, and it works fine. You just have to make sure that you leave enough plastic after cutting the pack open that it maintains good contact when put into the Handbook. If you cut too much plastic, the pack will be a bit shorter than originally, so you may need to add some spacers or something to keep the connection to the laptop nice and tight. Fortunately, this didn't happen when I cut this pack open, but I'd be more careful next time to leave some areas of plastic along the seam, and I obviously wouldn't make the cutout.

INSTALL COMMAND LINE LINUX

I used Slackware 9.1, but others distributions would probably work fine. The trick was getting the install files onto the flash disk. There are probably a hundred ways to do this, but for a variety of reasons, I ended up making two partitions on the drive using another machine - a 250MB ext2 partition, plus a FAT (DOS) partition. I copied all of the Slackware install components I wanted (just command line stuff, which really keeps the size down) onto the DOS partition, made the Slackware boot floppies, and did the install off the DOS partition onto the ext2 partition. I had to tell the Slackware installer to write the MBR on the disk - when I didn't do this, the machine would hang while booting.

OTHER LAPTOPS TO CONSIDER

  • Gateway Handbook 286: Funky blue screen, slightly smaller size. Non-standard hard drive as far as I can tell, and more difficult to take apart and retrofit. No PCMCIA slot. Good heavens. Go for the 486.
  • HP Omnibook 300/425/430/530: Light & well-built, and run off of 4 AA batteries without modification. From what I hear, non-standard PCMCIA slots and hardware make it difficult to get Linux going, although there are tantalizing rumors about it working.
  • Toshiba T1000SE: Big, bulky, 8086 machine that won't run Linux and has NO hard disk, but what an engineering marvel. Even older than the Handbook (late 80's), it is from the era when companies thought they would be using their computer hardware for years to come, so it needed to be built like a tank. Varmint Al [alternative specification page] calls this the "Sherman tank of laptops" and has some good information on his site, especially if you're into ham radio. I have two T1000SE machines I keep around just to admire. Excellent full-size keyboard, and a (small) backlit screen. Here's a little-known item that can help get you a cheap one on ebay. Unlike most laptops that will run on AC power even if the battery is completely dead, this one will not. If the battery pack has been sitting for years and is completely toasted from disuse, the power light will just turn red when you hook up the AC power adapter and it won't boot. This leads some people to believe that the whole laptop is bad. It might be, but one that I bought on ebay with these symptoms booted up like a champ as soon as I restored the battery with a Maha C777+ charger. Battery pack could probably be retrofitted with 6 AA NiMH cells (7.2v). Other T1xxx models are also interesting - I used a T1000 in college to write my Junior independent work paper on the beach over Spring break. But I think the T1000SE is the best of the bunch.
  • There are many others, but the 4AA battery requirement was a deal-breaker for me. There are Windows CE machines that are very nice, but require a custom battery. Same with most other older ultra-portables. Other old machines include: Lexicomp, Lexbook, Thinkpad 220, IBM pc110, Sharp pc-3000/3100, Amity 500, Quaderno, Bicom SL (386), Zeos PPC.

ADDITIONAL RESOURCES & COMMENTS

  • This page talks specifically about putting Linux on a Handbook 486, and has some technical information on the power and parallel port connectors.
  • Gateway, bless their hearts as long as they continue to survive, still keeps some technical information, BIOS updates, and utilities up on their site.
  • Digikey has many useful parts for projects like this. If they don't have it, try Jameco.
  • Thomas Distributing has good prices on AA batteries and chargers.
  • I'm trying to get all of my electronics to either run directly off of 4 AA NiMH batteries, or charge off of a USB port. A useful bridge accessory is this charger. It charges 4 AA cells, and also has a USB port that you can charge USB devices from. For example, my Motorola MPx200 Smartphone charges off of a USB cable, so on a trip, I just bring the Semsons charger and a USB cable for the phone. I can run the Handbook off of the AA cells, and charge the phone with the charger either plugged into the wall or on-the-go from charged AA batteries. Tasty.
  • There is a PS2 port on the side of the machine so you can attach an external keyboard. You can also get a PS2 -> USB adapter and charge your USB peripherals off of the PS2 port. Not very efficient, but handy in a pinch.
  • A sharp reader (thanks!) tracked down a copy of pmext.sys, which apparently sets the time correctly when coming out of suspend on the Handbook 486 machines. Since I use Linux, not DOS, I have not tried this utility.

DISCLAIMER

If you do this, you're mucking around inside a laptop that wasn't designed to be mucked around in. It is really easy to damage either the machine or yourself if you aren't careful. The Handbook is so old that there is no warranty you can void, but this also means that if you break something, Gateway won't be able to help you out - these things went out of style over a decade ago. Anyway, all of this is COMPLETELY AT YOUR OWN RISK. These instructions are provided as-is, with no warranty. They may not work for you. Most of this probably isn't a very good idea unless you have some background in computer repair. If you don't know why rubbing a balloon in your hair before doing this wouldn't be a good idea, close this document and forget you ever saw it...

REVISION HISTORY

11/01/2005 Added list of other old small computers & added pmext.sys download.
06/13/2004 Initial article

 

 


©2004 Jeff Blum, all rights reserved.