Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

About Qemu-system-m68k, a m68k Mac emulator for Windows, macOS and Linux that can run MacOS 7.1 to 8.1, AUX 3.x and NetBSD

Moderators: Cat_7, Ronald P. Regensburg

User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Here are some builds of qemu-system-m68k for macOS from the official source.

Read our guide: https://www.emaculation.com/doku.php/m68k-qemu-on-osx

20-12-2023
Qemu-system-m68k-8.2-macOS-Intel-20-12-2023.zip
https://surfdrive.surf.nl/files/index.p ... 7/download

Cumulative fixes and enhancements:

Fixes:
-Mouse speed now correct when using modifier keys

Enhancements:
-audio support has been greatly improved.
-The capability to run Mac OS 7-8, AUX 3 and NetBSD is now integrated into one executable.
-Specifying disk and cdrom entries on the command line has been simplified.
-Virtual Memory now works.

Have fun,
Cat_7
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Here are our experimental builds:

[26-12-2023]
Qemu-m68k-8.2-macOS-qfb-26-12-2023.zip
https://surfdrive.surf.nl/files/index.p ... Y/download

Enhancements:
-This build allows Mac OS and A/UX to run in a multiple monitor setup. With -display sdl both screens are shown. With -display cocoa or -display gtk other displays need to be selected from the menu.
-Allows setting arbitrary resolutions
-Adds "thousands" to the selectable number of colours in the Monitor and Sound Control Panel
-Enables gamma correction

Due to differences in the pram file and the mac_qfb.rom rom file needed to enable the displays, you might best place this download in its own folder.
john8520
Space Cadet
Posts: 1
Joined: Fri Oct 14, 2022 2:31 pm

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by john8520 »

Is there a guide for building on macOS via homebrew?

I started with the steps from this post:
viewtopic.php?t=11358

Code: Select all

git clone -b q800.upstream https://www.gitlab.com/mcayland/qemu q800-upstream
cd q800-upstream
./configure --target-list=m68k-softmmu
make
I had to remove --enable-gtk --enable-sdl due to the following errors:

Code: Select all

../meson.build:393:2: ERROR: Problem encountered: Cocoa and SDL cannot be enabled at the same time

... and ....

../meson.build:396:2: ERROR: Problem encountered: Cocoa and GTK+ cannot be enabled at the same time
But with those removed it configures and makes successfully.

This is what I'm trying to use to run it:

Code: Select all

./qemu-system-m68k \
-M q800,fb=none \
-device nubus-qfb,width=640,height=480,depth=16 \
-display cocoa \
-bios Quadra800.rom \
-drive file=pram-macos-qfb.img,format=raw,if=mtd 
And that fails with:

Code: Select all

qemu-system-m68k: Property 'q800-machine.fb' not found
I feel like I'm missing something obvious here, but I'm not sure. I haven't built qemu-68k on macOS before, only Linux.

For what it's worth, I'm running macOS 12.6 on an M1 MBP.

Thanks!
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Hi,

You are running into multiple problems at the same time ;-) The code you compiled does not yet contain the option for gtk, sdl and cocoa displays to coexist.
To allow compiling/running qemu with multiple displays you should also install sdl and gtk development packages in brew.

to run Mac OS, qemu-system-m68k should be compiled from the q800.upstream2-vm branch at https://github.com/mcayland/qemu
./configure can contain --enable-cocoa

qemu-system-m68k with arbitrary resolutions and multi display option should be compiled from the arbitrary-resolutions branch at https://github.com/SolraBizna/qemu
./configure should contain --enable-cocoa --enable-sdl to allow actually seeing two displays at the same time.
running this qemu requires using the pram file in our download and -display sdl for multiple displays. -display cocoa should suffice for one display (as your command line seems to suggest)
The source for this version is considered experimental, so your mileage may vary ;-)

Best to keep the builds apart as the required mac_qfb.rom is only in the second source (copy it to to folder you are going to run this qemu from). And you might run into problems if don't use the pram file we provide.

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by adespoton »

Weird; I'm not even getting make to complete. Object files all compile, but then the linker fails. I'm on Sonoma with the latest XCode and I believe I've got all the required stuff from HomeBrew.

Code: Select all

> ../configure --enable-cocoa --enable-sdl --target-list=m68k-softmmu
...
> make
...
  _gtk_window_set_geometry_hints, referenced from:
      _gd_update_geometry_hints in ui_gtk.c.o
  _gtk_window_set_icon_name, referenced from:
      _gtk_display_init in ui_gtk.c.o
  _gtk_window_set_title, referenced from:
      _gd_update_caption in ui_gtk.c.o
      _gd_update_caption in ui_gtk.c.o
  _gtk_window_unfullscreen, referenced from:
      _gd_menu_full_screen in ui_gtk.c.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1
[edit] Well, I should read my output a bit more carefully...

Code: Select all

ld: warning: ignoring file '/usr/local/Cellar/gtk+3/3.24.30/lib/libgdk-3.0.dylib': found architecture 'x86_64', required architecture 'arm64'
ld: warning: ignoring file '/usr/local/Cellar/atk/2.36.0/lib/libatk-1.0.0.dylib': found architecture 'x86_64', required architecture 'arm64'
ld: warning: ignoring file '/usr/local/Cellar/sdl2_image/2.0.5/lib/libSDL2_image-2.0.0.dylib': found architecture 'x86_64', required architecture 'arm64'
ld: warning: ignoring file '/usr/local/Cellar/gtk+3/3.24.30/lib/libgtk-3.0.dylib': found architecture 'x86_64', required architecture 'arm64'
ld: warning: ignoring file '/usr/local/lib/libcurl.4.dylib': found architecture 'x86_64', required architecture 'arm64'
ld: Undefined symbols:
  _IMG_Load, referenced from:
      _sdl2_display_init in ui_sdl2.c.o
