Shoebill - a Macintosh II + A/UX emulator for OS X

About Mini vMac and all other 68k emulators, including SoftMac, Executor, and MESS.

Moderators: Cat_7, Ronald P. Regensburg

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

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

So I've started re-compiling Shoebill and have made a bit more sense of what makes it different from other Mac emulators. Pruten spelled it all out, but I missed or forgot about the part where he mentioned he replicated the Apple bootloader in emulation, so you don't need to load Mac OS and then the Apple A/UX bootloader, but can just point the emulator directly at the A/UX partition and boot that.

This is the reason that A/UX 0.7 and 1.1.1 look a bit odd and don't necessarily boot as expected; they're booting directly into SASH (because that's what the A/UX bootloader points at) without first initializing the toolbox and loading Mac OS. So it's possible that you won't get much more loaded because I believe prior to A/UX 2.0, A/UX depends on the toolbox already being initialized, and then it patches in the code needed to load A/UX. So anything Mac-related would depend on the pre-existing bits... pre-existing.

This means that it should theoretically be possible to boot further, but possibly not with Shoebill; MAME's Mac II emulation (which also has full floppy support) may be able to do it. But you'll need to boot into Mac OS, then run the A/UX bootloader THEN load the A/UX partition to get there.

So; going with the official source code, I've fixed up some FPU stuff and re-built the XCode project against modern macOS. Everything works great, except... there seems to be an issue with NSOpenGL, as libshoebill is drawing at half scale in the full scale window on my Retina screen. This is the same issue I have when attempting to build any of the other forks; the official x86/x86-64 build from Pruten targeting OS X 10.10 doesn't have this issue. A bunch of stuff got deprecated since he built his version, so I'm guessing that the scaling factor code has dropped right off "deprecated" into "removed" and I'll need to find time to update somehow -- likely by replacing OpenGL with Metal and using a modern window handler.

I haven't done any heavy lifting with XCode in a decade or so, so I'm learning as I go. If anyone else has more experience fixing scaling factor issues, please feel free to have a look :)

I'm also planning to create a new build that doesn't use the GUI front end and just takes command line arguments, so I can wrap it in a clickable app that will just run and boot from a config file (instead of having you boot, open Prefs, change the fully qualified paths to the files you currently want to use, apply and run). This should have the benefit of being more portable to other platforms.

[edit] I'll probably switch to basing my code off https://github.com/rofore/shoebill which is already updated for AARCH64 and VMNET. That means that (if running as root) it should be possible to run Shoebill with networking on macOS again.

[edit2] Well, the rofore branch was perfect: it's already got the SDL2 code factored in, so I was able to compile it straight off, and get an AARCH64 command line binary that takes arguments and runs a treat :) Would it be useful to others for me to package this up somewhere with a wrapper so you can easily use it? I'll be writing up my own wrapper with a simple script that runs the binary as root (to get VMNET) and feeds in the appropriate ROM and disk image. I tweaked rofore's fork to use /Library/Frameworks/SDL2. My current compile is ARM64-only and requires SDL2 to be installed at /Library/Frameworks/SDL2.
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

I hope you'll post your new version. Prompted by a post you made a few weeks ago, I found my old Shoebill-based AUXrunner, and made a few changes in the AppleScript so that it would run under Yosemite on an old Mac that I keep around for this kind of thing. I set it up to use the SLIRP-based version because the old TunTap doesn't even seem to be downloadable any longer:

https://mendelson.org/AUXrunner-0.93.zip

Login as root, with no password.

Under Ventura (Intel) or Sonoma (ARM), AUX doesn't boot, and my app gives a message that disk0 may not be bootable. I suspect that there's some permisisons problem somewhere.

Feel free to put your own build in the app and experiment. It would be nice if it worked...

EDIT: How were you able to build rofore's fork? Under Sonoma, the osx-build.sh script errored out. The required intermediate (I think) file libshoebill_core.a doesn't get created, and so I can't build the Xcode project.
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

emendelson wrote: Sat Mar 30, 2024 4:13 pm I hope you'll post your new version. Prompted by a post you made a few weeks ago, I found my old Shoebill-based AUXrunner, and made a few changes in the AppleScript so that it would run under Yosemite on an old Mac that I keep around for this kind of thing. I set it up to use the SLIRP-based version because the old TunTap doesn't even seem to be downloadable any longer:

