Documentation/Platforms/m68k

From QEMU

m68k emulator

The following machines are emulated through qemu-system-m68k:

Machine model selectorProvides
-M an5206 Arnewsh 5206
-M mcf5208evb MCF5208EVB (default)
-M next-cube NeXT Cube
-M none empty machine
-M q800 Macintosh Quadra 800

You can select the desired machine with the -M command line option.

Build directions

Linux or Windows hosts:

 ./configure --target-list="m68k-softmmu" --enable-gtk --enable-sdl --enable-slirp
 make

macOS host:

 ./configure --target-list="m68k-softmmu" --enable-cocoa --enable-slirp
 make

Macintoch Quadra 800

Running Linux

Download a m68k distribution, such as debian-10.0-m68k-NETINST-1.iso. Create a hard disk image to install onto.

Debian latest installer CDs are available at: https://cdimage.debian.org/cdimage/ports/

You will need a kernel and initrd to boot Linux. The easiest way to get these is to mount the iso, and copy them from the /install/cdrom and /install/kernels folders.


Please note that the instructions below use kernel versions that might have been superseded by newer ones on the most recent installation cd images! Also, during installation on hard disk image the update process might install a newer kernel. Always make sure to extract the latest kernel and initrd.gz from your hard disk image after installation or update and replace the kernel names in the examples below with what is currently installed.


The kernel and the initrd needed to boot might also be found in https://cdimage.debian.org/cdimage/ports/debian-installer/

If not, you can also extract the installation kernel and initrd from the installation CD:

 guestfish --add debian-10.0-m68k-NETINST-1.iso --ro --mount /dev/sda:/
 <fs> copy-out /install/cdrom/initrd.gz .
 <fs> copy-out /install/kernels/vmlinux-4.16.0-1-m68k .

Or, if you don't want to install guestfish you can use the loop kernel module (but you need to be root):

 sudo modprobe loop
 sudo losetup -f debian-10.0-m68k-NETINST-1.iso
 sudo mount /dev/loop0 /mnt
 cp /mnt/install/cdrom/initrd.gz .
 cp /mnt/install/kernels/vmlinux-4.16.0-1-m68k .
 sudo umount /mnt
 sudo losetup -d /dev/loop0

Boot from the CD image:

 ./qemu-system-m68k -boot d \
 -M q800 -serial none -serial mon:stdio -m 1000M \
 -net nic,model=dp83932 -net user \
 -append "console=ttyS0 vga=off" \
 -kernel vmlinux-4.16.0-1-m68k \
 -initrd initrd.gz \
 -drive file=m68k-deb10.qcow2,format=qcow2 \
 -drive file=debian-10.0-m68k-NETINST-1.iso,format=raw,media=cdrom \
 -nographic

Use the following for the source for network-based installation:

 http://ftp.ports.debian.org
 /debian-ports/

After installation, extract the kernel and initrd from the hard disk image;

 guestfish --add m68k-deb10.qcow2 --mount /dev/sda2:/
 <fs>copy-out /boot/vmlinux-4.16.0-1-m68k .
 <fs>copy-out /boot/initrd.img-4.16.0-1-m68k .

If you don't want to install guestfish, you can use the NBD kernel module (but you need to be root):

 sudo rmmod nbd
 sudo modprobe nbd max_part=7
 sudo qemu-nbd -t m68k-deb10.qcow2 -c /dev/nbd0
 sudo mount /dev/nbd0p2 /mnt
 cp /mnt/boot/vmlinux-4.16.0-1-m68k .
 cp /mnt/boot/initrd.img-4.16.0-1-m68k .
 sudo umount /mnt
 sudo qemu-nbd -d /dev/nbd0

To boot from the HD image, you can use:

 ./qemu-system-m68k -boot c \
 -M q800 -serial none -serial mon:stdio -m 1000M \
 -net nic,model=dp83932 -net user \
 -append "root=/dev/sda2 rw console=ttyS0 console=tty \
 -kernel vmlinux-4.16.0-1-m68k \
 -initrd initrd.img-4.16.0-1-m68k \
 -drive file=m68k-deb10.qcow2,format=qcow2 \
 -nographic

Running Mac OS 7.1 up to 8.1

As of 10-10-2023 you can run Mac OS 7.1 up to 8.1. To boot Mac OS, you need a Macintosh Quadra 800 rom file and an image of installation media for the Quadra 800 machine. The rom is found when placed in the pc-bios folder and is named MacROM.bin, or can be selected by using the -bios command line option.

