oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

How I BSDed My iBook

by Chris Coleman

My iBook arrived a few days ago. It's last year's model -- Tangerine in color and clamshell in design. I really like the clamshell and especially like the handle. It sports a 300-MHz Processor and 64 Mbytes of RAM (that I quickly upgraded to 192 Mbytes).

The RAM upgrade cost me $43 for a single 128-Mbyte SODIMM RAM chip and took about 15 minutes to install, including reading the directions to make sure I didn't screw anything up.

The iBook came with Mac OS 9 installed at the factory, and the hard drive was freshly formatted. I knew I wanted to put BSD on it in some form. I have used Darwin 1.0 on an identical iBook, and it needed a separate partition to install, so I repartitioned the 6-Gbyte drive into two partitions. I reinstalled Mac OS 9 on the first partition and downloaded all the tools I needed to make it operational.

BSD install round one

When I repartitioned the drive, I chose HFS+ for the Mac OS 9 partition, and I selected Mac OS X as the partition type for the other partition in hopes that my copy of OS X would arrive soon. I had a copy of Darwin 1.2 on CD, so after my OS 9 partition was functional, I began the process of installing Darwin.

Darwin uses the standard Software Restore application to copy a disk image on to a free HFS+ partition. But the Software Restore program couldn't see the Mac OS X partition, so I couldn't install Darwin. I searched the Web, but couldn't find a utility that would read the Mac OS X partition and repartition it into an HFS+ partition. Because I was already using the Mac OS 9 partition, I didn't want to delete it.

I also had a copy of NetBSD 1.5, so I gave that a try. I fiddled with the Open Firmware and managed to get the right prompt. By studying the contents of the CD, I figured out the right incantations to make the iBook boot from the NetBSD CD. I was excited when I saw the familiar "boot screen" scroll past. It stopped at the shell prompt and asked if I wanted to install NetBSD, but the air got let out of my balloon when I pressed the keys to acknowledge. The keyboard wasn't recognized.

I searched the NetBSD web pages, and apparently the iBook isn't fully supported until NetBSD version 1.5.1. At this point, I basically gave up trying to use the second partition until I got ahold of a copy of Mac OS X

Mac OS X to the rescue, sort of ...

My wife's TiBook arrived a few days later and came with a copy of Mac OS X. She wasn't going to use it, so I immediately began the installation process. After saving all my data to a network location, I tried to install Mac OS X to the second partition I had prepared, and until this point I had been unable to load anything. I was disappointed to learn the Mac OS X installation CD wouldn't recognize the partition either. I didn't have enough disk space left to install OS X on the primary partition, as 1.1 Gbytes are required to install.

Comment on this articleCertainly Chris isn't the only one who has tried to load a version of BSD directly on to a PowerBook ...
Post your comments

I finally formatted the drive into one partition and put Mac OS X on it. During the installation, you are given a choice of which file system you want to use to install. The two choices are HFS+ and UFS, the Unix File System. Because OS X is based on BSD Unix, all the programs are case sensitive. While the HFS+ file system understands case-sensitivity, it doesn't respect it. "INBOX" and "inbox" are identical, and I accidentally lost my e-mail once thinking they were different files.

Knowing that UFS respected case-sensitivity and that many Unix programs relied on that, I chose to format the drive to UFS when I installed Mac OS X. The rest of the install seemed to take forever. I should have timed it, but the subsequent installs I did on an HFS+ file system didn't seem to take nearly as long.

One of the first things I did after setting up my desktop and connecting to the Internet was to clear out all the fluff from the dock and add a shortcut to "terminal" from the Applications/Utilities folder. This gave me access to the BSD subsystem and the tcsh shell. Instantly I was at home. I was particularly happy to find Perl installed and put it to use immediately.

When I brought my e-mail files over, all the carriage returns got translated into ^M characters and the whole file became one huge line. I wrote a quick four-line Perl script and ran the line through a filter ( $_ =~ s/\cM/\n/g). Voila! My e-mail was as good as new.

Reformat again ...

The first drawback to formatting the drive to UFS was that I couldn't run any Mac Classic applications. OS X runs Carbon, Cocoa, or Darwin-based applications natively, but when it needs to run a Classic Mac application, it actually boots up Mac OS 9.1 inside an emulator and runs the application. However, this means that you must have Mac OS 9.1 installed, which I didn't because I had formatted the drive.

And what's worse, it was formatted UFS, so Mac OS 9 couldn't see the partition for installation. At this point, I wasn't prepared to live without Mac OS 9 compatibility. I have Adobe Photoshop and Illustrator that I need to support for my wife. So, I reformatted and reinstalled Mac OS X.

I also re-installed Mac OS 9. The really nice thing is that they can co-exist on the same partition, so I was able to have the whole disk to share between Mac OS 9 and X. At this point, I could boot to OS X and reboot to OS 9, but once in OS 9, I couldn't boot back into OS X. I had to update the Start Up Disk application in OS 9 so it would recognize a bootable OS X partition.

Now I could dual-boot back and forth, but I couldn't load Classic while in OS X because it requires OS 9.1 and I only had 9.0. I searched the Apple web site and found a downloadable update, but it was 70 Mbytes in size and I was on a 28.8-Kbps modem. I did manage to get a 56K modem running and successfully downloaded overnight.

All systems go!

The installer was easy to run and within minutes I was running OS 9.1 and booting Classic within Mac OS X (with a few reboots in there somewhere). I was really impressed with the automatic software updater that ran in both OS 9 and OS X -- it made updating the system extremely easy. I am currently running Mac OS 10.0.4 and I noticed it includes ssh 2.9p1, which was the latest security release.

So far I have been able to get all the tools I need to work, with most of them native Mac OS X applications and only a few exceptions. I am still looking for a free Excel-compatible spreadsheet program. With both operating systems running successfully on my system, I am just about ready to tackle the next project, the Developer Tools.

Chris Coleman is the Open Source Editor for the O'Reilly Network and is actively involved with community projects such as and Daemon News.

Return to the Mac DevCenter.