MacPenguin
  ::documentation::FAQ  
 
 

The Linux/m68k for Macintosh FAQ

Table of Contents

0.Forward
I.This FAQ
II.The Project
IV.Hardware Requirements
V.Specific Hardware Issues
VI.Testing and Playing
VII.Installing
VIII.The Kernel
IX.Compiling the Kernel Yourself
X.Linux Utilities that Might Help
XI.Mac Utilities that Might Help
XII.FTP Site Information
XIII.Contributing to the Project
XIV.Compatibility

Section 0: Forward

This FAQ and the Linux/m68k for Macintosh project could not exist without the generous help and support of a large number of people. There's still a lot of work to be done however, and help is appreciated now as much as ever. There is information below about how to join in the effort. Our thanks go to all of the programmers who have put their time into making everything happen, both past and present. Thanks also to everyone who actually tested the patches and things that those programmers put out, everyone who offered web space, the people that generously gave their resources or funded domain name registration, the "original" (and defunct) MacLinux team that started it all, the Mac BSD team for letting us use their booter for a while, and anyone that I might be forgetting. You all have my thanks for giving me something to do. :)

Section I: This FAQ

1. Is there a FAQ?

Yes, there's a FAQ and you're looking at it. This FAQ is based primarily on the FAQ written by Mike Comb. Additionally, it contains material from an alternate FAQ written by Alan Cox. Currently, it is maintained by the Linux/m68k for Macintosh development team using the same CVS repository as the web site.

2. Is this FAQ "official?"

About as official as anything is around here.

3. I have a comment/complaint/suggestion about the FAQ. Who should I tell?

Tell the mailing list. Everyone who has the power to add things to the FAQ should be subscribed to it.

4. Where can I download a recent version of this document and where can I look for updates?

The FAQ lives at http://www.mac.linux-m68k.org/docs/faq.php.

Section II: The Project.

1. Is there a FAQ?

Do you like repeat questions?

2. Is there a mailing list?

The original mailing list (linux-mac68k@mac.linux-m68k.org) is defunct.

There are two other lists, however: the debian-68k mailing list and the linux-m68k kernel mailing list. Neither of these lists is Mac-specific: they are read by users and developers of all of the 68k Linux sub-architectures (Amiga, Atari, etc).

3. Is there a mailing list archive?

The old Mac68k list is archived here and here. See the links given above for archives of the other two mailing lists.

4. Is there a FTP site?

No, it is defunct. The content has been moved to this web site. New downloads are now made available from the SourceForge file release page.

5. What resources are available over the web?

Quite a few, natch. The "official" web site is at http://www.mac.linux-m68k.org/. See the Resources page for more information.

6. What kinds of people are you looking at for the project right now?

Really, we're looking for anyone. :) In particular, people with in-depth knowledge of Mac hardware would be nice, and actually being proficient at C would also be very nice. Linux kernel experience would also be wonderful, but not necessary. There's also a demand for people testing and trying out new things on their machines; sometimes this is the only way that the developers can know if things work or not. :)

7. Are there any newsgroups or chat rooms?

We don't have any specific newsgroup, but the 68k Macintosh port seems to get a disproportionate amount of "airtime" on comp.os.linux.m68k, and many of the developers read that newsgroup regularly.

An IRC channel on OFTC has been created for development and support of Linux/m68k for Macintosh. The channel name is #linux-mac68k. See the OFTC webpages for more information on the network, the rules, and a list of servers near you.

8. What are the goals of the project?

The primary purpose of our efforts is to get Linux running on as many 68k based Macs as possible and to support as much of their hardware as possible. Both of these are formidable goals in and of themselves. In addition, we intend to achieve this without using any of Apple's ROMs that shipped with each Mac and were required for MacOS. (Executing code in ROM is slow, and some ROMs have bugs.)

Section IV: Hardware Requirements

1. What machines will never be supported?

We do not support the 68000-based hardware. We support 68020-based machines if they are fitted with a PMMU (see the relevant section below). Also some machines are fitted with a defective 68LC040 chip and cannot support FPU emulation (please read the section below). For other unsupported machines, see the PowerMac section.

2. What machines are supported?

Any Macs with a 68030 or 68040 will work, even better if they have a FPU. Also, 68020's with a PMMU will work. Other expansion boards and whatnot should work, but expect a fight.

