A wild Macintosh Plus appears!

1MB Macintosh Plus, with extended keyboard & original mouse.
Mac Plus!

This was rather unexpected, but this auction for a loaded Macintosh Plus had shown up, and it was shipping local, and very cheap for what it was. It included the larger keyboard, original mouse, and an external 20MB hard disk.

Rodime ro652 20mb hard disk
Assembled in Scotland!

Sadly, the hard disk is dead. And not like dead dead, but dead dead dead! After I freed the disk from the external enclosure, and tried to power it on, stand alone, the PSU refused to start as the disk has a hard short in the board somewhere. And I can’t say that I’m all that surprised that a hard disk from 1989 is broken. I’m more surprised that someone was using this in 1989 and didn’t take the plunge and upgrade the machine to the full 4Mb of ram.

Anyways I have this chunk of plastic and glass on a desk, but I can’t do a thing with it. I’ve heard of various SCSI emulators out there, and decided to go with a bluescsi v1 with a DB25 interface as they are generally cheaper, and the Macintosh Plus isn’t exactly all that fast so the effort of the v2 is mostly lost.

bluescsi on the back of the Macintosh Plus
Bluescsi module on the back of the Macintosh Plus

Documentation on the bluescsi is scant, but it seems that a diode needs to be soldered onto the Macintosh Plus motherboard to enable bus power, so you don’t need an external USB power source. I’m a bit worried about opening up this thing as I’ms suspecting the plastics are a log weaker than they look, so I opted for just using a USB cable to power the device.

Anyways let me cut to the chase, I have an 8Gb Micro SD card that I formatted ExFAT (the documentation says Fat32 will work, but I found it might work once, but it’ll definitely never work after a reboot), with a single file emulating a 100Mb hard disk (Luxurious!). I named the file simply ‘HD10_512.hda’ which specifies it’s a hard disk, SCSI ID 1, target 0, 512 bytes/sector and it’s a ‘hda’ image. It’s what the Bluescsi want’s so don’t fight it!

To prepare the virtual hard disk, I used Cockatrice III, since the Macintosh Quadra 800 emulation includes SCSI, which let me create a raw disk image, partition it, and format it under MacOS 8.1. The real trick was installing the operating system.

I first tried MacOS 7.0.1, but it would boot up greeting me with the error that needs more than 1Mb of ram. I tried installing a MacOS 6.0.8 manually, but it crashed saying the system folder was corrupt, and then it just went empty disk mac on further boots.

I’m not sure what the problem was, it’s possible it was the filesystem on the card, or some other issued with the Macintosh, I have no idea.

So I broke down and ordered a pre-installed diskette with MacOS 6.08.

reproduction System 6.0.8 disk
Repurposed System 6.0.8 disk

I booted off the diskette, and amazingly the floppy drive worked! And in about a minute I had booted up, and it saw the hard disk! I dragged the System folder over the hard disk, and rebooted, and yeah it booted right up!

Obviously, the next step will be to get a proper screwdriver to open this thing, figure out how to discharge the CRT so I don’t kill myself, and add some additional RAM. I know it’ll be slow but I do want to see MacMiNT run on this thing! Maybe I’ll find/order the needed diode and make the DB25 bus powered eliminating one cable.

A long long long time ago I did own a Macintosh Plus, with 4Mb of RAM, although I mostly used it as a terminal, since it powered up quickly (it was the mid 90s!) and doesn’t take up that much space, so maybe I can slave it to an ESP32?

**UPDATE

I had been using some generic 8GB microSD card on this, and while it seemed mostly fine on the Macintosh Plus, I had since managed to score a Performa 6400. I had been using this Kingston generic 8GB card, and it had frequent timeouts writing/reading on the Performa. As a matter of fact if the SD card was plugged in at powerup with an ISO image it would crash the Mac.

Kingston SDC10/8GB 015FCT C08G… no good!

I scored this SanDisk Extreme 32GB for £15. A bit pricy but it turns out totally worth it!

£15 SanDisk Extreme!