https://mendelson.org/AUXrunner-0.93.zip

Login as root, with no password.

Under Ventura (Intel) or Sonoma (ARM), AUX doesn't boot, and my app gives a message that disk0 may not be bootable. I suspect that there's some permisisons problem somewhere.

Feel free to put your own build in the app and experiment. It would be nice if it worked...

EDIT: How were you able to build rofore's fork? Under Sonoma, the osx-build.sh script errored out. The required intermediate (I think) file libshoebill_core.a doesn't get created, and so I can't build the Xcode project.
There's one bug in all versions of shoebill -- in core/fpu.c, there's an 'a' function variable declared untyped. I put "int" in front of it and the problem went away. So "double _native_tentox(a) " becomes "double _native_tentox(int a) ".

I also needed to replace my copy of /Library/Frameworks/SDL2, and in sdl-gui/osx_build.sh I needed to add "-rpath /Library/Frameworks" before the two -framework flags.

With these fixes, it all worked -- but I'd like to add a few more things too, such as mouse capture/release, fullscreen, adding the ability to set the window title, and possibly pause/resume. And of course, I should figure out how to compile a fat binary so it'll work under x86-64 as well.
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

adespoton wrote: Sat Mar 30, 2024 7:24 pm There's one bug in all versions of shoebill -- in core/fpu.c, there's an 'a' function variable declared untyped. I put "int" in front of it and the problem went away. So "double _native_tentox(a) " becomes "double _native_tentox(int a) ".

I also needed to replace my copy of /Library/Frameworks/SDL2, and in sdl-gui/osx_build.sh I needed to add "-rpath /Library/Frameworks" before the two -framework flags.

With these fixes, it all worked -- but I'd like to add a few more things too, such as mouse capture/release, fullscreen, adding the ability to set the window title, and possibly pause/resume. And of course, I should figure out how to compile a fat binary so it'll work under x86-64 as well.
Would you consider posting your code on GitHub so the rest of us can experiment? I figured out how to make your fixes, and built successfully, but haven't figured out exactly what you mean by "replace my copy of /Library/Frameworks/SDL2" - replace it where?

It may not be possible to compile a fat binary. What I've done in similar situations is compile once on Intel and once on ARM, and use lipo to merge them into a fat binary. To make things easier, I use this lipohelper Applescript:

Code: Select all

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
property msgTitle : "LipoHelper"
property doPrompt : true -- change to false to suppress messages

on testArchitecture(arch)
	if arch is "x86_64" then
		set exeType to "Intel"
		set code to "x86_64"
	else
		set exeType to "Apple Silicon"
		set code to "arm64"
	end if
	if doPrompt is true then
		activate
		display dialog "Click OK and choose the" & space & exeType & space & "file" with title msgTitle
	end if
	set archOK to false
	repeat while archOK is false
		set getFile to choose file with prompt "Choose the" & space & exeType & space & "file"
		set getFile to quoted form of (POSIX path of getFile)
		set fileArch to do shell script "file" & space & getFile
		if fileArch contains "universal" then
			display dialog getFile & return & return & "already contains two architectures. Please try again" with title msgTitle
		else if fileArch contains code then
			set archOK to true
		else
			display dialog getFile & return & return & "does not seem to be an" & space & exeType & "-architecure file. Please try again" with title msgTitle
		end if
	end repeat
	if doPrompt is true then
		activate
		display dialog "The chosen" & space & exeType & space & "file is" & return & return & getFile with title msgTitle
	end if
	return {getFile}
end testArchitecture

on run
	set intelFilename to my testArchitecture("x86_64")
	set armFilename to my testArchitecture("arm64")
	set outExists to true
	repeat while outExists is true
		set response to display dialog "Enter a name for the universal file:" default answer ""
		set outfile to text returned of response
		try
			set fileFound to do shell script "ls" & space & "~/Desktop/" & outfile
			display dialog "The output file" & space & quoted form of outfile & space & "already exists on the desktop." & return & return & "Overwrite or choose another name?" buttons {"Overwrite", "Another name", "Exit"} default button 3 with title msgTitle
			if button returned of result is "Exit" then
				return
				error number -128
			else if button returned of result is "Overwrite" then
				set outExists to false
			end if
		on error
			set outExists to false
		end try
	end repeat
	if doPrompt is true then
		activate
		display dialog "I will write the universal file" & space & outfile & space & "to the Desktop." with title msgTitle
		
	end if
	try
		do shell script "lipo -create -arch x86_64" & space & intelFilename & space & "-arch arm64" & space & armFilename & space & "-output" & space & "~/Desktop/" & outfile
	on error err
		display dialog err
	end try