3. What machines boot *now*?

Almost all better-than-68000 Macs should work in some form or another. Keep in mind, however, that not all hardware devices will be supported on all machines. For more information, see the machine status page.

4. What about a Floating Point Unit (FPU)?

A lot of Linux code contains FP instructions, and the kernel offers FPU emulation for those machines that lack a real FPU. Machines using the 68LC040 CPU all lack an FPU. FPUs shipped with all of the Mac II series, except for the IIsi and IIvi.

Thanks to the low-level wizardry of Roman Zippel, we have a floating-point emulator that should be functional on all 68030 machines in the latest 2.2 and 2.6 kernels.

5. What about the 680LC40's?

Certain revisions of the 68LC040 chip suffer from a flaw that prevents the kernel from emulating FPU operations correctly. You can find out whether or not your Mac's CPU is affected by booting a special test kernel. You can download this from the SourceForge project.

According to Motorola's errata, any chip with a mask set 2E71M or later is OK. Chips with mask set 2E23G (as used in the LC 475) have been confirmed to be buggy. This makes on-the-fly FPU emulation impossible.

However, running Linux with neither FPU nor FPU emulation is still possible. It requires recompiling all of your executables with gcc's ‑msoft‑float option (to eliminate floating point instructions). It is also necessary to reconfigure the kernel so as to omit saving FPU register state during context switches.

At one point, it was possible to get a replacement 68LC040 device from Apple and/or Motorola, but that was quite a long time ago. Given Apple's present state of complete disassociation from the 68k Macs, the best solution is to replace a buggy 68LC040 with a 68040.

6. What about the Power Macs?

Power Macintoshes (by definition) use PowerPC CPUs, not 680x0 CPUs, and therefore they are not supported by Linux/m68k. There are several ports available however. Initially there was Apple's microkernel mkLinux port (no longer maintained). Then there's mainline Linux support in the form of Linux/PPC aka PenguinPPC. This port only supports PCI-based PowerMacs. There is a seperate port available for NuBus PowerMacs.

7. Any machines in particular that we might have problems with?

There is a huge variety of hardware devices across the range of supported models. Many models contain unique hardware and they tend to have their idiosyncrasies. We constantly have to rethink our drivers and interfaces to maintain the kind of device abstraction that makes Linux so portable. For more information on the status of each model, see the machine status page.

8. What about MODE32?

As Mode32 merely fixes a ROM problem, it is not required for the general operation of Linux on the Macintosh, but being that Penguin is a MacOS application, it may be useful in some cases. See below.

9. What about a PMMU?

In order to get Linux to run on your older 68020 based Macintoshes, you will need to get a 68851 PMMU chip to enable the paged memory that Linux (and A/UX) requires. Of the two 68020 machines, only the Mac II supports the addition of a PMMU. The Mac LC, however does not have this capability so it is not supported.

Also, you should be aware that the 68851 steals an extra clock cycle for every instruction executed in order to do address translation, thus making an already pitifully slow machine by today's standards even slower.

10. Where can I buy a PMMU?

Since no 68020 Macs shipped with a 68851 PMMU, you'll need to buy one and install it yourself. Adam recommends Data Memory Systems (www.datamem.com) and he says that you can get it for $29 + shipping. Of course, $29 will probably buy you an '030 Mac somewhere. :)

11. How much RAM?

The Linux/m68k port requires about the same amount of RAM as the other Linux ports: about 4 megs at the minimum. Even if Linux supports less, the recent versions of the Penguin booter do not. 4 MB is no longer enough to load a 2.2 kernel and a RAM disk. Even 5 MB is stretching it. System 7.0.1 uses less memory than the later releases; if you have a low memory machine, you might try running it. Also, Emile requires less RAM than MacOS + Penguin. If you intend to run Debian 3.0, you are looking at a more usable minimum of 32 MB.

Section V: Specific Hardware Issues

1. What input devices are supported?

Amazingly enough, we have keyboards (and mice)!

Some third-party 3 button mice are also supported. I have a Logitech MouseMan that works perfectly on the console and in X. With 2.6 kernels, use /dev/input/mice and "imps2" protocol. For older kernels, ADB mice are accessed in "cooked" mode through /dev/adbmouse using the "busmouse" protocol for gpm and X.

