NetBSD/mac68k Installation Guide

(revised for version 1.3)

by
Larry Kollar (kollar@stc.net)

Overview

This document provides a complete set of instructions needed to install NetBSD on a 68k-based Macintosh computer. Not all models are supported; see the Machine Status Page[1] for a list of currently-supported models.

Note: If you are upgrading an earlier NetBSD system to version 1.3, see the Upgrade HOWTO[2].

This document is geared toward users with a fair amount of MacOS experience, and a limited amount of Un*x experience (Unix, NetBSD, Solaris, Linux, NextStep, and many other similar systems are lumped together as "Un*x"). Beyond the initial installation, this document contains only a few references to other pages and books.

Instructions for setting up a Jaz drive for use with NetBSD can be found in the Jaz HOWTO[3].

About this document

This installation guide can be used on-line, or can be printed out. Referenced documents are linked (where available) for on-line users; a corresponding footnote lists the URL of these documents for use as a printed document.

Acknowledgements

This document largely pulls together information scattered throughout several sources, and fills in a few missing details. The two major sources are:

However, any mistakes found here are my own. Please let me know if you have any questions or improvements.

Disclaimer

Do I really need to insert all that legal mumbo-jumbo here? If you wipe out five years' worth of software and data, and forgot to make backups first....

Getting Started

About NetBSD/mac68k

Before starting the installation, keeping the following information in mind might help clarify what's going on during the installation process.

Hardware requirements

According to the NetBSD Installation Sheet[4]:
To actually do much compiling or anything more interesting than booting, at least 8MB of RAM and more disk space [than 40MB] is recommended. About 75MB will be necessary to install all of the NetBSD 1.3 binary system distribution sets (note that this does not count swap space!). An [additional] 25MB or so is needed for the binary X11 distribution sets.