Not only does the Performa not crash with an ISO image but it’s pretty darn quick! Well worth the purchase as all my weird issues seemingly just disappear!

So yeah, lesson learned, don’t go cheap on flash.

Missing link for Basilisk I found

Actually I held onto this, as I wanted to do something crazy for that Marchintosh thing but life got in the way it fell by the wayside, and well now it’s September, and I already have a Qemu instance running A/UX so my ‘at best’ hope of Basilisk II with MMU emulation is all but moot.

Captain, oh Captain!

While it may look like 2 very old emulators, which they are, the interesting thing here is that this old version of Basilisk that only has Macintosh Classic emulation is using the 68000 emulation core from UAE 0.6.8. It took a lot of downloading stuff, a lot of other nonsense, but I eventually found it, and was able to diff around to find the changes made were rather inconsequential, there by letting me rebuild UAE back on top of Basilisk.

My plan had been to either use far newer UAE cpu core, say from Previous as it has working MMU support, or Musashi.

I was building hard coded for TDM GCC 5.1.0 on MinGW. It doesn’t matter anymore but I threw it up on github since that is where all the cool kids are.

https://github.com/neozeed/basilisk-uae-merge

It’s absolutely pointless I guess, but maybe someone will find it interesting.

HFS Utillities

I got a question the other day about how to easily move files in and out of Cockatrice III, especially since as part of my ‘try to make it stable by cutting features out’ approach I removed the ability to mount foreign directories under Basilisk II.

For my personal use, I have an AppleTalk LAN, and I just use a Windows NT 4.0 server with AppleTalk, as a file server/proxy and that works pretty good for me, so much so that I didn’t even think of any other way of doing this.

HFV Explorer 1.3.1

One of the quickest and easiest is HFV Explorer, however the ‘catch’ being it doesn’t read SCSI disk images (aka things with partition maps). But for the ‘massive floppy’ images it’s more than fine.

HFSUtils is another approach, it’s like the old ‘MS-DOS utils’ of ancient Unix days, allowing you to ‘mount’ a disk image, and copy files in and out. I thought I’d give this a spin to copy Marathon into my virtual OS 8.1 image. It’s pretty straight forward first ‘mount’ the disk image:

C:\Cockatrice>hmount.exe scsi0.dsk
C:\Cockatrice/scsi0.dsk: contains 1 HFS partition
Volume name is "SCSI0"
Volume was created on Sat May 19 14:04:04 2018
Volume was last modified on Mon Nov 16 14:59:02 2020
Volume has 1056545280 bytes free

Now make a directory:

C:\Cockatrice>hmkdir scsi0:xfer:

And then copy in the file:

C:\Cockatrice>hcopy marathon.sit scsi0:xfer:

C:\Cockatrice>hdir scsi0:xfer:
f  ????/UNIX         0   5627676 Nov 16 15:34 scsi0:xfer:

C:\Cockatrice>

And just like that it’s there!

And yes it unstuffs!

And just like that we have downloaded a game from the garden, copied it into a virtual SCSI disk, and gotten it to run, from the painful CLI.

Wasn’t that great!?

Cockatrice III 0.5a update

Here’s to US!

Well this is a ‘small’ update, but with a big change, the audio is for the most part working great now thanks to this fix from rakslice. Namely changing SDL to MSB:

desired.format = AUDIO_S16MSB;

And another MinGW tweak, and yeah it’s GREAT!

Even stuff like RealAudio work now! I’ll add some self hosted video later as it’d just get struck from anything public.

Also since the RealAudio player is timebombed for installing, I added some lazy offset to remove however many billions of ticks from the clock letting you jump in some random point in the past when it won’t care.

I guess the final if any justification for a bump would be rebuilding with GCC 8.1.0 on MinGW. I somehow butchered the slirp.h to make it too MinGW’ish so it won’t clean build on Linux or OS X, but I have re-butchered a private branch and it works.. I just need to merge and clean but I’m not in the mood at the moment.

I could be crazy but it “feels” faster.