2. What about serial support?

Serial support is working and in the 2.2 kernel. Until recently the Quadra 900 and 950 and the Mac IIfx required that you set the serial ports to "compatible" mode in MacOS before booting. However, we've recently learned how to do this from Linux, so with the very latest kernels, this won't be necessary.

Note that serial ports speeds greater than 38400 bps are not reliable in Linux. (This limitation applies to MacOS as well, except on some high-end models.)

As a side note, obviously the Mac serial plugs won't fit into your PC's serial ports and there are some other technical incompatibilities. Fear not! You can buy an adapter for $10 or so from a catalog or a larger computer store. You can also construct a workable null-modem cable in order to use your PC for a serial console by plugging together a PC null-modem cable and a Macintosh modem cable. With the correct cable, the Mac's RS422 serial port can be made electrically compatible with a PC's RS232 serial port.

3. Output?

Yes, we have framebuffers! The Macintosh framebuffer driver was recently rewritten for Linux 2.2, and now will give at least a workable text console on all models with internal video, as well as the most common NuBus video adaptors. This does not, however, imply that the colormaps will be even vaguely correct. Read on...

The video driver has trouble changing the color map on some models. If your Mac has this problem, and you're handy with ResEdit, you can now (since Penguin-16 at least) tweak the Penguin colormap in order to get something resembling decent color in X. (FIXME: There's a web page about this somewhere, but I've lost the URL...) However, if you fix the colors in X, the console will lose.

Only with the Valkyrie chipset (used on the 580 and 630 series) does the driver support changing the video mode and colour depth on the fly (using fbset, or the X server). To enable it under older kernels, add "video=valkyriefb:" (the colon is important) to the kernel command line in Penguin, and enjoy!

Finally, the Linux 2.2 fbcon subsystem supports 16 and 24-bit truecolor modes on the text console, and the XFree68_FBDev X server also supports them. Therefore, even on machines such as the AV series Quadras where we don't support colormap setting, you can switch to one of these modes in MacOS before booting (Penguin-16 will still complain about this - click "Skip" to continue anyway), and have plenty of pretty colours.

If you're handy with MacsBug, you can also help us add support for colormap changing to the framebuffer...

4. Ethernet?

Several ethernet cards based on the National Semiconductor 8390 chip (also used in many ISA ethernet cards, the NE2000 being the most well known example) are working. These include Apple cards and several clones including Daynaport, Asante, and Farallon. Not all clones are known to work "as-advertised" and adding a new driver to this list may be easy, but might also involve some clone specific bugs that will make problems rather difficult to track down. Also, the Asante MacCon CS card for the "comm-slot" on the 575, 580, and 630 models is supported, and the driver will probably be adaptable to support other cards based on the SMC91C94 and SMC91C92 chipsets.

On-board SONIC ethernet, found on most of the Quadras, is also supported, as are SONIC-based comm-slot cards. However, we haven't yet devised a reasonable scheme for autoprobing for the existence of the SONIC. On-board MACE ethernet, found on the 660AV and 840AV, also works in the 2.2.18 and later kernels.

LC PDS cards based on the 8390 chipset generally work, as does Apple's SONIC-based LC ethernet card.

5. SCSI?

As of right now, SCSI is working on nearly all machines and you can mount and play with your Mac harddrives from within Linux. If you want to set up an ext2 partition, you'll need to use the installer. (See below.)

6. Sound?

I think that there are far better things to worry about than sound support. :) The sound chip isn't well documented and might be a pain to implement correctly. (Is there already a working driver for this?) Some (older) kernels will make a LOUD noise for debugging when you start them. Do not interpret this noise as working sound... consider it more along the lines of a debugging message that hurts.

7. Floppy drives?

There are two main kinds of floppy controllers on the Macintosh models that we're working with: the IWM and the SWIM. A driver for most models was contributed by Laurent Vivier and merged into the linux-2_2 CVS branch.

8. Other devices?

It depends on the device. If you want something bad enough, you could always write a driver for it. :) In general, if it is already supported by a particular Linux port, you won't have as much trouble getting it working as you would developing a driver from scratch. The Valkyrie framebuffer, SMC9194 Ethernet, and CUDA ADB drivers are examples of this, and reading them might be instructive in the sort of things you have to deal with when porting to 68k Macintosh.

