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

Post Reply
pruten
Tinkerer
Posts: 68
Joined: Thu Feb 27, 2014 3:10 am

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

Post by pruten »

Cat_7 wrote:You can't do this to us ;-)

Lets reverse the flow from public to private and make the private public!
I think it'll break the build for everybody but me if I push these changes in their current state...
emendelson wrote:This is amazingly impressive. Is there any hope of getting a "Unix" disk or its equivalent?
One way to do that would be to implement a dinky NFS or AFP server in the emulator, and then A/UX could mount it - but I think it might violate the terms of my employment if I wrote and released a fileserver implementation. It'd be easy enough to just run a NFSv2 server on your home network and mount that, though. Or you could set up the NFS server on A/UX and mount that on the host machine.
Last edited by pruten on Fri Sep 05, 2014 12:22 am, edited 1 time in total.
User avatar
adespoton
Forum All-Star
Posts: 4227
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 »

Yeah; contracts can be annoying. Does yours say that you can't work on developing code in the same arena, or does it say you can't be involved with projects that develop code in the same arena? I'm just wondering if someone else could maintain the server portion and leave you to work on the actual emulator. This could be done by separating out the UI, the emulator core, and the hardware cores (as much as that's possible for anything touching old world Macs) so that you could focus on the emulator core and any non-storage hardware cores, and leave the development of the UI and host-facing code to others.

Otherwise, a host-based NFS share is probably the way to go, although that gets a bit tricky for people attempting to deploy Shoebill on Windows.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

ethernet!? too amazing man!!!
don't do today what you can put off until tomorrow.
User avatar
Cat_7
Expert User
Posts: 6145
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 »

Hi,

Great to see you submitted the ethernet code! I built a version for OSX with the new code.
I have tuntaposx installed from http://tuntaposx.sourceforge.net/
It seems I can run the executable only as root from the command line.
Edit: I copied over netscape 3 from basilisk, but how to set MacTCP? My mouse doesn't allow me to select and edit most fields in the control panel.

For a normal user it crashes with:

Performing @selector(applyAndRunPressed:) from sender NSButton 0x600000147dd0
Assertion failed: (ctx->tap_fd >= 0), function nubus_ethernet_init, file ethernet.c, line 493.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff94644866 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff9482f35c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff94b1cb1a abort + 125
3 libsystem_c.dylib 0x00007fff94ae69bf __assert_rtn + 321
4 org.shoebill.Shoebill 0x000000010985039a shoebill_install_ethernet_card + 618
5 org.shoebill.Shoebill 0x000000010984f1f9 -[shoeApplication startEmulator] + 318 (shoeApplication.m:377)
6 org.shoebill.Shoebill 0x000000010984daa7 -[shoePreferencesWindowController applyAndRunPressed:] + 57 (shoePreferencesWindowController.m:186)
7 com.apple.AppKit 0x00007fff91b2b260 -[NSApplication sendAction:to:from:] + 327
8 com.apple.AppKit 0x00007fff91b2b0de -[NSControl sendAction:to:] + 86
9 com.apple.AppKit 0x00007fff91b77c4d -[NSCell _sendActionFrom:] + 128
10 com.apple.AppKit 0x00007fff91b91655 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2316
11 com.apple.AppKit 0x00007fff91b90a27 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 487
12 com.apple.AppKit 0x00007fff91b9013d -[NSControl mouseDown:] + 706
13 com.apple.AppKit 0x00007fff91b11a58 -[NSWindow sendEvent:] + 11296
14 com.apple.AppKit 0x00007fff91ab05d4 -[NSApplication sendEvent:] + 2021
15 org.shoebill.Shoebill 0x000000010984ead2 -[shoeApplication sendEvent:] + 421 (shoeApplication.m:202)
16 com.apple.AppKit 0x00007fff919009f9 -[NSApplication run] + 646
17 com.apple.AppKit 0x00007fff918eb783 NSApplicationMain + 940
18 libdyld.dylib 0x00007fff9483f5fd start + 1


Best,
Cat_7
pruten
Tinkerer
Posts: 68
Joined: Thu Feb 27, 2014 3:10 am

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

Post by pruten »