At any rate, I found that System 7 is more agreeable to running Return to Zork, just use some toast image mounter from within MacOS, and it’ll run!

Also there is some ULONGLONG weirdness going on, so I had to backout Peter’s changes for larger disks. No doubt some standard type thing change in GCC 8.

You can download binaries/source from Sourceforge.

Download Cockatrice III
Download Cockatrice III

Reading .toast image files

Well I put out a cry for help all over the place, looking for Darwin 0.3

And much to my amazement, when I woke up, I not only got a reply but a link to a toast image.  Great, what is toast?  Well simply put toast is a format made popular by then Adaptec Toast.  Obviously the sane thing to do is to find Toast, install it, and mount the disk image inside of a Macintosh.

Adaptec toast 4.0

But, honestly, where is the fun in that?

Instead let’s have Cockatrice III do it!  Now I never did get around to writing proper CD-ROM emulation, nor integrating it, but that doesn’t matter!  Instead I’m going to rely on Daemon tools Lite, to do all the heavy lifting.  DTL will create a virtual SCSI adapter, add in a SCSI CD-ROM device, and mount the image.  Needless to say, I’m on Windows and that is where that part of the adventure ends, as Windows 10 cannot read HFS.

Now back to Cockatrice!

All I had to do was assign the SCSI 6 position to the mounted drive letter, and I’m set!  Just add this to the CockatriceIII_Prefs file:

scsi6 \\.\e:

And now I can mount the image from within Cockatrice III

Darwin 0.3 toast mounted

And there we go, now I can copy the files of just like having a real Mac.

 

More fun with GCC 6.1

So after looking at the -Ofast flags in that utterly unfair GCC 1.4 vs GCC 5.1, and 6.1 , I thought I’d try to build Cockatrice III with it.  Everything went well, and I had a build in no time.

I always hated how I had to massively downsample the audio so I could at least hear things, so I thought I’d try to put them back to 44100Khz, 16bit stereo.  And while compiling, older GCC runs fine, while 6.1 throws this run error!

../SDL/audio_sdl.cpp:57:43: error: narrowing conversion of '-1404829696' from 'int' to 'uint32 {aka unsigned int}' inside { } [-Wnarrowing]
 uint32 audio_sample_rates[] = {44100 << 16};
                                           ^
makefile:104: recipe for target 'obj/audio_sdl.o' failed
make: *** [obj/audio_sdl.o] Error 1

Well it turns out that it’s getting truncated as the audio_sample_rates are defined as an unsigned int, but it really want’s to be a regular integer.  So I changed the type, and now I have high def audio!  While I was in there, I fixed some stupid typos in the keyboard so I can actually use vi in MacMiNT.

It’s still in 256 colors, I’m missing something fundamental as to why it’s not working but I just don’t have enough time to mess with it today.

For anyone who cares, the Win32 binary package is on sourceforge.

Time for another Cockatrice release

I’ve been busy at work, but I did get some stuff done on this over the weekend, and just wanted to push this version out while there is some momentum.

The big fixes are in SCSI to support the dynamic scatter gather buffers so you can format big (lol) disks.  Then again I only tested a 2GB disk but it’s working fine as far as I can tell.

I also hard coded SCSI id #6 as a CD-ROM.  It only reads HFS partitioned images, and only can boot from a handful of those.  From some SCSI CD emulation packages with passthru it performs just as poorly, so it’s not just me.  I tested with the ‘blessed’ Win32 build 142, with ForceASPI in a Windows XP VM with emulated SCSI CD.  There is a lot more ‘magic’ going on with the cdenable.sys driver on the Windows side, which mounts ISO’s without any hesitation.

This also includes my latest networking fixes as I moved more of the networking code to use queues, forced the 60Hz timer to hit the network card so it won’t stall anymore, and added in that timer patch, that more than doubled my LAN download speeds.

I’ve also added a simple PCAP filter as I noticed that my LAN was quite chatty, and I figured all this traffic wouldn’t be good as an emulator really shouldn’t be processing stuff it doesn’t need to.  Something like this:

(((ether dst 09:00:07:ff:ff:ff) or (ether dst ff:ff:ff:ff:ff:ff) or (ether dst fe:fd:00:00:16:48)))

09:00:07:ff:ff:ff is the AppleTalk broadcast address, ff:ff:ff:ff:ff:ff is the typical all hosts broadcast, and I’m still generating a MAC based on PID which is good enough for me.

Speed!

Feel the need for speed!

So while before downloading 124MB on my LAN took 8 minutes, now it’s about a minute.

I’ve updated the sourceforge page with source, Win32, Linux i386 and OS X (10.8) builds. I’ll add a 10.6 x86/PowerPC build later.  On the sourceforge page I also added a utilities section with a simple ISO image with various utilities to get you started, including the A/UX partitioning tool to partition & format a virtual disk, a tool to try to mount ISO’s (remember HFS has the only hope right now), QuickTime, Flash, Internet Explorer and some other stuff.

Also, thanks to Peter, it’s also available on github, so my horrific edits are open for the world to see…

I have no idea why the networking in Basilisk II keeps stalling

And it is quite frustrating.  The most I can do is about 100MB worth of AppleTalk traffic, or 1.5GB of TCP/IP then the receive function EtherReadPacket just stop being called, and then the whole thing stalls out.

I don’t really ‘like’ my solution, but it does work.  I went ahead and chained the EtherInterrupt function to the 60Hz timer to ensure it’ll fire, and it seems to be working. The good thing is now I’m getting ~200K/sec using pcap or SLiRP.  So things are faster!

Then after scanning the changelog, I found this interrupt patch, and it doubled my throughput on the network to over 400K/sec!

427K/sec via SLiRP

427K/sec via SLiRP

So now I can copy about 350MB worth of data in about 5-7 minutes, and it doesn’t stall out.

357MB worth of AppleTalk

357MB worth of AppleTalk

I can now copy hundreds of MB worth of stuff from one AT server to another.

What is also surprising is that by using Internet Explorer 4.0.1 for MacOS, I get speeds of around 1.0Mb/sec(with as high as 1.6!)

Internet Explorer 4.0.1 screaming along

Internet Explorer 4.0.1 screaming along

I know IE has always had a bum rap, but it really is a better legacy browser on MacOS.

I also merged the scsi driver’s buffer with BasiliskII’s buffer so the scatter/gather can now handle the absurd requests of 4MB++ worth of reads in one swoop.

Announcing Cockatrice III

Well I was shuffling files back and forth into Shoebill, and with the advent of Ethernet support, I decided I wanted to build an AppleTalk network.  This endeavor seems to have taken a life of it’s own.

So, the first thing I did was tear into minivmac, as I figured it would be the easiest to modify, as ‘mini’ is in it’s name.  But it’s more geared to LocalTalk.  From it’s readme:

It does this by converting the LocalTalk packets between SDLC frames in the virtual machine to LocalTalk Over Ethernet (LTOE) packets.  These LTOE packets will be sent out the host machines Ethernet interface and will reach any other machine on the LAN.  LTOE packets are not routable and not recognized by EtherTalk devices.

Which is pretty creative, but I want to talk to A/UX, Windows NT and Cisco routers.  So this isn’t going to work out for me.

The next other ‘big’ names in Macintosh emulation are Basilisk II and SheepShaver.  Both of which are from Christian Bauer which is a sizable download (or so I thought) and has a very confusing release versions for Windows. So I went ahead and tried BasiliskII, which only does some native networking via a TUN/TAP & bridge solution (which is really popular solution for plenty of UNIX based stuff), which personally I don’t really care for.  The Windows version does support SLiRP, but for some strange and annoying reason it always crashes when I try to download anything big.  As a matter of fact, the Windows version crashes, a lot!