Section VI: Testing and Playing.

1. Can I use Linux without damaging my important data?

Yes. There's a simple process you can use to get a "booting" Linux running (or not running, as the case may be) on your system without sacrificing any of your data.

First, download Penguin, initrd and a kernel. Follow the instructions on booting, given below in the section on Installing, EXCEPT select the ramdisk that you want to use in the configuration section and put 'root=/dev/ram' in the command line. If it comes up to a login prompt, great. At this point, you have a very minimal setup that isn't any good for anything more than testing.

2. Can I boot linux from an EXTERNAL harddisk that I want to make only for Linux?

Yes.

3. How can I be sure Linux will work on my Mac?

Try it and see. Look two questions up. Can never hurt to try.

4. How can I boot into Linux?

Booting into Linux is easy, all you need is a recent copy of Penguin (the booter) and a kernel. (Both of which can be found on this site under "Downloads".) Start up Penguin, select the kernel that you want to boot from in the configuration screen, and then give the boot command from the File menu. For more information, see the Penguin page

5. Why won't Linux boot on my machine?

You looked at the status web page and your machine was supported. But it just won't boot! Why not? Well, there are a few common problems that cause most of these failures. The most common one is that you're trying to use an ancient kernel that doesn't properly support your hardware. You should always be using the latest kernel, unless you have a really good reason not to.

Other common problems are less obvious. If you have a Mac IIci or IIsi, you must boot with either Penguin 19 or Penguin 17, and you must be running system 7.5 or higher. This is due to a bug in the MacOS video driver, as well as a bug in Penguin that has not yet been found.

RAMDoubler, Pseud040 and SoftwareFPU extensions reportedly cause problems. You can disable them using Extensions Manager control panel or else boot with extensions turned off.

If you have any non-standard hardware (video boards, ethernet cards, accelerator cards, etc), remove them one by one and try again. Some ethernet cards refuse to work unless the network is physically unplugged before booting. Also, try booting with extensions off. This removes any software conflicts and disables certain drivers.

If you have a Mac II, IIx, IIcx, or SE/30, you will need Mode32 to make 32-bit addressing work properly.

If all else fails, search the mailing list archives or ask for help from the list.

Section VII: Installing.

1. Do I need to repartition my harddisk?

Maybe. If you have only one drive, then yes. Otherwise, if you have an external drive, maybe not. In either case, you *need* at least one partition devoted to Linux someplace. (Two if you need swap.) If you have Ethernet and want to boot your machine NFS-as-root, you won't need to repartition, but you will need to install things elsewhere.

2. How do I repartition my harddisk?

Warning! If you don't know that you are destroying any data on your disk by doing this, maybe you shouldn't be doing this. :)

First, backup anything important and make sure you have a bootable emergency disk and your original install floppies or CDROM.

Second, put a copy of "Apple HD Setup" on your emergency disk if it isn't there already. Reboot the machine using this disk. Go into the Setup tool and click "Partition". Delete your main Mac partition, and create 3 more in its place. I recommend a large "A/UX Misc." root partition and a swap partition of size about double the RAM size. Oh, and don't forget to have enough room for a Mac partition. (About 10 meg will be the minimum.)

Third, reboot again with the install disks and reinstall MacOS on the Mac partition. Unbackup your data, if you saved any.

You're done.

3. Are there any other tools I can use to repartition?

You can use the MkLinux/Darwin pdisk utility, which is available for MacOS and Linux (Linux renames it to mac-fdisk). It isn't exactly user-friendly (though no more difficult than the BSD fdisk or disklabel utilities). GNU parted is also able to edit Apple partition maps under Linux.

4. How do I install to an external harddisk?

Same as for an internal disk (if you have both, one will be called sda and the other sdb).

5. Are there any distributions that'll make this easier?

Yes. Debian comes on CD for several architectures, including m68k. The m68k CDs are written in "Hybrid" format and includes everything you need to install Debian on your 68k Macintosh.

There are installation guides available for older Debian releases. The latest Debian Linux install guide is here.

6. What if I repartitioned my disk but don't have Mac system disks?

Apple has released System 7.5.x to the public. You can find it at Apple's mirror.

7. How are the Mac partition tables usually laid out?