end run
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

emendelson wrote: Sun Mar 31, 2024 3:39 am
adespoton wrote: Sat Mar 30, 2024 7:24 pm There's one bug in all versions of shoebill -- in core/fpu.c, there's an 'a' function variable declared untyped. I put "int" in front of it and the problem went away. So "double _native_tentox(a) " becomes "double _native_tentox(int a) ".

I also needed to replace my copy of /Library/Frameworks/SDL2, and in sdl-gui/osx_build.sh I needed to add "-rpath /Library/Frameworks" before the two -framework flags.

With these fixes, it all worked -- but I'd like to add a few more things too, such as mouse capture/release, fullscreen, adding the ability to set the window title, and possibly pause/resume. And of course, I should figure out how to compile a fat binary so it'll work under x86-64 as well.
Would you consider posting your code on GitHub so the rest of us can experiment? I figured out how to make your fixes, and built successfully, but haven't figured out exactly what you mean by "replace my copy of /Library/Frameworks/SDL2" - replace it where?
Here; I've forked the repo and committed the changes: https://github.com/adespoton/shoebill

My copy of SDL2 was out of date and threw errors when I first attempted to compile. So I grabbed the latest dmg, dropped in a new /Libreary/Frameworks/SDL2 and everything worked.
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

adespoton wrote: Sun Mar 31, 2024 4:49 am Here; I've forked the repo and committed the changes: https://github.com/adespoton/shoebill
Thank you! I've built successfully and added the ARM-only build to my old AUXrunner, and it works. But it would be good to know how to get the network working by running as root (will experiment later).

I added the SDL2 framework to the Xcode project, but I don't know if that makes any difference - I haven't tested on a system that doesn't have SDL2 installed in /Library/Frameworks.

Also, I tried fiddling with the Xcode project to build a universal binary, but I couldn't make it work - no matter what I did to the settings, it kept creating an ARM binary. I added -configuration Release to the xcode-build command in the makefile, but that didn't seem to make much differencde either.

Again, thank you for this. I'll look forward to new developments!

EDIT: I tried launching Shoebill as root (with sudo) but the network was unreachable. I'm clearly missing something obvious...
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

emendelson wrote: Sun Mar 31, 2024 1:21 pm
adespoton wrote: Sun Mar 31, 2024 4:49 am Here; I've forked the repo and committed the changes: https://github.com/adespoton/shoebill
Thank you! I've built successfully and added the ARM-only build to my old AUXrunner, and it works. But it would be good to know how to get the network working by running as root (will experiment later).

I added the SDL2 framework to the Xcode project, but I don't know if that makes any difference - I haven't tested on a system that doesn't have SDL2 installed in /Library/Frameworks.

Also, I tried fiddling with the Xcode project to build a universal binary, but I couldn't make it work - no matter what I did to the settings, it kept creating an ARM binary. I added -configuration Release to the xcode-build command in the makefile, but that didn't seem to make much differencde either.

Again, thank you for this. I'll look forward to new developments!

EDIT: I tried launching Shoebill as root (with sudo) but the network was unreachable. I'm clearly missing something obvious...
Adding SDL2 to the project is probably a good idea; yesterday, I got a chain of security warnings that Apple couldn't scan my new SDL2 library for malware and I had to go into Security settings and override it -- which probably isn't something we want people having to do who aren't familiar with compiling projects themselves. We should probably change things so SDL2 is compiled right into the binary instead of depending on a shared framework.
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

adespoton wrote: Sun Mar 31, 2024 7:05 pm Adding SDL2 to the project is probably a good idea; yesterday, I got a chain of security warnings that Apple couldn't scan my new SDL2 library for malware and I had to go into Security settings and override it -- which probably isn't something we want people having to do who aren't familiar with compiling projects themselves. We should probably change things so SDL2 is compiled right into the binary instead of depending on a shared framework.
I tried doing exactly that, but didn't succeed. My old Shoebill-based app tested for the existence of /Library/Frameworks/SDL2.framework, and, if it wasn't found, copied it from inside the app, but that's not really a good solution.