Cat_7 wrote:Hi,

Great to see you submitted the ethernet code! I built a version for OSX with the new code.
It crashes with:

Performing @selector(applyAndRunPressed:) from sender NSButton 0x600000147dd0
Assertion failed: (ctx->tap_fd >= 0), function nubus_ethernet_init, file ethernet.c, line 493.

Should I set some pref or have some prerequisite software installed, such as the tun/tap driver?
Or is the code not fully functional yet?

Best,
Cat_7
Oh wow, that was fast! Yeah, to get it running on OS X (and it probably only works on OS X right now), there are three
main things you need to do: install and configure the tap driver, rebuild the A/UX kernel to support networking, and setup a bridge/private network.

Note: I just tried all this on A/UX 3.0.1, and it hangs every time. But it does seem to work on 3.0.0...

To install/configure the tap driver
1) Download and install the tun/tap driver for OS X.
2) Restart your machine (or just kextload the tap driver)
3) chmod a+rw /dev/tap0 (this needs to be done every time you reboot your machine)

To rebuild the A/UX kernel (this only needs to be done once)
1) Just run "newconfig" as root from a shell on A/UX. It should automatically detect the network card.

Code: Select all

localhost.root # newconfig
newconfig: Making backup copies of /etc/inittab /etc/passwd /etc/group.
newconfig: Preparing to build a new kernel.
newconfig: Building a new kernel (this may take several minutes).
newconfig: Restoring kernel parameters.
newconfig: Checking for any installation information.
 1 ae Ethernet card(s) installed
ae0: Would you like to configure this interface for IP? [y/n, default=y] >>> y
Please enter a host name (it must be unique): auxie
Please enter a NIS domain name [none]:
ae0: Please enter an Internet address: 192.168.2.100
ae0: Please enter a netmask [none]: 255.255.255.0
ae0: IP address 192.168.2.100
     netmask 255.255.255.0
     broadcast address 192.168.2.255
OK? [y/n, default=y] >>> y
newconfig: To avoid kernel/device inconsistancies, reboot immediately.
   The new configuration will take full effect when the system is rebooted.
localhost.root #
2) Add this line to the end of /etc/rc on A/UX,

Code: Select all

/usr/etc/route add default 192.168.2.1 1
3) And reboot A/UX

To set up a private network,
(note: the emulator has to be running before you can run ifconfig. And every time the emulator stops (or crashes), you need to reconfigure tap0 again)
1) Start running the emulator
2) in a shell on OS X, sudo ifconfig tap0 inet 192.168.2.1/24 up

Now you should be able to ping A/UX (192.168.2.100), or ping OS X (192.168.2.1)...
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Just planning ahead for the time when Shoebill can replace Basilisk II -

After you're recompiled the kernel, presumably the other steps could be performed by an AppleScript wrapper - first changing the permissions on tun0, then starting the emulator, and finally running the shell script "ifconfig, etc." You'd be prompted for your password, but otherwise it could all be automated by the AppleScript. Does this sound right?

This is all a very exciting development. A thousand thanks for it.
User avatar
adespoton
Forum All-Star
Posts: 4227
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 »

Sounds right to me...
As our most prolific applescripter, feel like writing something up for the rest of us?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

adespoton wrote:Sounds right to me...
As our most prolific applescripter, feel like writing something up for the rest of us?
I'll be glad to. [EDIT: Remove request for prebuilt Shoebill setup; it was easy to make my own.

Ideally, the whole system - Shoebill and disk image(s) - should all be in a single application bundle, and I can try to accomplish that.
Last edited by emendelson on Sat Sep 13, 2014 12:06 pm, edited 1 time in total.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Getting somewhere: There's no need for the prebuilt system I asked for in the previous message.

I built the current GitHub version, booted into a disk image named something AUX_3.0.1_install.toast_image and found the command prompt. Then installed the tap/tun driver in OS X, restarted OS X, restarted Shoebill and rebuilt the kernel according to the instructions, and was able to ping from OS X to AU/X.

Next question: is it possible to FTP to AU/X? When I tried from the OS X terminal, the connection was refused. What must I do (if anything) to make A/UX accept an FTP connection?