It depends on the partition tool that created it. The partition tables usually contain 3 or more entries. The first partition is where the partition table is stored (weird, huh?) The second is a "driver" partition. The third (and often last) partition is the HFS partition where your files are stored.

8. Will I still need MacOS once I have Linux?

MacOS is needed to run the Penguin bootloader. But there is a bootloader available that does away with MacOS completely — Emile.

For the time being, such installations are not well documented, so typically MacOS is booted first and then Penguin is run from MacOS to boot Linux. Because of this, kernels and ramdisks are kept on the MacOS side (on an HFS partition).

9. How do I modify a RAM disk image?

The command line to mount the image is 'mount -o loop -t ext2 filesys mnt' where ext2 is the filesystem of the ramdisk (might also be minix), filesys is the image (ungzipped) and mnt is a directory for a mount point. This requires the loopback block device driver.

10. How do I run X?

(Note: the following applies to older XFree86 installations and not to current Xorg releases). First, make sure that you have the proper X packages installed, including the XF68_FBDev server. You don't run xf86config to configure X. Instead, do: cp /usr/doc/xserver-common/examples/XF86Config.eg /etc/X11/XF86Config to create the proper config file. Now, just use startx to run X.

Section VIII: The Kernel.

1. What kernel(s) should I try?

The 2.6 kernel is required by Debian 4.0 and later.

If the hardware status page says that your devices aren't supported by Linux 2.6, then you may have to use a 2.2 kernel.

The 2.0 and 2.1, and 2.4 kernels are pretty much defunct. Don't use them.

2. Where are the kernels?

You can get daily builds of the 2.6 kernel used by the Debian project here. The official download page for kernels is the SourceForge file release page. The Debian site has a 2.2.25 kernel.

Section IX: Compiling the Kernel Yourself

1. Why would I want to compile the kernel myself?

If you just want to test the builds that others have made, you won't need to compile anything. If you want to change the kernel configuration (e.g. to enable drivers, add functionality or modularise or disable drivers to save RAM) you need to be able to build your own kernels. Likewise for testing new code and patches.

2. What do I need to recompile the kernel?

First, you need a suitable toolchain. Generally that means a cross-compiler, or a native compiler running on a fast ARAnyM virtual machine.

To build the latest 2.6 kernel requires gcc-3.3 or later. To build the 2.2 kernel you'll want gcc-2.95.

On Debian Linux, there are various methods to obtain cross-compilers, which are not documented here. Some cross-compilers are provided on this site, see the cross-development page.

If you're cross-compiling, you can edit the top-level Makefile (unless you used CVS to obtain your kernel source, where this is already done for you) such that the ARCH variable is set to m68k, and the CROSS_COMPILE variable is set to the executable prefix used by your toolchain (i.e. m68k-linux-, m68k-linux-gnu- or m68k-unknown-linux-gnu-). The rest of the process is much the same as any other Linux kernel build.

3. How can I put together the source?

The latest source is available from kernel.org. There is no longer a CVS repository for Linux/m68k, but it is expected to be replaced by git eventually.

4. How do I get the source from CVS?

Kernel.org hosts the version 2.6 kernel sources. If you would like the sources for the 2.2 or 2.4 kernels, they are hosted on SourceForge. Use these commands to check out the 2.2 kernel sources:

  • export CVSROOT=:pserver:anonymous@linux-mac68k.cvs.sourceforge.net:/cvsroot/linux-mac68k
  • cvs login (The password is blank. Just hit enter.)
  • cvs co -r linux-2_2 linux-mac68k
  • cd linux-mac68k
  • cp config-standard-2.2 .config
  • make oldconfig

If you want the unstable 2.4 branch instead, omit the "-r linux-2_2" in the "cvs co" command.

Section X: Linux Utilities that Might Help

1. What utilities exist for Linux that might be of use?

This section was completely obsolete, and has been removed.

Section XI: Utilities for Macs that Might Help

