So I started to look at the SCSI passthru on Basilisk

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 Previous project sure fits that bill, scsi.c 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

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 sourceforge.

14 thoughts on “So I started to look at the SCSI passthru on Basilisk

    • Sneaky! So they have a special mode added to the SCSI commands to return “APPLE COMPUTER, INC.”

      I’ll certainly add that bit of functionality!

      The only other thing is that with all my Windows / Linux testing I somehow broke libpcap on OS X….

  1. Fantastic, it works really well!

    Now the only thing that is missing is the passthru to host devices (HDD, CD/DVD burners, etc).

    While Scsi Passthru in old Basilisk versions was based in ASPI, there are already some bits to use NT SPTI built in implementation. Looks like Lauri started the implementation, but never finished it. There are some code to port from ASPI to SPTI and some hacks here and there.

    Source from old implementation is here:
    http://gwenole.beauchesne.online.fr/basilisk2/files/BasiliskII_jit_src_14022001.zip

    Check that the windows SCSI support bits are in the Windows subdirectory, under the name of windows_scsi.cpp.

    Would be so nice to be able to use CD burners and readers from basilisk again :-). Maybe would even be possible to backport your hard work to Shoebill again.

    • I need to score a DDK to talk to scsi devices.. I’m slowly working on it. I’ve been making previous’s SCSI disk play nicer with Basilisk and crash less often. I’ve also got it set to identify as an Apple disk so you can at least use the disk tools out of OS 8.

      I know two people are dying for MIDI support but once they can even say what application and how it all should tie together I haven’t even started on that. I’m slowly looking at the CPU.

  2. Yes, I second that! It would be fantastic to get rid of the dependency on cdenable.sys for CD access. And the possibility to implement this stuff in SheepShaver also is appealing.

    • What kind of CD’s do you guys access? I don’t even have an optical drive on my main machines, just an old machine I picked up from a junk dealer.

      So I guess I’d need to know what application and function…
      like jimbob’s magic cd maker and cd burning

      etc… I’d have to have some way to test something.

      • Well, Toast in OS7/8 is the only software that can image and burn correctly MacOS 9 (and minus) HFS and Hybrid Audio/HFS Data formated CD’s.

        Just take a tour to Macintosh garden or any Mac software preservation site. You will see how crippled and unaccurate are Toast Titanium for OSX+ and Disk utility are for such tasks.

        Is also the only way to make OS7/8 and 9 bootable CD images for emulators, even if you don’t use any of the other functions of the software.

        I’ll find a way so you can test CD passthru functionality with CDs in software only, wait a little.

        • test cases work the best. Like doing x with y, and what it should look like. The more I can do 100% in software the more likely it is. I know it’s kind of funny but I never used or liked Mac’s from this era so I’m like the worst person for sourcing this stuff since I did my best to not use a mac. I was a diehard MS-DOS / Unix guy. A/UX was a fun detour but I used it as a UNIX machine, with the occasional office app but I mostly had terminals open. I didn’t even use X11 on A/UX.

          But yeah even what software levels to do what is great I don’t know what should go with what… something like a 68030 XMb of ram, this kind of ROM, what OS, this application to do what. I haven’t seen any freebie CD-RW simulation sw, but I may be looking wrong. The first step of course is to read, as that is more documented, and I think the major differences from CD’s to HD’s it that CD’s typically have larger sector sizes, on reading although NeXT/SGI/Sun and probably Apple did this 512byte emulate HD mode to load up CD’s with a native RO filesystem instead of glorious ISO 9660.

  3. I didn’t forgot about the project, but i’m still preparing and testing a suitable software only environment for this.

    Also, would be easier to talk in realtime via IRC if you can.

    • where on IRC?

      I got the ethernet running super fast but something keeps causing the network stack to stall… fast or slow.

Leave a Reply to Howard Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.