Any hints you can give at making the network work will be gratefully received!
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

emendelson wrote: Sun Mar 31, 2024 10:02 pm
adespoton wrote: Sun Mar 31, 2024 7:05 pm Adding SDL2 to the project is probably a good idea; yesterday, I got a chain of security warnings that Apple couldn't scan my new SDL2 library for malware and I had to go into Security settings and override it -- which probably isn't something we want people having to do who aren't familiar with compiling projects themselves. We should probably change things so SDL2 is compiled right into the binary instead of depending on a shared framework.
I tried doing exactly that, but didn't succeed. My old Shoebill-based app tested for the existence of /Library/Frameworks/SDL2.framework, and, if it wasn't found, copied it from inside the app, but that's not really a good solution.

Any hints you can give at making the network work will be gratefully received!
Looks like I haven't actually got networking working either... it sets everything up, but there's no traffic.

This led me down a rabbit hole, resulting in this entertaining read: https://axleos.com/adding-vmnet-support-to-qemu/ -- the VMNet support in Shoebill comes directly from what he did for QEMU. Still reading, hopefully it will shed some light on what's missing -- I suspect it's a config flag, but I didn't find that by skimming the source changes.
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

Hmm. After that entertaining read, I still don't think it's helped. I suspect VMNet is indeed already initialized, and Neozeed's writeup at viewtopic.php?t=8483 explains more of what's actually going on -- essentially, the interfaces in A/UX aren't set up yet. As my quick check indicated before, the network stack should already be in place, it just needs A/UX to know how to use it, and that doesn't happen by default.
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

Well, this is the command parameter in QEMU (thanks to Cat_7) that starts the network in A/UX:

Code: Select all

-nic user,model=dp83932,mac=08:00:07:12:34:56,hostfwd=tcp::2121-:21 \
Does this help anything at all?
User avatar
Madd the Sane
Student Driver
Posts: 15
Joined: Fri Aug 31, 2012 6:27 pm
Location: Idaho

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by Madd the Sane »

adespoton wrote: Sat Mar 30, 2024 3:09 am …there seems to be an issue with NSOpenGL, as libshoebill is drawing at half scale in the full scale window on my Retina screen.
This is due to the fact that NSOpenGLView.wantsBestResolutionOpenGLSurface defaults to true if the app is linked against 10.15 or later. Either set NSOpenGLView.wantsBestResolutionOpenGLSurface to false, or get the correct size via -[NSView convertSizeToBacking:] to pass to glViewport().
Get out of my mind, idea! I already have an idea in there!
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

Madd the Sane wrote: Sun Mar 31, 2024 11:49 pm
adespoton wrote: Sat Mar 30, 2024 3:09 am …there seems to be an issue with NSOpenGL, as libshoebill is drawing at half scale in the full scale window on my Retina screen.
This is due to the fact that NSOpenGLView.wantsBestResolutionOpenGLSurface defaults to true if the app is linked against 10.15 or later. Either set NSOpenGLView.wantsBestResolutionOpenGLSurface to false, or get the correct size via -[NSView convertSizeToBacking:] to pass to glViewport().
Thanks! I'll tuck that away. Since I've switched to building SDL2 for macOS, I don't need that particular tip anymore for this project, but I've seen it crop up elsewhere, and that sounds like a relatively simple fix. In fact, simple enough that I'm surprised that Apple doesn't automatically flag the issue and offer a fix.....

Then again, the convertSizeToBacking solution sounds like a better route, as it allows for auto-scaling if the window is resized.
User avatar
Cat_7
Expert User
Posts: 6206
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by Cat_7 »

-nic user,model=dp83932,mac=08:00:07:12:34:56,hostfwd=tcp::2121-:21 \
OFF TOPIC:
This only takes care of the qemu side of things so A/UX can find the network card.
Perhaps you remember you had to manually set the network in A/UX with newconfig etc (See guide)

To get the vmnet stuff going on the Qemu side you need something like:
-nic vmnet-bridged,model=dp83932,mac=08:00:07:12:34:56,ifname=NAME_OF_YOUR_HOST_NETWORK DEVICE

