DæmonNews: News and views for the BSD community

October 1998 Get BSD New to BSD? Search BSD Submit News FAQ Contact Us Join Us
Search


Get BSD Stuff
Daemon News '199810' : '"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> "'
Monthly Columns

Going Mobile with FreeBSD

Brian Handy

I'm a research scientist with the Solar Astrophysics Group at Montana State University. The nature of our work here is highly image-intensive and mobile. We travel a great deal, and the ability to take the workstation on the road is a great boon to productivity. Most of what we do is very UNIX-centric, and I've had numerous past successes running FreeBSD on desktops, so it was natural to extend to the laptop environment.

My first experience in this began a couple of years ago with the acquisition of two IBM ThinkPad 560Cs. At the time, support for laptops in the FreeBSD source tree was scanty at best, so I wound up working pretty closely with several developers doing some pretty intense beta-testing. The fruit of this labor: mobile workstations for myself and my Thesis advisor, and pretty reasonable APM/PCMCIA support for FreeBSD.

Recently, I had the opportunity to revisit the laptop business. My thesis advisor (now merely "The Boss") had been pushing the limits of his laptop pretty hard and was ready for an upgrade. More disk space, more RAM, more speed, more pixels on the external monitor. (The TP560C is limited by 1MB video memory.) A quick search and a couple of pointed questions to some trusted individuals brought me back to the proven platform: the IBM ThinkPad 560.

Maybe a word on laptop platforms would be useful here. When I was first looking for laptops, I was given two criteria: it needed to be light, and it needed to be durable. The laptop it replaced was an old Mac Powerbook 180, which weighed in somewhere near 10 pounds. The boss hated carrying that thing around, and finally got burnt one day on a trip where he needed that laptop "Right Now", but had neglected to bring it with him. This led to my search for a new lightweight platform. Light weight narrowed the list significantly: there are many laptops available, but I was only able to come up with three models weighing in at less than 5 lbs: The IBM TP560, the HP Omnibook and the DEC HiNote Ultra. (There may be more, this is where the search stopped.)

I was able to whittle this down further. I couldn't locate a HiNote anywhere, I believe DEC had just discontinued this particular model. We played with an HP Omnibook in a computer store and just weren't satisfied with the funny mouse it comes with. We tried a ThinkPad 560, and it was love at first sight: durable, no frills, good support from IBM and at 4.1 pounds, it was going to travel well. The 560 has no internal cdrom or floppy drive, which in our application are rarely used anyway -- so it was nice to leave these items at home.

I made it through the first series of setting up dual-boot (FreeBSD and Windows 95), getting the video cards working, getting the PCMCIA ethernet and modem cards to cooperate. Laptop setup at the time wasn't terribly well-documented, and in fact still isn't. But it has simplified with time, and more PCCARDs are supported now than before. Much of the laptop support in FreeBSD comes from the PAO code via the Nate Williams filter. Currently the main source tree has most of the APM/PCCARD capability advertised by PAO. (This point is occasionally hotly debated on the freebsd-mobile list.)

At any rate, this more or less brings us to the present day, and to this brand-new TP560X sitting on my desk. The TP560X comes standard with a 12.1" TFT active-matrix screen, 32MB RAM and a 4GB hard drive. I upgraded the memory to 96MB total and replaced the hard drive with IBM's 6.4GB unit.

Thus begins my tale of woe.

The intent was to partition the HD with 2GB for Win95 (to accommodate all the bloatware that comes with using Microsoft Office, plus an assortment of grant proposals and other such Windows-centric stuff) and partition the remaining 4GB for FreeBSD. New ThinkPads come equipped with a great resource: The whole system can be restored from a CDrom and rescue floppy that comes with the unit. So, confident beyond a shadow of a doubt that this utility would work, I installed the new hard drive, formatted it with DOS FDISK and FORMAT, and prepared myself to re-install windows.

Moral 1: Never...NEVER give up your old MS-DOS floppies.

Moral 2: Never...NEVER trust any Windows rescue floppy to work.

I have a Sony PCMCIA cdrom that comes with an Adaptec SlimSCSI card. The documentation with the cdrom swears it supports every CDrom known to man -- IDE, SCSI, PCMCIA or otherwise. Except apparently the SlimSCSI. I couldn't get that part to work at all. I wasn't surprised, though, so I had a backup plan: use the Win95 Floppy Disk install set (28 floppies!) made from the *previous* TP560C's, two years ago.