There's my problem :) For some reason, I've got stray x86_64 libs in homebrew. Time to go fix that.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

We are very close to getting the code into mainstream qemu, but for now you should also compile from:
https://github.com/mcayland/qemu/tree/q800.upstream7.4

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by adespoton »

Thanks; that's compiling properly. Then it boots up to a white screen? Not sure what's going on there; same config works fine with the builds you make here.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

New build has been posted in the first post.
Milestone: thanks to the hard work by mcayland, q800 support to run Mac OS, A/UX or NetBSD is now in the main qemu code base!

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Question (but I'll understand if you can't answer it or it's too much trouble). My AUXrunner AppleScript app uses this command:

Code: Select all

./qemu-system-m68k \
-M q800 \
-m 128 \
-bios Quadra800.rom \
-g 800x600x8 \
-display cocoa \
-nic user,model=dp83932,mac=08:00:07:12:34:56,hostfwd=tcp::2121-:21 \
-drive file=pram-aux.img,format=raw,if=mtd \
-device scsi-hd,scsi-id=0,drive=hd0 \
-drive file=root.img,media=disk,format=raw,if=none,id=hd0  \
-device scsi-hd,scsi-id=2,drive=hd1 \
-drive file=opt.img,media=disk,format=raw,if=none,id=hd1 
I tried replacing the old executable in my app with the new one that you posted today, but it wouldn't start. Your first post in the thread mentions a simplified way of specifying disk entries - does that apply to the new code? If so, is it possible that this is what I need to change? If not, then I'll keep trying to get it right...
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Oops?

The fixes and changes are (mostly) cumulative. You are already using that simplification. There should be nothing wrong with your command line.

Did you run the allow qemu to run script? Or did you only replace the executable?
The Libs folder has to be replaced as well.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Thank you for this. I ran the "allow" command, and also ran xattr -rc on all the files, just to be safe. The Applescript didn't run, so I tried running my qemu-aux-run.command in the terminal and got this result:

Code: Select all

qemu-system-m68k: -nic user,model=dp83932,mac=08:00:07:12:34:56,hostfwd=tcp::2121-:21: network backend 'user' is not compiled into this binary
I don't pretend to understand this, but my older version (also using one of your downloads) works correctly.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Ah,

You got it running? The error seems to indicate I forgot to include slirp as network option during compile time.

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by adespoton »

emendelson wrote: Wed Oct 11, 2023 3:11 pm Thank you for this. I ran the "allow" command, and also ran xattr -rc on all the files, just to be safe. The Applescript didn't run, so I tried running my qemu-aux-run.command in the terminal and got this result:

Code: Select all

qemu-system-m68k: -nic user,model=dp83932,mac=08:00:07:12:34:56,hostfwd=tcp::2121-:21: network backend 'user' is not compiled into this binary
I don't pretend to understand this, but my older version (also using one of your downloads) works correctly.
The issue appears to be "-nic user" -- slirp usermode networking wasn't enabled for this compile for some reason.

See https://wiki.qemu.org/Documentation/Net ... nic_option for details on what might work instead;

Code: Select all

qemu-system-m68k -nic model=help
should provide the allowable options.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

I just posted a new build, now enabling the user network.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Works perfectly now. Thank you!
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Cat_7, for what it's worth (not much), there's a thread here about a problem with "-display cocoa" that is fixed by using "-display sdl". I didn't have that problem with the current version, but I'm posting in case you find the information useful:

https://68kmla.org/bb/index.php?threads ... cos.45106/
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Ah, interesting. Does your package run on intel mac? I might give it a try in my VM.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Haven't tried it on an Intel Mac. Will test that out later on my 2015 model...
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

It runs in my intel Ventura VM.
I have no issue with the cocoa display, but was greeted with a system error on first boot. Subsequent boots went OK.

My build seems to shut down to the message that one can turn off the computer. Not shutting down correctly leads to a disk check on boot.

Edit: It seems it just takes a long time before the safe to shutdown message appears.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Runs under Monterey on Intel; didn't run under Big Sur. I don't have an Intel machine that runs Ventura.

I doubt it will run under Big Sur on ARM, but haven't tested.

When I tried it in Big Sur it gave an error message about the SDL library, saying it was compiled for Ventura (I think), so I was surprised that it ran under Monterey, but it did.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Cat_7 - a question. Is there any documentation that would show how to run multiple windows with this QEMU version? I would like to see if my A/UX setup could use two screens. Don't waste time on this if there isn't clear documentation already...
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

Hi,

This version will not do multiple windows. You need to use the download from the second post (or compile your own).

All documentation is in either:
-the second post in this thread,
-the readme in the download provide there,
-the repository of the developer: https://github.com/SolraBizna/mac_qfb_driver (As you can see, the code is a bit older. I understand the developer will rebase that code on Qemu 8.2 once that is released.), or
-the earlier development thread: viewtopic.php?t=11711

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by emendelson »

Thank you! Exactly what I needed - and I should have figured it out for myself.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by Cat_7 »

I was wondering how you are doing with the multi-display setup.

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu-system-m68k macOS to run Mac OS 7-8 /AUX3.x /NetBSD

Post by adespoton »

Cat_7 wrote: Tue Oct 17, 2023 9:40 pm I was wondering how you are doing with the multi-display setup.

Best,
Cat_7
One thing I noticed with multi-display is that you can easily still set it to single display in your config, which is nice. I haven't attempted three virtual displays yet; anyone know if that works?
Post Reply