While digging around for various builds of Basilisk II, I found the defunct sourceforge page, which is thankfully still up.  And there I found the 0.8 and 0.9 release source code, which weighs in at a tiny 350kb in size.  This is something I could probably dive into.  So I went ahead and tried to build it on a Debian 7 x86 VM.  And much to my surprise, after altering configure to accept GCC 4.7, and forcing it to turn X11 on (I don’t know why it kept failing to detect it), I was able to build a binary in no time.  Even better, it worked!

So the first few goals were simple, I wanted to take 0.8 and remove it’s dependency on X11,and make it use SDL 1.2.  Why not SDL 2.0?  Well 2.0 is more about 3d space, and even to render a flat framebuffer it uses streaming textures.  Which is too heavy for me, so I’m sticking with 1.2.  I took a bunch of code from SDLQuake, and after a while of bashing it around, I was able to open a window, and capture some ouput from the framebuffer.  With even more bashing around I got it to work correctly.  I did make some small tweaks though, it only supports 8bit depth.  But I’m interested in networking, so 256 colours is fine by me.  Now that i could see what I was doing, I was able to then re-compile on OS X, and I was greeted with the Mac Boot screen.  The harder part was Windows, as the system code written by Lauri Pesonen who did an excellent job of porting BasiliskII to Windows, but to say their code took 100% advantage of the Win32 API would be an understatement.. And I wanted something more pure to being SDL so I really couldn’t use much of that code.  And what code I could find it was for far later versions.  However with enough pushing I did finally get BasiliskII to boot up on Windows.  I was once more again bitten by the fact that open on Windows defaults to being in ASCII mode.

The next thing to add was SDL input for the keyboard and mouse.  And at this point googling around for an example of an input loop for SDL that is appropriate for an emulator I stumbled uppon the fact that there already was a SDL support built into the more current version of Basilisk II.  But for some strange reason I kept going ahead, and incorporated some of the code into my 0.8 branch.  And then I could finally send some keystrokes, move the mouse, and click on things!  Things were looking up!

While looking at the SDL code, I did see they also have audio support, so I went ahead and borrowed the skeleton framework from there, although the initialization didn’t work at all as BasiliskII had drifted in how it hooked into the native sound support.  So I once more again turned to SDLQuake, and I was able to initialize sound, and Even get QuickTime to play the old Quadra quicktime video, which was the first QuickTime thing I’d ever seen, back when they were still making Quadras.

So now with video and sound in place, it was finally time to tackle the networking.  At first this seemed quite easy to do, and using SIMH for inspiration I was able to quickly replace the tun/tap code with some pcap code to open the interface, send packets, and receive packets.  One more again I started on Linux, made it build on OS X, although my MacBook air doesn’t have anything I can really inject packets into so I don’t know if it actually works.  The bigger test for me was on Windows with a GNS3 network, and with a few more minor changes I was happily sending AppleTalk to both Shoebill and Windows NT.

The next thing I wanted to tackle was SLiRP support.  Ironically to bring SLiRP to Shoebill I used the SLiRP from the github of Basilisk II.  At this point I figured this would be very simple, and I could wrap up later that day.  It ended up taking me three days.  Once more again my build would crash all the time, just like the later Basilisk II builds.  Using Internet Explorer 4.0.1 would seemingly crash the whole system within seconds with faults in SLiRP’s slirp_select_fill, and slirp_select_poll functions.  Now if you don’t call these functions SLiRP doesn’t process it’s TCP state and you end up with barely functioning UDP to only SLiRP which isn’t great beyond DHCP and DNS.  First I tried semaphores which only made things worse as the nature of Basilisk II’s threaded nature just made the requests stack up deadlocking within seconds.  I tried a mutex, timed mutexes and various other locking methods insdide of SLiRP and Basilisk II to no end.  Netscape would kind of work, but IE would crash the whole thing out after a few pages. Then a better solution hit me as I was playing with the system clock on the Windows build.  There is a 60Hz timer that calls a 1Hz timer once every 60 ticks.  What if I had the clock drive SLiRP?  And to my amazement not only did that work, but it worked great until I hit another problem that I had with Shoebill (that needs to be fixed now that I found away around it here).  There is a static buffer that passes data between SLiRP’s callback when it is going to send a packet to BasiliskII and when Basilisk II then feeds the packet to MacOS.  With enough traffic it will overwrite part of itself as they are on two different threads.  Once more again I tried semaphores, which of course is the wrong tool here as if something is stacking waiting for it to unstack is just crazy, and more mutexes.  The mutexes kind of worked but performance was horrible, as in 1992 dialup speed horrible.  And I didn’t want to simulate a 1992 internet experience 100%