Parameter ram (pram) can be saved and loaded from a file that is exactly 256 bytes long. You can create such a file with:

 dd if=/dev/zero of=pram.img bs=256 count=1

or

 qemu-img create -f raw pram.img 256

An empty 2Gb hard disk image can be created with:

 qemu-img create -f raw -o size=2G MacOS81.img 


Display options: There are 3 resolutions available: vga 640×480, supervga 800×600 and 1152×870. When nothing is set on the command line 640×480 and 800×600 up to 24 bit colour/greyscale are available through the monitors control panel. Once set, the setting is preserved on reboot. To use the 1152×870 resolution, add -g 1152x870x8 to the command line. This adds the Apple 21 monitor with that resolution. Due to vram limitations it only supports up to 8 bit colour depth. In this last case the other resolutions are not available.

The -display argument takes either gtk, sdl (best for Windows hosts) or cocoa (macOS hosts only) as value.

Mac OS 7.1: While later versions were distributed as CDs, Mac OS 7.1 for the Quadra 800 was not. You can find a cd image with the installation media here: https://www.emaculation.com/doku.php/m68k-qemu-on-osx#starting_qemu-system-m68k_to_install_mac_os_71

At initial boot, Mac OS searches for a bootable device from SCSI id 6 downwards. Once installation is finished, you can set the disk to boot from using the start up disk control panel. The SCSI id will be saved in the pram.

Command line to start a fresh CD-based installation of Mac OS 8.1:

 ./qemu-system-m68k \
 -M q800 \
 -m 128 \
 -bios Quadra800.rom \
 -display gtk \
 -g 800x600x8 \
 -drive file=pram.img,format=raw,if=mtd \
 -device scsi-cd,scsi-id=3,drive=cd0 \
 -drive file=8.1.iso,format=raw,media=disk,if=none,id=cd0 \
 -device scsi-hd,scsi-id=0,drive=hd0 \
 -drive file=MacOS81.img,format=raw,media=disk,if=none,id=hd0

Once booted from the CD image use the drive setup program to initialise the hard disk and install Mac OS. When the installation has completed use the Startup disk control panel to select the hard disk as startup disk. Then edit the command line to remove the installation CD and boot Mac OS.

 ./qemu-system-m68k \
 -M q800 \
 -m 128 \
 -bios Quadra800.rom \
 -display gtk \
 -g 800x600x8 \
 -drive file=pram.img,format=raw,if=mtd \
 -device scsi-hd,scsi-id=0,drive=hd0 \
 -drive file=MacOS81.img,format=raw,media=disk,if=none,id=hd0

Running A/UX 3.x

Qemu-system-m68k does not (yet) support boot from floppy, something that is required for an A/UX installation. A small hard disk image to bootstrap the installation is available at https://www.emaculation.com/doku.php/m68k-qemu-on-osx#preparing_to_install_a_ux

Command line to start the A/UX 3.0.1 installation:

 ./qemu-system-m68k \
 -M q800 \
 -m 128 \
 -bios Quadra800.rom \
 -display gtk \
 -g 800x600x8 \
 -drive file=pram.img,format=raw,if=mtd \
 -device scsi-hd,scsi-id=0,drive=fd0 \
 -drive file=AUXBootfloppy.img,media=disk,format=raw,if=none,id=fd0 \
 -device scsi-hd,scsi-id=1,drive=hd0 \
 -drive file=AUX301.img,media=disk,format=raw,if=none,id=hd0 \
 -device scsi-cd,scsi-id=3,drive=cd0 \
 -drive file=AUX301.iso,format=raw,media=cdrom,if=none,id=cd0

Running NetBSD from a Mac OS installation

You can run NetBSD from a Mac OS installation.

How to help

Review the patches that are sent to the QEMU mailing list.

Pictures

Linux Desktop Startup of Linux
Screensaver Web Browser

Links

Maintainer's personal wiki page
68k assembly language tutorial
Quadra 800 specs
Inside Macintosh volumes 1-3
Video of qemu-m68k booting Linux
Video of 24bit GNOME on qemu-system-m68k
Debian m68k port status
Debian m68k port installing tips

Maintainer contact info

Laurent Vivier <laurent@vivier.eu>