As there is no DHCP you should then assign an IP address etc. in A/UX in the range of your host network. To change an earlier IP configuration, edit the files /etc/rc, /etc/resolv.conf and /etc/NETADDRS

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

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

Cat_7 wrote: Mon Apr 01, 2024 6:13 am
OFF TOPIC:
This only takes care of the qemu side of things so A/UX can find the network card.
Perhaps you remember you had to manually set the network in A/UX with newconfig etc (See guide)
Ah! I had forgotten newconfig entirely... Maybe this points to the answer in Shoebill? I won't try this immediately in the hope that Adespoton, who knows far about these things than I do, may find the answer.

EDIT: I tried to use newconfig, but it didn't find an ethernet interface, so nothing happened. Presumably we need a command line for Shoebill that initializes the network card.
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

I found another useful vmnet-related thread for UTM: https://github.com/utmapp/UTM/issues/3294
On the macOs host, by editing the file /Library/Preferences/SystemConfiguration/com.apple.vmnet.plist and looking for the value of Shared_Net_Address, which is 192.168.64.1, we can change the "range" to some other within 192.168.x.x.
Then, when the vm has been up at least once, the dhcp assigned IP can be changed by editing the file /var/db/dhcpd_leases and setting ip_address for the appropriate machine
So... that provides us with the place that vmnet parameters get configured on the host, the way it interacts with DHCP, and how to override DHCP when you want to manually assign an IP address (which we'll need for A/UX).

I'm currently getting around an hour a week on a Mac to work on all this, so anything you can do to test and document will speed up the process immeasurably :)

On the A/UX configuration front:
https://wiki.preterhuman.net/Newbie_Gui ... pple_UNIX)
Assign IP address

Once you've done your initial A/UX install, run "newconfig" in a root shell and you will be prompted to configure the Ethernet address details. Your onboard Macintosh Ethernet adapter will likely show up as something like ae0 or ao0. Do NOT try messing with the MacTCP control panel on the Mac side.
Enable networking in /etc/inittab

Edit the /etc/inittab file and make the following line modifications for the networking related options you wish to enable:

nfs0:2:wait:/etc/portmap #Set to "wait" for networking
net9:2:respawn:/etc/inetd #Set to "respawn" for networking
net6:2:wait:/etc/syslogd #Set to "wait" to run a syslog daemon

Assign default network route

After you've assigned an IP address to your network adapter, you'll probably want to assign a default route so you can reach outside networks. Replace "192.168.0.1" in the below line with your actual router gateway.

echo /usr/etc/route add default 192.168.0.1 1 >> /etc/rc

This ensures the route is persistent after a reboot.
Adding nameserver

Like a Linux system, A/UX will use /etc/resolv.conf to store nameservers for domain resolution. This file does not exist by default so you can use the following to add a public DNS resolver:

echo nameserver 8.8.8.8 > /etc/resolv.conf

Adding modules to the kernel

As noted in the section about configuring your network adapter, "newconfig" is used to configure the UNIX kernel for your hardware. You can also use the command to add modules to your kernel. See the examples below:

! adds both the nfs and debugger modules to your kernel
/etc/newconfig -v nfs debugger

! removes debugger module from your kernel
/etc/newconfig -v nodebugger

You can also use newconfig to remove modules by using "no" as seen in the following example to remove AppleTalk:

newconfig noappletalk
But this seems to assume that newconfig will find a network card. So we're back to figuring out how to make shoebill report a card to A/UX....
emendelson
Forum All-Star
Posts: 1730
Joined: Tue Oct 14, 2008 12:12 am

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by emendelson »

adespoton wrote: Mon Apr 01, 2024 9:39 pm But this seems to assume that newconfig will find a network card. So we're back to figuring out how to make shoebill report a card to A/UX....
Is all this worth the effort, when the QEMU-based setup works perfectly when the network is started with Cat_7's command line? I've enjoyed experimenting with this, but, having done so, I can't see any advantage to using Shoebill (with the requirement to run as root for access to VMNET) rather than QEMU. Is there a reason for pursuing this, other than the challenge of it?
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

emendelson wrote: Mon Apr 01, 2024 10:09 pm
adespoton wrote: Mon Apr 01, 2024 9:39 pm But this seems to assume that newconfig will find a network card. So we're back to figuring out how to make shoebill report a card to A/UX....
Is all this worth the effort, when the QEMU-based setup works perfectly when the network is started with Cat_7's command line? I've enjoyed experimenting with this, but, having done so, I can't see any advantage to using Shoebill (with the requirement to run as root for access to VMNET) rather than QEMU. Is there a reason for pursuing this, other than the challenge of it?
I'm trying to get the full set running, and QEMU is Q800-only, which means A/UX 3.0+ only. I may end up just putting all this into emulating A/UX 0.7-2.0.1 in MAME using a Mac II, now that they've got floppy emulation working again.

Oh, and for anyone using Shoebill SDL-GUI: the macOS version is just like the Linux and Windows versions, in that you need to right-click the trackpad/mouse to release mouse capture. And command-q will quit Shoebill, even if the mouse is captured (so if you're in SimpleText and hit command-q, expect the A/UX partition to get corrupted as the entire emulation is torn down).

Still trying to make sense of the source code. Seems like it takes the following inputs from the command line:

Code: Select all

<nothing>- help text
-h - help text
help - help text
toby - use the toby video card instead of the shoebill video card (disabled by default)
ram= - RAM size in MB
height= - window height in pixels
width= - window width in pixels
verbose= - whether A/UX boots in verbose mode or not (enabled by default)
rom= - path to MacII ROM image
unix-path= - path to kernel on disk0 (default is /unix)
pram-path= - path to PRAM file (default is ~/.shoebill_pram)
diskX= - where X is a number from 0 to 6.  disk0 will always be the boot image. Path to disk image file.
There's never any check here for netdev or vmnet or anything else network related -- which means it works without a runtime parameter.

Looking at the networking code, it seems to initialize by default. The vmnet code is just drop-in replacing the tap0 code; the important bit is the ethernet code that sets up a virtual NIC.

The ethernet code presents a 3Com driver and reports the board as 'Shoebill Phony Ethernet', vendor Shoebill, revision level Rev-1, part number "Bort". It reports itself with the Apple EtherTalk board ID.

Digging from here, we get to ethernet.c:

Code: Select all

#if (1 == USE_VMNET)
  printf("Starting VMNet with device %s\n", netdev);
  VMNet_start(&ctx->vmnet, netdev);
#else
This seems to indicate that IF we initialize the virtual ethernet device correctly, we should get "Starting VMNet with device <device#>, netdev" printing to the terminal. This obviously isn't happening for us.

So, since the issue doesn't seem to be in the Ethernet driver, the VMNet code, or ethernet.c handler, it must be in core_api.c. In here we have the function uint32_t shoebill_install_ethernet_card, so something has to be calling this.

I see where it's being called in the Cocoa build, but not in the SDL build.

In Cocoa:

Code: Select all

 
	netdev = [defaults objectForKey:@"tapPathE"];
    NSString *defaultMacAddr = [defaults objectForKey:@"macAddressE"];
    ethEnabled = [defaults integerForKey:@"ethernetEnabledE"];
    if (ethEnabled) {
        if (!(parseMACAddr([defaultMacAddr UTF8String], mac))) {
            [self complain:@"Bad MAC addr"];
            ethEnabled = 0;
            return NO;
        }
    }
    return YES;
}
So it's obviously pulling from the preferences plist and setting ethEnabled and calling shoebill_install_ethernet_card(&config, 13, mac, [netdev UTF8String]) if it finds it. I'm not seeing this in the SDL code (yet).
Last edited by adespoton on Tue Apr 02, 2024 12:13 am, edited 1 time in total.
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

Back to the other sub-thread: running A/UX 1.1.1, from https://virtuallyfun.com/wordpress/category/aux/ :
Apple released a real 1.0 product (1.1.1 survives, although you have to run ( /etc/toolboxdaemon & ; term) to get anything fun from Shoebill with the ISO), what can barely be called a bare bones SYSV port with overlapping terminals at best....

Overwhelming, and interesting this is not.

This of course was more like a tech demo, running a single ‘Unix toolbox app’ at a time.
Since Neozeed has a screenshot of him running a windowed terminal of 1.1.1 in the sdl-gui win32 Shoebill there, and implies that all he did was boot the iso, then run "/etc/toolboxdaemon & ; term", I'll have to check out if this is indeed all that's needed here. It kind of makes sense, since you boot into SASH by default, then use SASH to load the Macintosh Toolbox, and then launch a terminal on top of the toolbox -- but since the toolbox wasn't complete with A/UX 1.x, you can't just launch the daemon and then launch the Finder on top -- but instead have to launch something that actually runs, which is the terminal. v1.1.1 toolboxdaemon mostly appears to handle windowing, basic Quickdraw, and other similar bits, but not all the Mac OS resource handling.

It's interesting to me how A/UX 1.x and OS X 1.x appear to have a number of parallels (mostly a tech demo with rudimentary but soon to be changed APIs to test-compile against)....
User avatar
Cat_7
Expert User
Posts: 6206
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by Cat_7 »

I'll have to check out if this is indeed all that's needed here
Yes, you need to start the daemon. Then there is also a graphical tool (hfx) to copy files from the mac to the A/UX side.
See the A/UX Appletalk networking thread.

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

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

adespoton wrote: Mon Apr 01, 2024 10:29 pm Back to the other sub-thread: running A/UX 1.1.1, from https://virtuallyfun.com/wordpress/category/aux/ :
Apple released a real 1.0 product (1.1.1 survives, although you have to run ( /etc/toolboxdaemon & ; term) to get anything fun from Shoebill with the ISO), what can barely be called a bare bones SYSV port with overlapping terminals at best....

Overwhelming, and interesting this is not.

This of course was more like a tech demo, running a single ‘Unix toolbox app’ at a time.
Since Neozeed has a screenshot of him running a windowed terminal of 1.1.1 in the sdl-gui win32 Shoebill there, and implies that all he did was boot the iso, then run "/etc/toolboxdaemon & ; term", I'll have to check out if this is indeed all that's needed here. It kind of makes sense, since you boot into SASH by default, then use SASH to load the Macintosh Toolbox, and then launch a terminal on top of the toolbox -- but since the toolbox wasn't complete with A/UX 1.x, you can't just launch the daemon and then launch the Finder on top -- but instead have to launch something that actually runs, which is the terminal. v1.1.1 toolboxdaemon mostly appears to handle windowing, basic Quickdraw, and other similar bits, but not all the Mac OS resource handling.

It's interesting to me how A/UX 1.x and OS X 1.x appear to have a number of parallels (mostly a tech demo with rudimentary but soon to be changed APIs to test-compile against)....
So; I went and entered

Code: Select all

/etc/toolboxdaemon & ; term
into SASH. It threw an error saying that an unexpected ; was encountered.
So, I entered

Code: Select all

term
and it told me /etc/toolboxdaemon wasn't running.
So, I entered

Code: Select all

/etc/toolboxdaemon &
and it returned success with a background process handle.
So at this point, I entered

Code: Select all

term
and lo and behold! a menu bar with an Apple menu, plus File, Edit, Window, Fonts, Commands, and a terminal window on a grey background! Success! All the desk accessories work, and there's minimal control over my terminal, plus a terminal history. Selecting Quit takes me back to SASH, where typing term takes me back to the Terminal app.

It appears that beyond the UNIX basic commands, there's /usr/toolboxbin that contains derez, fcnvt, hfx, launch, mfs, qdsamp, rez, sample, searchString, settc and term. So it looks like the toolbox can handle some basic resource manipulation after all! The launch command has the option to initialize QuickDraw, TextEdit and Dialogs when launching an application, among other things. So it looks like what A/UX 1.1.1 gives us is a tidy little Mac OS dev environment complete with compiler and resource manipulation tools.

ImageA:UX 1.1.1 in ShoeBill-SDL on M1 Mac
User avatar
adespoton
Forum All-Star
Posts: 4321
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Shoebill - a Macintosh II + A/UX emulator for OS X

Post by adespoton »

What's the secret for converting floppy disks to HD images? Both Shoebill and QEMU-system-m68k lack floppy support, and the non-mac floppy images appear to be unrecognizeable on macOS and Linux. Do I just create a blank HD image and then dd the floppy image to the A/UX partition? And use a CD image containing the floppy images to get the floppies into A/UX?
Post Reply