Basilisk Ii Re: [b2-devel Fixes For Basiliskii And Sheepshaver For Mac

The big change is the new 68881 maths FPU emulation. It’s completely new code in this version. As the author, Pruten mentions: it should be the “most accurate” 68881 emulator (with regard to chip behavior) ever written, as far as I can tell. I can’t find another open source emulator that even attempts to emulate FPU exceptions, probably because Motorora’s documentation is terrible. Rife with typos and errors, and lacking descriptions for lots of edge cases.

It’s also a superset of IEEE 754, so it’s tricky to get softfloat, a strict IEEE 754 implementation, to implement all the weird extra behaviors in the 68881. On the flipside however: It will also be much slower than the old version, since the new FPU uses. The transcendental instructions will be emulated by running whatever the best natively available function is, and then blindly copying the result to the dest FPU register.

Since the FPU is the last big piece of shoebill that requires x86, this should allow it to compile on other architectures, like maybe PPC I’ve only recently rebuilt the emulator with only the addition of the SLiRP code that I’ve been able to debug from (who said that I was wasting my time? At a minimum I ‘fixed’ up SLiRP to make it more stable), and kicked out a Win32 build (/). I’ve just had it running doing a simple shell script after disabling the UI.

So far it’s 15 hours of uptime 8:43am up 15:02, 3 users, load average: 0.00 0.01 0.01 Which is nice. I should add, to disable the UI in A/UX it’s best to edit the inittab and change co::respawn:/etc/loginrc to co::respawn:/etc/getty console co9600 And now you’ll get a “text” login. Text mode login for A/UX I guess the real test will be to see if it makes it through the night.

(edit) And yes it did! 5:40pm up 1 day, 2 users, load average: 0.00 0.00 0.00 I’ll let it run a little longer but this is like a new record. Although at the same time, I’m not hammering the poor thing. # netstat -ni Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll ae0 1500 10.0.2 10.0.2.15 4232 0 3551 0 0 lo0 1536 127 127.0.0.1 157 0 157 0 0 Author Posted on Categories,. Honestly I feel kind of hesitant releasing this, but I know it was desired, and I guess it’ll help someone somewhere being able to have an easier conversation So I’m going to upload my source tree, including binaries built with GCC 4.0 & 4.2 with either O2 or Os flags.

I’m not sure which is more stable/fasterSo. Sorry you still have to deal with the changing password thing, but cancel it, and it’ll tell you the password.Other lessons learned SheepShaver’s segfault model only works when the CPU thread is the main thread. Even though you “can” stuff the CPU into a subordinate thread, it doesn’t play nice once it segfaults, it’ll just spin waiting for something that clearly isn’t going to happen.In config.h I added in USEGLOBALvideo as a way for main to call the screen update to end the vast majority of pool leakage.

I also added SHEEPSHAVERCURSOR to enable the hardware cursor. I was having some issues installing OS 8.x when the ‘hand’ was drumming the fingers waiting for the OS to install it crashed many times, while disabling the hardware cursor made it play nicer. Maybe it’s my setup, I’m not sure.

Also in this version I don’t read.sheepshaverprefs but rather sheepshaverprefs in the current working directory. I didn’t want to trash any other prefs.

I have to test again but I think this should work on 10.10 As I found out the hard way x8664 binaries can, so this is a 32bit only build, but I was running it with my SLiRP fixes ok on my macbook air. This hasn’t been extensively tested. I hate to even call it tested, I just copied a few MB of stuff over an NT server running AppleTalk,a nd viewed some flash video with Internet Explorer 5.1. I’m sure there are PLENTY of things broken. JIT should work with these binaries (Quake 1 is quite playable), but DOOM crashes hard (isn’t it a 68k binary?). DOOM runs ok on Basilisk II so does it matter? If you want speed, JIT + SLiRP is the way to go.

Since this is basically the same as the version I was using with BasiliskII I think it’s more stable than the generic version as I could at least run all kinds of programs with some of my fixes vs the ‘stock’ github version. I should add that I’ve been primarily testing with that PowerMac 9500 v1 ROM, along with MacOS 8.6. I found 8.0 and 8.1 too unstable, 7.x & 9.0.4 uninteresting. To get around the early crashing while booting 8.6, I rigged it to drop the first 30 packets. I’ve successfully booted 10/10 times, so I’m almost OK with that. I’d rather know when the OS is ok, and go with that, but I’m not sure. I thought about a timer, and say ignore the network for the first 30 seconds, and maybe that is the better way to go.

When you launch this you’ll see some message updating about packets and “wait for 30-” and a number once it reads “wait for 30-30”, the message will no longer update, and it’ll start to forward packets into the machine. You probably will have to disable and re-enable AppleTalk from the chooser to see the network (or I had to). You may have to get creative to generate the needed packets on your network to get it over 30, as those are packets received. Broadcast packets work too, so maybe you can work with that As long as Sheep Shaver isn’t alone something should be looking for other devices. Author Posted on Categories,. SheepShaver on Linux Only because people were asking for it. The first thing I did for Basilisk II was to get it building on Linux, so here we are.

I only tweaked the config process to let me build it with GCC 4.7.2. So this will be in the same effort of removing features, and trying to place in my SDL drivers, network and SCSI stuff. Im starting with, which is pretty old. But 700kb compressed is a good starting point. As you can see it boots MacOS 8.0 which is also good enough for me. The other questions will be, can this build under Windows with MinGW configured like this, and can it build with OS X. It looks like all the stuff is there so this may be kind of easy.

Basilisk Ii Re: B2-devel Fixes For Basilisk Ii And Sheepshaver For Mac

Also SheepShaver does something funky with it’s memory space, it does some direct mapping to the user area. I’ll have to see if I can disable that, performance be damned (well I turned off JIT as it won’t compile with 4.7 either) so this won’t be fast, but I’m just patching stuff up, not re-implementing the wheel here. Author Posted on Categories,. 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’, with 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 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. 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 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 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, so my horrific edits are open for the world to see Author Posted on Categories,.

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, and it doubled my throughput on the network to over 400K/sec! 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 I can now copy hundreds of MB worth of stuff from one AT server to another. What is also surprising is that by using for MacOS, I get speeds of around 1.0Mb/sec(with as high as 1.6!) 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.

Author Posted on Categories,. And personally I’ve never seen the appeal for such things, but apparently for the world of emulation accessing physical media is a big deal.

Of course what I didn’t think about was rescuing old machines by re-installing the OS under emulation, or copy protection. The first thing I looked for was a GPL project that has SCSI disk support and isn’t too complicated. The project sure fits that bill, is not even a thousand likes, and even better it works! The only two major hurdles I ran into is that the Mac is sending a page request of 0x30 which as far as I can find is not listed anywhere else. I ended up just making one up as a reply to see if it mattered. The other is that it’s scatter/gather based, so when it’s going to read or write several contiguous sectors, it’ll blast down up to 256kb worth of data to be read or written to.

The ability to know that a large operation was in progress was already in Previous, it just wasn’t set to loop. I guess the NeXT isn’t as aggressive, or it’s SG operations are better contained in the SCSI controller. The final hurdle was in the Apple partitioning software. I’ve been down this road a long while ago. But the disktools from A/UX 3.0.1 doesn’t care about vendors and will thankfully format anything. SCSI disk files So not as exciting as talking to a real SCSI disk, but it’s safer. I suspect that accessing a raw NT device name ought to work I can test that on VMWare, but the trick is finding something that can read HFS and prove it’s a good exercise.

Another ‘feature’ I put back in is the ability to disable the math coprocessor on the 68040. It feels more stable to rely on Apple’s old emulation code, but maybe that’s me. As always files for this are on. Author Posted on Categories,. Well I was shuffling files back and forth into, 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. 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 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, 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 page, which is thankfully still up. And there I found the and 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. Why not SDL 2.0? Well 2.0 is more about 3d space, and even to render a flat framebuffer.

Which is too heavy for me, so I’m sticking with 1.2. I took a bunch of code from, 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 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 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, 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 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 I used the 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.

Sheepshaver

Would seemingly crash the whole system within seconds with faults in SLiRP’s slirpselectfill, and slirpselectpoll 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! 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 installed they don’t get an error message, and I don’t have to maintain two builds. Nobody likes doing that kind of stuff. 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. Top 4 free alternatives to jarfix for mac. 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 1 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. The excellent capable emulator, now has working Ethernet support! The sad news is that it only supports the TUN/TAP interface. So Windows users are kind of left out in the fun. Shoebill + Ethernet Except, I’ve been here before with.

So I dusted off my source code, and injected it into Shoebill. The first issue I had was that SLiRP was rejecting all the inputted frames, because of invalid frame length. Even more weird is that ARP worked, and I could see the 10.0.2.2 and 10.0.2.3 virtual IP’s but TCP and UDP outbound wouldn’t work at all. It took me longer than it should have but although this code worked great with GCC 2.7 and 3.0, 4.x breaks it. And it’s the same reason why Shoebill originally didn’t work on Win32, the blasted packed structures! So adding the ‘-mno-ms-bitfields’ flag to GCC is all it took, and now I could ping 10.0.2.2 for about 5-7 pings until SLiRP would crash.

I tried all kinds of stuff trying to see if there was an issue with SLiRP, but I should have payed closer attention to the debugger, with all those threads flying around. It turns out Shoebill was trying to read & write a the same time, which caused SLiRP to crash as it is not re-entrant. I tried to place mutex’s on every SLiRP call but that ended up having SLiRP not process any packets.

Very strange. I then reduced it to where I read the frame out of SLiRP and pass it to Shoebill, and where Shoebill write’s a frame out the SLiRP. And much to my amazement I can run ‘worms’ just fine! So after a minute of worming and pinging I called it ‘good enough’ and rebuilt a production binary, and packaged up my source code. For anyone who want’s to play, my, and I am using is here. Author Posted on Categories,.

Good news, as, the Shoebill emulator was recently given some much needed SDL love, and ported to Linux. Well that’s great and all, but the vast majority of people who run anything these days do it with Windows. So I decided to try to get it to compile with MinGW to see how far I could get. And the short version is that I got it working! The long version is that in the first pass there is some SIGUSR2 stuff that is undefined. And for a good reason, since it won’t work. So I just commented them out.

The next minor problem was the lack of bzero. Honestly I don’t know why bzero is missing from MinGW, but who knows why. Shoebill also processes some internal macros with a perl script that for some reason was dropping in binary values into the source, making GCC mad.

I just commented out a line that was adding in more comments into the header. This let me compile with a simple pass. There was some issues reading the ROM file, since the 68000 is a BIG ENDIAN processor, and the 8086 is LITTLE ENDIAN, Shoebill makes extensive use of hotns and hotnl, ntohl, and ntohll. These can be found in the winsock library, and even better they dont need any winsock initialization, they work right away. I just have to make sure I include winsock2.h, and link against the winsock library. However when trying to boot, the checksum was 0x00000000, not the expected value! Luckily there was an assert to catch that and crash.

This led me to notice that in Linux files are opened in binary mode by default, while on Windows, they are opened in ASCII mode. A quick change of all the fopen calls, and I was reading the ROM, but now crashing on the disk.

As it turns out newer versions of GCC go all crazy when it comes to, and try to automatically align to boundaries for quick access. Which sound nice, until you try to read in some binary data, and expect things to be in certain locations and find out that your structure is larger than expected, and data is read in the wrong place. The solution is to force the compiler to leave it alone with attribute ((packed)) HOWEVER as luck would have it, Microsoft apparently packs structures a different way, and you have to either make a macro to do a bunch of work to force it to make the structure 1:1 of what you expect, or use the CFLAG option of -mno-ms-bitfields And now MinGW’s GCC will build something along the lines of what it’d build on Linux. Putting it all together, I amazingly got this! Shoebill on Windows Phew! So for those interested, here is , and here is. If you ever wanted to see the, now is your chance!

Basilisk ii re: b2-devel fixes for basilisk ii and sheepshaver for mac

Author Posted on Categories,.

Not sure where this goes exactly, but since I want to emulate a Macintosh Classic. Has anybody actually got a port of Basilik II running with the Classic emulation? I've tried under OS X 10.3 and 10.4 on a G3 PowerBook, G4 PowerBook and now an Intel MacBook and I'll be darned if I can figure out how to configure it to run with the Classic ROM. It starts up and then suddenly quits (and yes I know there is only one version that works with the Classic ROM). I would really like to get the Classic emulation running, so anyone with that setup working, would you please post your steps? Both Mini vMac and SheepShaver are far superior emulators, though Basilisk II does fill the hole between 7.5 and 8.5 which some vintage software requires (along with a 68030/40 processor). However, I am specifically interested in running the Classic emulation because I want to be able to access the embedded system in the ROM among other things.

That is one thing you can't do with a MacPlus. Just wanted to know if it was possible since I have never been able to get it to work and the documentation indicates it should be possible, but is not clear on the exact specifics. My impression is that Basilisk and Sheepshaver are very much on a par. Minivmac is better because it actually emulates the machine (so MacsBug etc runs), but the other two patch the ROM to avoid emulating various aspects of the hardware. Basilisk in particular seems to have gone downhill in its last few releases, but it still does a very nice job. I want to see minivmac develop to handle a Mac II - then hopefully a IIx or better.

Then it'll have 68030, 68881/2, colour, and support for up to System 7.5 and Basilisk will be much less necessary as a gap filler. I believe Basilisk used to handle Classic emulation, but the support for it has been broken. Try a google search - there was a reference on one of the Basilisk forums that mentioned what version could manage it. It is probably still available somewhere. Yes, I know what version of Basilisk II is supposed to run with Classic ROM, it is clearly stated on the developer's page and in download version notes. My point is I have never been able to get it to run, so was hoping someone was actually running it so I could compare notes.

I know Paul is working on Mini vMac for Mac II emulation, but 68030 is a long way off. There are other things that need to happen with Mini vMac too to make it a complete resource for managing old Macs on the Intel platform.

But for freeware, it's pretty nice. I myself will be putting up some tutorials for working with Mini vMac in the near future as I am a huge supporter of it.

DrBunsen wrote: Has anyone tried Softmac for Windows or Fusion PC for DOS? Fusion's only advantage is if you have a preference to run an emulator from DOS. Softmac's still in development, but I didn't see anything in earlier versions to recommend it over vMac or Basilisk. And I've got a bit of a grudge against Darek Mihocka since he went on a holier-than-though slam against another emulator author because he seemed to consider him competition. The other author's product, an Atari 8-bit emulator for the Mac, got my shareware payment. Eeun wrote: I don't recall Basilisk II working with anything less than a 32-bit clean rom, but mini vMac will boot System 6 with a Plus rom. Once you're running on modern computers that are able to run an emulator faster than the original, I don't see any advantage in using a particular Mac's rom, other than perhaps the novelty value of ogling the About This Macintosh splash.

Supposedly the development snapshots of MinivMac have some rudimentary MacII emulation support which will work with an SE/30 ROM. (However, it'll identify itself as a Mac II.) The only possible reason I could see for wanting to do this would be that running a II-series Mac with 24 bit addressing (like System 6) would allow 8MB of RAM vs. The 4MB the 68000 Plus/SE/Classic machines could address. (Although if that were important a better emulation target for vMac might be the Portable/Powerbook 100.) Although, really, if you're running something that needs more then 4MB you probably also want networking support, and that leads right down the slippery slope to Basalisk II and System 7.

Comments are closed.