So the obvious solution as a queue.  I took a simple queue implementation, added the ability to peek, changed it to accept a packet structure and I was set.  Now I only needed a mutex when I queued items, and dequeued them.  But I could hold 100 packets easily.

So with all that in place I can finally download files greater than 10MB, and even with Internet Explorer!

Download

124MB in 8 minutes!

So the next was to make Pcap dynamically loaded, which for C++ is a bit of fun with __cdecl, GetProcAddress and all that fun.  But I had it working after a bit so now if the user doesn’t have WinPcap installed they don’t get an error message, and I don’t have to maintain two builds.  Nobody likes doing that kind of stuff.  Ever.

Multitasking.. Kind of.

Multitasking.. Kind of.

There is still plenty of things broken afterall I’m using an ancient version of Basilisk to base this off of. I’ve also removed a bunch of features as I wanted to make this more of a ‘core’ product with again a focus on networking.

Will this interest the majority of people? Probably not.  But for anyone who wants to actually download a file this may be somewhat useful.

Where to go from here?

Well there is still a lot of OS specific stuff in the code that I want to convert to SDL.  I’d like to build from a 100% more generic code tree rather than having private files here and there.  The CPU optimization programs that re-read GCC’s assembly output don’t do anything.  I want to try it through an older version of GCC and see if there is any difference in speed.  I also recently received the source code to vc5opti.cpp and I’d like to try that to see if it speeds up the Windows Visual C++ based build.  Long term I’d love to patch in the UAE CPU code from the newer versions that have a far more solid 68030/68881 and 68040 emulation.  The price of standing on so many tall shoulders is that when I fall off I don’t know if the CPU exceptions I see are faults in the CPU emulation, Basilisk II or just plain crashes in MacOS which was certainly not the most stablest thing once you mixed in multimedia and networking.  It was par with Windows 3.1, which honestly both of them were ‘saved’ with help from the older generation, ala BSD Unix for MacOS, and the VMS team for Windows.

So after all this I’m ready to release some binaries, and code.  Although the last thing I wanted to do is add more confusion by calling this Basillisk II v0.8.SOMETHING … A quick google search on Basilisk gave me this:

As for some reason I actually never did look up what a Basilisk was.  So seeing that this project is basically the same thing I chose Cockatrice.

The Cockatrice III source forge page is here, Windows binaries, Mac OS X binaries, and source code here.

There are plenty of bugs, and plenty of things not working, but it works well enough to do things, and that is a credit to everyone who worked on Basilisk II before me.

So Microsoft still has the MacOS Outlook for download

I was kind of surprised.  Even more so that I could get it working to my Exchange 5.5 server.

outlook on macos 8

Outlook on MacOS 8.0

Unless you have AppleTalk enabled on your server, you’ll need to setup your TCP/IP, and that also means you have to be able to resovle the exchange server by name.

If you want to use a hosts file, be sure to set the user mode to advanced in the control panel, and then setup a hosts file in the special format that looks more like a DNS zone record.

exchange.superglobalmegacorp.com A 172.18.8.50
exchange CNAME exchange.superglobalmegacorp.com
bbs CNAME bbs.superglobalmegacorp.com

Then save it somewhere like System/Control panels, point the TCP/IP panel to it, and that should do it.

For anyone who wants to try to connect to their Exchange server, you can find the client here, on their ancient ftp server.  And I suppose you could also try the one from Exchange 4.0SP2, but I didn’t bother, since this one is so new, like 1999!