A system with 16MB of RAM and 200MB of hard drive space will be adequate for anything short of recompiling the entire operating system (in this case, assign roughly 500MB of disk space). (Compiling Emacs requires a significant percentage of the world's storage media, but it too can be done.)

The following systems have additional hardware requirements:

Highly recommended reading

Read through the rest of this guide before actually beginning to install NetBSD. In addition, look at the other available documentation:

If your system does not appear in the list of supported systems, you may still be able to install a "current" (development) version of NetBSD instead of the 1.3 release version. Search the mailing list archives[5] for discussions about your system before giving up.


Installation Procedures

Work through the following procedures, in the order shown, to install NetBSD on your 68K Macintosh.

Choosing a Kernel

In the Un*x world, a kernel is the interface between the operating system and the computer hardware. The kernel contains the drivers that tell the operating system what peripherals are available and how to access them. (This is perhaps an oversimplification, but let it go for now.)

Ideally, the kernel should be able to automatically detect connected peripherals and configure itself accordingly. In reality, a "generic" kernel covers the majority of situations while other kernels are available for special (but not uncommon) situations. These situations include support for systems not in the current "supported" list.

Pre-compiled kernels are available at the main NetBSD site[7]. Select a kernel as follows:

System Kernel to use
68040-based Performa, Centris, or Quadra kern.tgz
other systems using Jaz, Zip, or certain Quantum hard drives kern_sbc.tgz
all others kern.tgz

If you have adequate hard drive space, you should consider recompiling your kernel to tailor it to your system requirements (once you have NetBSD installed and running on your Mac, of course). This results in a smaller, and often faster, kernel. See the kernel HOWTO[8] for instructions.

After you have installed MacBSD with a pre-compiled custom kernel, you may notice that commands such as ps and w terminate with an error. This happens when the kernel is out of sync with these commands. Compiling a new kernel is the easiest way to solve that problem.

Preparing the Mac

At this point, back up your hard drive. If you plan to keep MacOS and NetBSD on separate drives, this isn't strictly necessary, but it's probably a good idea -- how long has it been since your last backup?

Now that your data is safe, you're ready to start.

Tools

Download the following tools from the NetBSD site[9]:

In addition, you need a hard drive utility to partition and format the hard drive. FWB Hard Drive Toolkit (HDT), LaCie SilverLining, and several others are suitable.

If you need a freeware solution:

Sizing partitions

At the very least, you should create two partitions on the hard drive: one for file storage and the other for swap space. Practically, you can create up to five NetBSD partitions; the following is one example of how you might allocate five partitions on a 520MB hard drive:

A guideline for determining swap -- too often misstated as a rule -- is to double the RAM installed in your machine and use that figure to determine swap space. You can actually run NetBSD with no swap, but the system will lock up if you run out of RAM.

You can use more than one hard drive for NetBSD, and you can share a hard drive between NetBSD and MacOS partitions. Part of your job as a system administrator is to find an efficient allocation of disk resources.

Preparing the hard drive

To create partitions, follow the instructions that come with your drive formatting software. You can create either A/UX (use version 2.0 rather than version 3.0 partitions if you have a choice) or MacOS partitions and use current versions of mkfs to convert them to NetBSD partitions.

Tips:

Important: Several formatters, including Apple HD SC, have a bug that writes erroneous data to the partition map. This may show up when you run older versions of mkfs; you may not see the last partition. Version 1.45 of mkfs can detect and fix this problem automatically. Another way to work around this problem is to make the last partition a MacOS partition (it can be very small if you don't need more MacOS space).

Creating the NetBSD filesystems

Now that your partitions are set up, follow these steps to create the filesystems:
  1. Start the mkfs application. Mkfs polls the SCSI bus, displays the devices it finds, then presents a dialog with the devices it found.
  2. Select the appropriate hard drive and click OK. Mkfs displays a list of partitions available.
  3. If you need to change a partition type (for example, from MacOS to NetBSD), select the partition then click the CHANGE button. Select the new type and click OK. When you finish, you should have the following:
  4. Format each NetBSD partition, except for the swap partition. Follow these steps:

Downloading the binaries

Get a kernel from the NetBSD FTP site[7]. If you have a Mac II or 68030-based system with a Zip, Jaz, or Quantum hard drive, use the kern_sbc kernel; otherwise, the generic kern should work.

Get the following files from the NetBSD FTP site[7]:

Remember to specify binary mode for the file transfers.

If you have adequate hard drive space, download the other files in this directory as well -- comp.tgz, man.tgz, misc.tgz, text.tgz, and games.tgz. All these files, including the base.tgz and etc.tgz tarballs, take up about 15MB on the hard drive.

The files whose names start with x are for the X11 windowing system. These tarballs require about 9MB more.

Note: These files are called "tarballs" in the NetBSD community, because they are gzip'ed tar (archive) files.

How NetBSD names partitions

NetBSD uses the following scheme to assign device names to each disk partition.

For example, if the hard drive at SCSI ID 0 is dedicated to MacOS, and you have a hard drive (or Zip/Jaz/other removeable) at ID 5 for NetBSD, the NetBSD drive might be assigned the following device names:

SCSI devices are named as follows:

Installing the system

Follow these steps to install the tarballs on your NetBSD filesystems:
  1. Place the Installer application and the tarballs in the same folder.
  2. Start the Installer application. The Installer scans the SCSI bus and presents you with a list of available devices.
  3. Select the appropriate hard drive -- the one with your NetBSD filesystems on it -- and click OK. Installer mounts the "root" partition.
  4. Select "Build Devices" from the File menu. This creates the standard list of devices in the /dev directory.
  5. Select "Mini Shell" from the File menu. A > prompt appears in the Installer window.
  6. Type disklabel at the prompt and press Return. This shows you the device names that NetBSD has assigned to your partitions. Note the names of your root partition and any usr partitions; you will need these.
  7. Create empty directories for use as mount points. For example, create the /usr directory with the command:
         mkdir /usr
  8. Mount user partitions at the appropriate mount points. For example, if your NetBSD drive is the second drive in the SCSI chain, mount the first user partition with the command:
         mount /dev/sd1g /usr
    Note: The root partition is already mounted at /. Do not mount the swap partition.
  9. When you have all partitions mounted correctly, create the filesystem table /etc/fstab with the following command:
         fstab force
    This creates a table that NetBSD uses to automatically mount all your partitions when you boot the system.
  10. Type quit to exit the mini-shell.
  11. Select "Install" from the File menu. The Installer presents you with the list of available tarballs. Select at least the kernel (typically GENERIC), base, and etc files -- you can install the rest later (for example, if you have to make room on your MacOS drive for them). If you have all the tarballs handy, go ahead and install them all. This will take some time, and you will see occasional "file exists" messages when the Installer tries to create a directory that already exists. You can ignore these messages.
  12. When the installation is complete, quit the Installer.

If you have problems

If you are installing NetBSD on a IIvx, make sure you have the latest version of the Installer (1.1g or newer). Earlier versions of the Installer have a bug that causes problems with the IIvx.

Once again, make sure you downloaded the tarballs in binary mode. Everybody makes this mistake at least once.

Most problems with the Installer can be fixed by increasing its "Preferred Memory" size in its Get Info dialog. Version 1.1 has a default of 3000KB; try increasing this to 6000KB if possible.

If you continue to have problems, copy down any error messages and email a cry for help to the port-mac68k mailing list[11].

The Moment of Truth

Before you actually try booting NetBSD, check the following items:

You are now ready to boot NetBSD. Quit any open MacOS applications (or at least save any work) before proceeding. The booting process shuts down MacOS.

Configuring the Booter

Start the Booter application. The Booter displays a dialog box that allows you to customize the NetBSD startup.
  1. Select Booting... from the Options menu and configure the system as follows:
  2. Now select Startup... from the Options menu and configure this dialog as follows:
  3. Select Monitors... from the Options menu and verify that the Change Monitor Depth and B&W settings are enabled. This sets the Mac to black & white before booting, the safest and fastest setting. You can change this later if you wish.
  4. If your Mac requires a serial console, or you want to use one, select Serial Ports... from the Options menu and configure the serial ports as necessary for your setup. If your printer port is used for a LocalTalk connection, you should check the LocalTalk connected to Printer Port box as well.
  5. Select Save Options from the File menu, then quit the Booter. This step is necessary for the Booter to save your configuration.
  6. Start the Booter again, select Booting... from the Options menu, and check the Single User box. (This is not strictly necessary, but is helpful if fsck needs to clean up your partitions the first time you boot.)
  7. Click OK to close the dialog box, then select Boot Now from the Options menu. The Booter window displays a few messages, then the entire screen clears; the top line should say "Preserving xxxx bytes..." where xxxx is some number. If you see this and other messages, you are now running NetBSD.
If your system hangs, or the console displays "kernel panic," make sure you have done the steps at the beginning of this section.

Eventually, if you booted in single-user mode, you should see a # prompt; this indicates that NetBSD is ready to take commands. (If you did not boot single-user, you should see a login prompt -- type root to log in.) If you saw any messages like filesystem corrupt, run fsck, you should run fsck on the indicated partitions. For example, type

     fsck /dev/sd1g

to clean up the user partition. The system will ask you whether you want to fix each error it finds; answer y each time.

After all the partitions are in proper order, press [Ctrl]-D to exit single-user mode. NetBSD automatically mounts your partitions in their proper places, then presents you with a login prompt. Log in as root the first time.

The rc.conf error

The first time you boot NetBSD 1.3, the console displays an error "rc.conf not configured" and stays in single user mode. This was done to prevent unconfigured (and insecure) systems from becoming available on a network.

To fix this, edit the /etc/rc.conf file and configure the network parameters as needed. Then, change the line reading rc_configured=NO to rc_configured=YES. If you are familiar with what other parameters need to be changed, make those changes as well. Save the file and type reboot at the prompt.

Now what?

Now that you (we hope!) have a working NetBSD system, you need to create your normal login account, set up files in /etc, and generally have a good time playing system administrator. Rob Windsor's Life After Installing NetBSD[13] page covers most of these topics (although it may be slightly outdated). The FAQ pages[14] cover other basic information. Happy Un*x'ing!



[1] http://www.macbsd.com/macbsd/macbsd-docs/machine-status/
[2] http://www2.giganet.net/~mark/NetBSD/howtos/upgrade-howto.html
[3] jaz.html
[4] ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.3/mac68k/INSTALL
[5] http://routbort.neuro.duke.edu/netbsd/
[6] http://www.macbsd.com/macbsd/macbsd-docs/index.html
[7] ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.3/mac68k/binary/sets/
[8] http://www.macbsd.com/macbsd/howto/kernel.html
[9] ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.3/mac68k/installation/misc/
[10] http://www.euronet.nl/users/ernstoud/patch.html
[11] mailto:port-mac68k@NetBSD.org
[12] ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.3/mac68k/installation/misc/mode32-7.5.hqx
[13] http://www.warped.com/~windsor/netbsd/what-next.html
[14] http://www.macbsd.com/macbsd/macbsd-docs/faq/
Larry Kollar
Jan. 5, 1998