My next error was to install FreeBSD before installing Win95. The lore on the internet (and in the handbook, and the FAQ) is that to dual-boot Operating systems both OS's must have their root partition located completely within the first 1024 cylinders. This was a problem, as FreeBSD was probing the drive and coming up with a number around 13,000 cylinders. No matter what size I made the root partitions nor how I broke things up, I could not dual-boot. Only the first OS on the drive was found.

The problem of course is that the BIOS in the laptop wanted to change the disk geometry. I got around this problem (after several days of punting around) by formatting the DOS partition using the DOS FORMAT program. This is mentioned in fine print in the FAQ, but might deserve more neon lights around it, at least for my sake. Once I did this, the whole 6.4GB drive suddenly appeared to have approximately 950 cylinders. My root partitions could be as big as I wanted, so I made Win95 take up the first 2GB just as I originally planned.

Now the operation began to move much more quickly. I installed FreeBSD from the 2.2.7-RELEASE cdrom, then added a whole mess of ports and made some of my personal customizations I've learned with time. Then I installed Windows from the 28 floppy-disk set over an afternoon, reinstalled "Booteasy" from the tools directory and I had a basic dual-booting laptop.

The next difficulty: getting the APM and PCCARD support working, and finding appropriate video display drivers for XFree86. The APM and PCCARD support is not too bad to implement: a PCCARD kernel configuration file is supplied in /sys/i386/conf, which I adjusted to my liking and recompiled the kernel. I also had to enable the PCCARD support in /etc/rc.conf, which is fairly straightforward as well. (I skip the details, but this may show up in a handbook entry in the near future.) The only difficulty now is: do my modem and ethernet cards show up? This information comes from /etc/pccard.conf. A large database of cards lives in /etc/pccard.conf.sample, a couple of which I submitted long ago. Of course the new modem (a 3Com/Megahertz 56K modem) didn't show up in this list, so I had to modify an existing example to do the right thing. (Again, something that will probably show up in a handbook entry some day, and also in pccard.conf(5).)

Lastly, X support, an issue that deserves its own section. This is because the curmudgeons at NeoMagic refuse to release the specs on their chipsets without an NDA. I ended up loading up the XFree86 Server Link Kit, and then getting some patches. It would seem one of the Linux folks hacked a [non-accelerated] driver to do the job, so I compiled it according to the instructions, put it in the appropriate place, found an XF86Config file and it worked on about the third try. It took several attempts with the XF86Config file to get things working right. My experience with TP560's is that the BIOS changes enough with time that old XF86Config files won't work with new BIOS. (Note that Red Hat signed an NDA with the NeoMagic folks. If you're running Linux, there are zoomy accelerated binaries available that seem to support everything under the sun. Go to http://www.ps.uci.edu/~tomba/inspiron/redhat-neomagic.txt.)

The next step: munging XF86Config to work with an external monitor. After a short, unrewarding experience with this, I picked up the phone and ordered the Laptop Server from Xi Graphics, $200US. This simplified my work fairly significantly, as Xig's menu-driven configuration routines completely run circles around xf86config. What is also nice is the automatic external monitor support. Install the external monitor and the resolution immediately changes from 800x600 to whatever the max setting is. I did some further experimentation with the configuration files with the Laptop server and managed to drive the external monitor to 1280x1024 resolution.

Bottom line: The machine is up and in the field! Its new owner uses it as his desktop machine with a port replicator, and also as his travel machine: he never leaves it behind. And, since he's always working in the same environment, there's no slowup in the work since he doesn't have to adapt to a new platform.

That's the long and short of setting up a laptop. They're a bit more complicated than desktop units thanks to the bizarre hardware and the fact they're not nearly as mainstream as desktops. In a future edition of this, we'll negotiate the pitfalls of setting up APM and the pccard daemon, and maybe revisit the topic of X support on the laptop.

Brian Handy, handy@physics.montana.edu





Author maintains all copyrights on this article.
Images and layout Copyright © 1998-2004 Dæmon News. All Rights Reserved.