Also, to run Shoebill from an OS X Applescript wrapper, I would need to know the command line that starts Shoebill and selects a rom file, a disk, memory, etc. Is it the same as in the Windows build?

After that, I think it should be possible to get an AppleScript wrapper started.

Meanwhile, Shoebill is VERY impressive. (And I didn't have a crash when setting up the network with 3.0.1.)

(And I'm right in thinking there is no easy way to install AU/X to a blank disk image instead of booting up from the install CD every time?)
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Applescript wrapper progress:

OK, I've written an Applescript for Shoebill that runs the various shell commands, and all I need in order to automate it is a command that is the equivalent of launching Shoebill, going to the preferences, and clicking Apply and Run. I tried using the command-line switches from the Linux version (using the Unix executable), but nothing visible happened. Is couldn't find anything in the source code to help. Any advice will be gratefully received.

With a little bit of easy work, I can set up the script as an application that can contain Shoebill.app, a ROM file, and one or more disk files. With a little more work, I can set it up so that you can drop a new copy of Shoebill.app, a new ROM file, or a disk file on the Applescript and have it put them in the right place. But I'll save that for later.

I can also set it up to install the TunTap driver if it isn't installed, but that's another job for later.

Any advice on the command-line method of launching Shoebill seems to be what I need now.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

OK, here's a first attempt at a self-contained AppleScript wrapper for Shoebill, complete with networking. It will ONLY work if you follow the instructions exactly, and I do mean exactly.

1. Download and install the TunTap for OS/X package as described elsewhere in this thread. Restart your machine.

2. Set up AU/X as described in pruten's post from 11 September, in which he tells how to recompile the kernel, etc. You must follow his instructions very, very carefully. Use ping in AU/X and OS X to confirm that the connection works.

2. Download the AppleScript wrapper here:

https://dl.dropboxusercontent.com/u/271 ... er-0.1.zip

It contains the current version of Shoebill, but you have to add your own rom and disk image. Here's how:

3. Ctrl-click on the wrapper app and choose Show Package Contents. Navigate to Contents -> Resources -> Files. You will see two folders, one called disk0, the other called rom.

4. Make a COPY of your boot disk image and drag it into the "disk0" folder. (Please don't use a filename with spaces in it.)

5. Make a copy of your MacII.rom and drag it into the "rom" folder. (Please don't use a filename with spaces in it.)

6. Close the window, and launch the AUXrunner-01 application.

7. You will be prompted to go to the Shoebill Preferences menu and click "Apply and Run." Click OK on the prompt and then do what the prompt tells you to do. (Shoebill will launch automatically; you don't have to run it separately.)

I'll change step 7 when I figure out how to launch AU/X from the command line, and not from the Shoebill preferences.

Comments, suggestions, etc. are welcome. Future versions will support more than one disk image, and will probably let you drag a rom file and disk images files on the application and install them automatically. But that's for another day.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Sorry to clutter up the bandwidth here, but here are more reports and questions:

First, neozeed or anyone else: until pruten gets a chance to work on his code again, is there any way to patch the OS X source so that the Unix executable can start with command-line parameters like the Windows version?

I was able to get GUI scripting to work in my wrapper so that it automatically presses the Apply and Run button, but it only works in the Applescript Editor, not in the standalone application, and it would be a lot better to be able to launch Shoebill from the command line. I looked at the source code, but I'm too much of a beginner to figure this out.

Next, under 3.0.1, I can't make the Monitors setting "stick" - if I switch to thousands or millions of colors and shut down, it starts up in black and white. Am I doing something wrong?

And finally, which web browser might work 3.0.1?
User avatar
Cat_7
Expert User
Posts: 6145
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 »

Hi

You need the SDL2 framework (https://www.libsdl.org/release/SDL2-2.0.3.dmg) installed in e.g., Library/Frameworks/

Check your source to find the sdl-gui folder. Execute osx_build.sh. This will create a shoebill version in sdl-gui folder.

You can start it from the command line without going through the preferences GUI with something like this:
./shoebill disk0=/Users/hsp/Shoebill/AUX3.0.1/Aux_3.0.1.iso rom=/Users/hsp/Shoebill/MacII.rom width=1024 height=768 ram=64

It seems these are the settings you can make:
E.g. disk0=/home/foo/aux3.img disk1=/blah.img
ram=<megabytes of memory>
E.g. ram=16
height=<num pixels>
Specifies the height of the screen in pixels.
width=<num pixels>
Specifies the width of the screen in pixels.
pram-path=<path to PRAM file>
Defaults to ~/.shoebill_pram
verbose=<1 or 0>
Whether to boot A/UX in verbose mode. Best to leave it at default (1).
unix-path=<path to kernel on disk0>
Path to the kernel file on the root disk image. Best to leave it at default (/unix).

About browsers: I tested netscape 3(!), and it works. BasiliskII can run IE 4, so perhaps try that?

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

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

Post by emendelson »

Your build instructions worked perfectly. I'm still sorting out some problems. More details later. (I deleted the rest of this post, which turned out to be inaccurate...)
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

As I said earlier, your build instructions worked perfectly, but there seems to be one new problem:

When I launch shoebill from the command line (as opposed to launching it from the Preferences menu of Shoebill.app), AU/X reports that it has no ethernet card, and can't open the network.

Presumably something is wrong in the command-line build that isn't wrong in the Xcode build. (Or am I missing something crucial?) Anyway, until that's fixed the Applescript wrapper still needs some user intervention.

I've posted version 0.2:

https://dl.dropboxusercontent.com/u/271 ... er-0.2.zip

It works like the previous version. However, if - and only if - you change its name so that it includes "UI" (for example "AUXrunner UI"), you can open it in the AppleScript Editor, click Run, and have it start Shoebill and the network automatically, with no prompting. (You may need to enable GUI Scripting in the Security & Privacy pane of System Preferences.) Unfortunately, this doesn't work when you double-click on the script icon.

Anyway, if anyone can solve the mystery of the no-ethernet-card command-line build, I'll be grateful.

EDIT: And how did you connect to the internet from AU/X?
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

emendelson wrote:As I said earlier, your build instructions worked perfectly, but there seems to be one new problem:

When I launch shoebill from the command line (as opposed to launching it from the Preferences menu of Shoebill.app), AU/X reports that it has no ethernet card, and can't open the network.
EDIT: And how did you connect to the internet from AU/X?
The GUI connection initializes the ethernet.

look in sdl.c in the _setup_shoebill function for:

Code: Select all

    shoebill_start();
then just add before there:

Code: Select all

    uint8_t ethernet_addr[6] = {0x00, 0x24, 0x7e, 0x14, 0xd7, 0xff};
    shoebill_install_ethernet_card(&config, 13, ethernet_addr);

And you'll be good to go!

I'm working on adding SLiRP support for Shoebill so it'll run in usermode for it's networking, with the same code from Qemu that uses -net nic -net user ...

It sucks for things like FTP, but for telnet/http it works awesome. I got the library initialized, so it's a matter of cribbing my old SIMH port of slirp into shoebill and it'll be up... So at least I've done this kind of thing before :lol:
don't do today what you can put off until tomorrow.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Oh yeah!!!!!!


Image


Binaries are HERE, and my hacked up source code is HERE.

By default TCP port 42323 is redirected to 10.0.2.15's port 23 (so you can telnet into the VM!).

In the 'core/ethernet.c' is where re directions are setup. I suppose I could read a config file, but for now, it's hard coded.

Code: Select all

       slirp_redir(0,42323,guest_addr,23);	//telnet
       //slirp_redir(0,42370,guest_addr,70);	//gopher
       //slirp_redir(0,42380,guest_addr,80);	//http
You get the idea.
don't do today what you can put off until tomorrow.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

neozeed wrote:look in sdl.c in the _setup_shoebill function for:

Code: Select all

    shoebill_start();
then just add before there:

Code: Select all

    uint8_t ethernet_addr[6] = {0x00, 0x24, 0x7e, 0x14, 0xd7, 0xff};
    shoebill_install_ethernet_card(&config, 13, ethernet_addr);
And you'll be good to go!
Neozeed, that did the trick! Thank you! I've now posted a new version of an Applescript wrapper that lets you put all the files into one application; and it performs all the terminal commands for you:

https://dl.dropboxusercontent.com/u/271 ... er-0.3.zip

It works the same way as before: drag the rom file into the rom folder and a disk image into the disk0 folder.

It reads the preferred ram, width, and height from an existing Shoebill plist; if that file doesn't exist, it defaults to 64MB and 1024x768.

I code-signed it, so it can't hurt to run it once - to tell OS X that you want to run it - before dragging the rom file and disk image into it, but it may complain anyway after you do so.

WARNING AND QUESTION: I haven't yet tested this on another machine. Will the SDL framework need to be installed on the other machine, or will the command-line shoebill run without it? And if the SDL framework needs to be installed, can I include it inside the Applescript wrapper? (I know, I know, I should try this myself, but if anyone has faced this problem before, I'll be grateful for any instructions.)
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Yeah you'll defiantly need the SDL frameowrk

I never could figure out the 'proper' way to package it as a nice framework...
don't do today what you can put off until tomorrow.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Thanks - what I think I'll do is include a link to the framework download. Do you know an easy way to test for its existence? I could look in /Library/Frameworks, but it could be other places as well.

Also, I'll ask on Macscripter.net if anyone knows a way to package it.
neozeed
Apple Corer
Posts: 293
Joined: Sun Aug 25, 2013 3:25 am
Location: Hong Kong

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

Post by neozeed »

Ive been using NeXSTEP for the better part of forever, but it's packageing thing always screwed me up.

Even my port of quake to NeXTSTEP still had to be run from the command line, and the package was a glorified tar, but checking for frameworks properly... Its in the documentation, and it fundamentally hans't changed since 1988 but It's not the easiest thing out there to read.
don't do today what you can put off until tomorrow.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

OK, new version of the AU/X wrapper - AUXrunner:

https://dl.dropboxusercontent.com/u/271 ... er-0.4.zip

Now offers to install the SDL framework if needed. Still requires you to copy a ROM and disk image into itself.
pruten
Tinkerer
Posts: 68
Joined: Thu Feb 27, 2014 3:10 am

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

Post by pruten »

Wow! Very impressive guys, I'm flattered :)

Very busy with work now... I'll get back into this shortly
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

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

Post by emendelson »

Shoebill is just terrific - the best thing in Mac emulation in years and years and years. Thank you for it!

If anyone wants to improve that wrapper, please go ahead and do so. Meanwhile what I'll work on is this:

1. Support for more than one disk image

2. Ability to drop a ROM file on to the icon and have it copied automatically into the wrapper. I'd also like to test the ROMs for the correct size/checksum, etc.

3. Ability to drop image files on the icon and have them copied automatically to the wrapper. The trick here is getting them into the right disk0, disk1, etc., folders, and either replacing an existing image or adding a new one.

4. Add an option NOT to display the "connection successful" message (or make it a Notification Center notice).

Meanwhile, if anyone can tell me (a) how to FTP into AU/X from OS X and (b) how to get out to the internet from AU/X, I'll be grateful.
pruten
Tinkerer
Posts: 68
Joined: Thu Feb 27, 2014 3:10 am

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

Post by pruten »

emendelson wrote:Shoebill is just terrific - the best thing in Mac emulation in years and years and years. Thank you for it!

Meanwhile, if anyone can tell me (a) how to FTP into AU/X from OS X and (b) how to get out to the internet from AU/X, I'll be grateful.
Thanks! Quick reply:

a) Try using A/UX 3.0.0 instead of 3.0.1. I was able to ping 3.0.1 at one point, but couldn't connect to any servers... they might just not be configured by default

b) You'll need to create an interface bridge, rather than creating a local network for tap0. So far, I haven't been able to get this to work over wifi, since my router won't route ethernet frames to a *different* MAC address than the one it expects.

Instead of ifconfig tap0 inet blah blah, you'll need to do something like
ifconfig bridge2 create
ifconfig bridge2 addm tap0 addm en4 up

where en4 is interface name for your *wired* ethernet interface. (this might be en0 for you).

You'll also need to reconfigure networking in A/UX to connect to your router, which probably has different subnet/address than 192.168.2.1.
Post Reply