1. What utilities exist for the Macintosh that might help?

  • MacOS 7.0.1

    System 7 (required by Penguin) is available for free from Apple. System 7.5.2 is known to fix some problems with disabling the video interrupts on the Mac IIsi and IIci that may prevent Linux from running correctly. However, 7.5.2 is very buggy, so if you actually plan to use MacOS, you will obviously want to upgrade to 7.5.5. Furthermore, System 7.5 is horribly slow on 68030-based Macs, and none of them require it to boot (unlike most 68040-based Macs), so unless you really need it you are better off with 7.0.1 or 7.1.

  • Mode32

    This fix for "dirty" ROMS in several machines. (see the section on it, above) I don't know if Penguin needs it, but it has been known to spell the difference between booting and not in cases.

  • Stuffit Expander

    This is mostly useful for reading Apple documentation that has been compressed using the proprietary StuffIt format. If you want to compress and decompress files with gzip instead, you can get MacGzip, which is Free Software, from any decent Mac archive site.

  • Apple HD SC setup

    This program will let you partition your Mac harddisk so that you can install Linux on it. By default, it only works on SCSI drives with Apple firmware, because Apple wants to protect you from yourself. It can very easily be binary-patched (by changing a single byte in a resource) to allow it to recognize and initialize other models of SCSI drives. Instructions on how to do this (along with a BinHex archive of a program which will perform the patching for you) can be found at http://www.euronet.nl/users/ernstoud/patch.html

  • MacLinux installer

    This utility copies files to an ext2 partition on a Mac. Maintained by Christiaan Welvaart. It is no longer very useful now that the Debian installer generally works on all Macs. However, you may still find it handy if you want to use something more "lightweight" than Debian.

  • ext2 Utilities

    This set of utilities lets you format and test ext2 partitions on a Mac disk. Also maintained by the same person as the installer.

  • MacsBug

    This utility will help you to debug those pesky Mac apps and (if you are really good), figure out a ton of Mac hardware information.

  • SUntar

    This utility can be thought of as a kind of dd for MacOS. Use it to read and write disk partitions and raw floppy or filesystem images. It can be used to create a rescue floppy disk, for example.

  • pdisk

    This is a MacOS port of the MkLinux/Darwin command-line disk partitioner, courtesy of the NetBSD project.

Section XII: FTP Site Information

1. Can I upload to the FTP site (ftp.mac.linux-m68k.org)?

No, sorry. The FTP site is no longer used for new releases.

2. How is the FTP site arranged?

Most of what was on the old FTP site is in /pub/linux-mac68k. You should use HTTP instead of FTP to access it.

3. Can I mirror the FTP site?

Yes, if you like. Please be sure to use an intelligent mirroring program that will not download anything that hasn't changed.

Section XIII: Contributing to the project

Join the mailing list (see section II-2).

Section XIV: Compatibility

1. Will Linux/m68k for Macintosh be binary compatible with the other m68k Linux projects?

It already is, aside from various programs that depend on Amiga- or Atari-specific hardware. In general, the operating system kernel presents a uniform interface to userland so it doesn't have to worry about the details of the hardware.

2. Will Linux/mac68k be source compatible with other Linux ports?

The short answer is yes, for the same reasons listed above. The long answer is yes, but there are certain differences between processor architecures that can't be reasonably abstracted away by the kernel. The major things to watch for are alignment issues (m68k is slightly stricter about having things be word-aligned than i386), endianness issues (m68k is big-endian unlike x86), and for kernel drivers, the total absence of all sorts of low-level i386 brain-damage (having a tiny port I/O space and separate instructions for accessing it sticks out as the big one). Also, a lot of software authors seem to be under the mistaken impression that Linux is for i386 only, and make stupid assumptions about things as simple as the strings returned by uname(1) in Makefiles and the like.

3. Will Linux/mac68k be able to run MacOS or A/UX binaries?

Not at present. It should be possible to make a Mac-in-a-Mac using some features of the 68030 and later processors that could boot MacOS on a virtual 68020 (since the 68k architecture is virtualizable, unlike i386). Honestly, it's more important to get as many systems as we can running Linux right now than to get them running MacOS. If you want the MacOS that bad, what are you doing here? :)

A/UX is uncertain. We haven't looked into it enough to make any judgments. Part of the reason for this is that A/UX is very hard to find. Personally, I (dhd) am much, much more interested in the possibility of being able to run 68k HP/UX and SunOS binaries like NetBSD and OpenBSD can.

In general, if you want binary emulation that actually works, NetBSD is your best option on any architecture.

 
 
Valid HTML 4.01 Transitional Valid CSS! Copyright © 2000-2008 Linux/m68k for Macintosh Project.