• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

SCSI2SD V3 hard drive and CD-ROM simultaneously

dougg3

Well-known member
I built some SCSI2SD V3 boards way back in 2014. I've just been using old firmware from 2014 without any issues, but I noticed that at some point SCSI2SD added the capability to emulate 4 devices at a time, including CD drives. Very cool!

I upgraded to the latest firmware (4.8.04 as of today) and tested out the CD-ROM emulation. It worked great for the most part. Just had to use dd to copy an ISO to the correct offset on the SD card. It allowed me to boot from the Apple Legacy Recovery CD in my LC 475 and install to a hard drive also emulated by the same SCSI2SD.

I'm running into a small problem though. If I have the CD-ROM emulation enabled, it seems to always win during the boot process for some reason. I notice the Mac shows the flashing question mark for a brief moment and then it boots from the CD. Furthermore, the Legacy CD doesn't mount any of the emulated hard drives. Drive Setup shows them, but says they aren't mounted. If I format them in Drive Setup, then they will mount. So it's not really a huge problem since I'm using the Legacy CD to do an initial install, but it's kind of annoying that I can't leave the CD drive enabled.

I found that if I set the SCSI2SD's startup delay setting to 10 seconds, then it does properly boot from the emulated hard drive instead. It even recognizes the CD drive and mounts it too. But then if I reboot the Mac, it goes back to always favoring the CD drive and never mounting the hard drive. Which I guess makes sense because the SCSI2SD is no longer rebooting and redoing the startup delay.

Is there some kind of timing issue going on here? Anyone else seen this problem? I can say it's not caused by the Startup Disk control panel setting -- I always double check to make sure it's set correctly after installing. I've played with a bunch of settings in the SCSI2SD utility but the only thing that seemed to change the behavior was the startup delay. And yes, I have the termination resistor packs installed on the SCSI2SD.

I have two emulated hard drives configured as SCSI IDs 0 and 1, with 0 being my boot drive. The CD is set as ID 3.

Thanks for any advice!
 
Last edited:

dougg3

Well-known member
In my Centris 610, I tried plugging in two of my SCSI2SD V3 devices. One dedicated as a single hard drive, one dedicated as a CD-ROM drive. I see similar behavior, but it's a bit different. On a cold power cycle, it always chooses the CD (and the hard drive doesn't show up on the desktop). If I reboot, then it boots from the hard drive. I tried setting the CD drive to have a 10 second startup delay in scsi2sd-util and interestingly, that actually causes the Mac to freeze while it's booting from the hard drive. Anyway, based on that result I don't think this is caused by the multiple device emulation.

On my LC 475, with a single SCSI2SD V3 configured as two hard drives and a CD-ROM, it always boots from the CD and the hard drives don't show up on the desktop. If I reboot, it fails to boot at all. I can see the activity light blinking as the flashing question marks shows up on the screen but for some reason it's just not trying to boot again. Maybe the CD got ejected and for some reason the Mac just isn't looking for the hard drive at all. Dunno...I even rebuilt the V3 firmware with this patch applied. That did seem to fix a different issue I was seeing where the CD wouldn't work after a reboot, but it's still behaving weirdly.

This really isn't much of an issue though, in all honesty. It's probably just some silly timing issue between what Macs expect from actual hardware and what SCSI2SD provides. I wouldn't want to use CD images that often anyway, at least not with the SCSI2SD. Mainly just during initial install. So I think it's fine to just leave it disabled in scsi2sd-util until I need it (like for a reinstall).

Seems like a CD emulator would be more useful as something more like Floppy Emu where you could have a screen with buttons to pick from multiple ISOs on the SD card...
 
Last edited:

mg.man

Well-known member
Perhaps a dumb question... but have you used the "Startup Disk" Control panel to set which 'drive' to start from? I believe it saves something in PRAM? If you're getting the disk with flashing "?" - it may not be set? Also (might be failing memory here?) but I think if nothing is set, the boot process starts from the highest SCSI ID and works down? What are your IDs set to? Lastly, have you tried the "System Picker" App?

 

dougg3

Well-known member
have you used the "Startup Disk" Control panel to set which 'drive' to start from? I believe it saves something in PRAM?

Yep, I've selected the hard drive (ID 0) as the startup disk in the control panel. I think it's a deeper problem than that though. After it boots from the CD (ID 3), the hard drive doesn't even show up on the desktop. When I go into Drive Setup, it shows the drive with the correct SCSI ID but says it's "Not Mounted". If I erase the drive with Drive Setup, then it magically shows up on the desktop -- until I reboot.

It's like the Mac is just completely ignoring the hard drive...but only if I have a SCSI2SD CD-ROM drive in the mix. As soon as I disable the CD drive, everything is fine. Either by disabling it in scsi2sd-util if it's part of the same SCSI2SD device, or by removing it from the bus if it's a separate SCSI2SD.

Lastly, have you tried the "System Picker" App?

Haven't tried it, but I feel like it's a deeper issue if the hard drive isn't even mounting on the desktop when it boots from CD. So weird...
 

cheesestraws

Well-known member
When I go into Drive Setup, it shows the drive with the correct SCSI ID but says it's "Not Mounted". If I erase the drive with Drive Setup, then it magically shows up on the desktop -- until I reboot.

What happens if you use something like Mt. Everything to forcibly mount the drive? This sounds like a driver issue to me...
 

dougg3

Well-known member
What happens if you use something like Mt. Everything to forcibly mount the drive? This sounds like a driver issue to me...

I'm guessing that will work fine to mount it, but I can definitely try it later today. I used Drive Setup 1.7.3 to format it -- I have it configured so that the stock Apple utilities can use it. Maybe I should try something else like Apple HD SC Setup or Lido instead?

It's just weird that once I take the CD out of the mix, everything boots and mounts fine. Even multiple hard drives on the same SCSI2SD...
 

cheesestraws

Well-known member
Yeah, I'd try using a different driver on the HD - does this also happen when booting from a newer CD than the legacy recovery one?
 

bigmessowires

Well-known member
Seems like a CD emulator would be more useful as something more like Floppy Emu where you could have a screen with buttons to pick from multiple ISOs on the SD card...
The latest Floppy Emu firmware does have CD emulation, but you'd need an HD20-capable Mac, and it's like 1x CD-ROM speeds.

Considering the tests you did in your second post, I kind of doubt this is a problem with the Startup Disk or driver. It seems more like the SCSI2SD is not ready or does not respond as expected during some critical moment during startup when the Mac polls the SCSI bus. Maybe there's something happening with the CD-ROM emulation that requires a substantial amount of time to initialize when SCSI2SD is first powered-on, and it causes SCSI communication to time out?

In my Centris 610, I tried plugging in two of my SCSI2SD V3 devices. One dedicated as a single hard drive, one dedicated as a CD-ROM drive. I see similar behavior, but it's a bit different. On a cold power cycle, it always chooses the CD (and the hard drive doesn't show up on the desktop). If I reboot, then it boots from the hard drive. I tried setting the CD drive to have a 10 second startup delay in scsi2sd-util and interestingly, that actually causes the Mac to freeze while it's booting from the hard drive.
Could you try renumbering the SCSI devices and see what happens? Make the CD-ROM be ID 0, and the hard disk ID 3? See if the behaviors change?

Putting everything together, it seems like maybe when a SCSI2SD with CD-ROM emulation is first initialized or reset, or maybe when it's first queried, it causes a momentary glitch on the SCSI bus. If the Mac was polling for other SCSI devices at this time, it won't find them. If the Mac was actively booting from other SCSI devices at this time, it will freeze or crash. Just a theory based on your results; I'm not very familiar with low-level SCSI behaviors.

Does SCSI2SD write a log file or have a debugging output?
 

dougg3

Well-known member
Thank you all for your suggestions/ideas. I'm doing all these tests on my 475 with a single SCSI2SD device (ID 0 = hard drive, ID 3 = CD) so I can just focus on one thing at a time. Hopefully this isn't too crazy of an info dump. TL;DR:
  • I tried multiple bootable CD images and they all had the same problem.
  • Drive Setup 1.7.3's driver appears to not be happy with a SCSI2SD hard drive + CD drive combo. It always boots from the CD, and the hard drive doesn't show up.
    • Mt. Everything will mount the hard drive if I stop unit, start unit, then mount.
  • Apple HD Setup 7.3.5's driver boots correctly from the hard drive after a cold boot (and also boots from the CD if you hold the C key), but the SCSI2SD gets hung up after a reboot.
  • Drive Setup 1.3's driver works fine, both from a cold boot and a reboot. The only issue I've observed is if I boot from the CD with the C key and then reboot again, the SCSI2SD gets hung up.
  • SCSI2SD doesn't like the automatic "we have to be in 32-bit mode" reboot that Mac OS 7.6+ does at startup if it's in 24-bit mode, at least when it's booting from a CD. It hangs afterward, unless I apply this patch from the SCSI2SD V6 firmware that was never released for V3/4/5. The patch fixes that particular reboot issue, but it doesn't fix the reboot issues described in the above two bullet points.
  • I've seen a few 0000000F, 00000001 Sad Macs with the Drive Setup 1.3 driver when I reboot after booting from the hard drive and then hold the C key. Seems to be pretty rare, but I wasn't seeing this until I started messing with the 1.3 driver. Who knows, maybe I have some bad RAM or something.
  • Although it's super awesome that Drive Setup 1.3 seems to be the magic combination that works for what I need, I can't help but think that there's some kind of subtle bug in SCSI2SD that's at the root of this. It's not like everyone with physical hard drives and CD-ROM drives ran into this problem with the other drivers...
More detailed responses below:

What happens if you use something like Mt. Everything to forcibly mount the drive? This sounds like a driver issue to me...

Mt. Everything sees the hard drive, but it won't mount it unless I click Stop Unit, then Start Unit, and then Mount. If I just click Mount on its own, nothing happens. That probably explains why Mac OS isn't mounting it automatically...

I've tried to experiment more with the start/stop unit stuff, like leaving it stopped and then rebooting, but it seems that it doesn't like me to leave the unmounted hard drive in a stopped state even though I'm not booted from it and it's not mounted. It crashes the system as soon as I close the control panel if I do that. I'm also struggling with Mt. Everything occasionally telling me that I can't keep it open because it's out of RAM, which often leads to a system error. I don't know what's going on there...but I do have more RAM on the way because it currently has a measly 8 MB.

does this also happen when booting from a newer CD than the legacy recovery one?

After playing roulette with broken Macintosh Garden and WinWorldPC ISOs, I finally found a physical Mac OS 8 CD I had on hand and dumped it myself in order to get something to work. WTF is wrong with all of these CD images out there? That is so incredibly frustrating...holy cow. That really grinds my gears. I downloaded three separate ISOs and they were all garbage for me. Using the "file" command to inspect them, it's clear that all three of them weren't dumped correctly.

Anyway, I'm seeing the exact same problem with a Mac OS 8 install CD inserted into the virtual SCSI2SD drive instead. It boots from the CD and the hard drive doesn't appear on the desktop. I was actually able to exit Mt. Everything with the hard drive in a "stopped" state once while booted from this ISO and I can confirm it still doesn't boot from the hard drive after a reboot in that case.

If I boot from the Mac OS 8 CD, use Mt. Everything to force the hard drive to be mounted, then make sure it's selected in the Startup Disk control panel (it already is), and reboot, it never boots from the hard drive. In that case it doesn't boot from the CD drive either. It just sits at the blinking question mark as I watch the SCSI2SD activity LED flash briefly every half second or so.

I just realized this CD is older than the legacy recovery CD...oh well. It was still interesting to try this one.

Yeah, I'd try using a different driver on the HD

Oh, that's an interesting idea! I opened up Apple HD SC Setup 7.3.5 and clicked Update to update the driver. With that driver, it always boots from the hard drive on a cold boot! The CD also shows up on the desktop. This is observed with both the legacy CD and the Mac OS 8 CD inserted. I can even hold down the C key to boot from the CD instead, and the hard drive still shows up.

But if I reboot, it falls back to the behavior I see with the Drive Setup 1.7.3 driver after a reboot. It sits there with the blinking question mark, and I see the SCSI2SD activity LED blink every half second or so. It never boots, even though there are two bootable devices inserted.

I also just realized that Drive Setup 1.3 from the Mac OS 8 CD also has a driver that works fine. Not only that, but the Drive Setup 1.3 driver also works properly on reboots. So this is the magic incantation that I can use! Drive Setup 1.3's driver works fine with no problems. Thank you @cheesestraws! I had no idea the drivers could be that different in behavior.

Well, I guess there's still one problem. If I boot from the CD using the C key, and then reboot again, it gets stuck at the blinking question mark with the SCSI2SD activity LED blinking. That's a pretty minor issue though.

I'm really thinking there is some kind of sneaky SCSI2SD code bug contributing to this behavior in general, but I don't even know where to begin to look. I'm tempted to buy a ZuluSCSI to see if it has the same problem since I know there is some code ancestry there.

Maybe there's something happening with the CD-ROM emulation that requires a substantial amount of time to initialize when SCSI2SD is first powered-on, and it causes SCSI communication to time out?

I was wondering about something like that myself, but from a quick glance at the SCSI2SD v5 and below source code, it seems like CD-ROM emulation entails enabling a few extra responses to some CD-only commands and changing the existing responses in a few other places.

Could you try renumbering the SCSI devices and see what happens? Make the CD-ROM be ID 0, and the hard disk ID 3? See if the behaviors change?

Ha, it does change! Going back to the Drive Setup 1.7.3 driver I was originally using for this test though...

As a quick recap, with the CD-ROM as 3 and the hard drive as 0, we see the problem I mentioned originally -- it boots from the CD and the hard drive never shows up on the desktop. With the CD-ROM as 0 and the hard drive as 3, it boots from the CD, but the hard drive also shows up on the desktop. I notice with the CD-ROM being ID 0, it ends up as the default boot device in Startup Disk with fresh PRAM, which I guess makes sense because ID 0 will probably be favored for that. I didn't redo this test with the other drivers, by the way...

Does SCSI2SD write a log file or have a debugging output?

I think there's some kind of way to turn on debugging stuff, but I honestly haven't spent enough time in the codebase to tinker.

Whew. I think Drive Setup 1.3's driver puts me in a good position where I will be good to go. If I had infinite time, I would really spend a bunch of it tinkering with SCSI2SD trying to track down what the deal is. Like I said, this might be a good time to try buying a ZuluSCSI and see if the behavior is any different. Thank you all again!
 
Last edited:

Phipli

Well-known member

bigmessowires

Well-known member
After playing roulette with broken Macintosh Garden and WinWorldPC ISOs, I finally found a physical Mac OS 8 CD I had on hand and dumped it myself in order to get something to work. WTF is wrong with all of these CD images out there? That is so incredibly frustrating...holy cow. That really grinds my gears. I downloaded three separate ISOs and they were all garbage for me. Using the "file" command to inspect them, it's clear that all three of them weren't dumped correctly.
I'm curious, did you look at the first couple of sectors and could you tell what was wrong with them? When I was playing with this recently, it seemed about 50/50 whether a "CD-ROM image" from Macintosh Garden would be a device image with a partition map, or just an HFS volume image.

Although it's super awesome that Drive Setup 1.3 seems to be the magic combination that works for what I need, I can't help but think that there's some kind of subtle bug in SCSI2SD that's at the root of this. It's not like everyone with physical hard drives and CD-ROM drives ran into this problem with the other drivers...
Yes. My guess is there's a subtle timing-related problem - maybe if SCSI commands reach the SCSI2SD at a "bad" time, because it's busy or it just finished another operation or it just changed some I/O pin directions or some other factor - then a SCSI error results. By switching drivers, renumbering SCSI IDs, or rebooting, you're slightly changing the pattern and timing of SCSI accesses that will happen during startup. I wonder if it's actually related to CD emulation, or if any SCSI2SD setup with multiple emulated SCSI drives would have the same issue. You could try emulating four hard drives and see if something similar happens.
 

Arbee

Well-known member
I think it's something with Drive Setup 1.7.3's driver.

I set up a virtual LC475 in MAME with 16 MB of RAM, blank 250 meg HDDs on SCSI IDs 0 and 1, and a CD-ROM with Legacy Recovery on SCSI ID 3. Legacy Recovery booted as expected. I formatted both drives with Drive Setup 1.7.3, installed 7.6.1 on the first drive (ID 0), and shut down the emulated machine completely. I then started it back up in the same configuration and it booted the CD-ROM. The two HDDs didn't appear on the desktop and showed as "Not Mounted" in Drive Setup.

I redid the test (starting from completely blank HDDs again, of course) but with Drive Setup 1.5 and afterwards the installed system on the hard disk booted and both HDDs and the CD appeared on the desktop.
 

Arbee

Well-known member
Bonus test: after the test with Drive Setup 1.7.3, when it booted Legacy Recovery I ran Drive Setup 1.5, updated the driver on both HDDs, and when I restarted it booted the System from the HDD and everything was fine.
 

dougg3

Well-known member
So there were some 610 oddities.

Ahh, interesting! Thanks for sharing.

I'm curious, did you look at the first couple of sectors and could you tell what was wrong with them?

Essentially, yes. I believe that's basically what the file command is doing, so I didn't bother looking in detail. Here's one that wouldn't boot my 475:

$ file Mac\ OS\ 8.1.toast
Mac OS 8.1.toast: Apple Driver Map, blocksize 512, blockcount 738458, devtype 1, devid 1, driver count 0, contains[@0x200]: Apple Partition Map, map block count 2, start block 1, block count 2, name MRKS, type Apple_partition_map, valid, allocated, readable, contains[@0x400]: Apple Partition Map, map block count 2, start block 37, block count 738421, name Toast 3.5.7 Partition, type Apple_HFS, valid, allocated, readable

Same with this one:

$ file Apple\ MacOS\ 8.0\ \(m68k\).iso
Apple MacOS 8.0 (m68k).iso: Macintosh HFS data (mounted) block size: 5632, number of blocks: -5960, volume name: Mac OS 8

The CD image I made from a physical CD with dd and /dev/cdrom on Linux looks like this and worked fine:

$ file MacOS8.iso
MacOS8.iso: Apple Driver Map, blocksize 2048, blockcount 2118143, devtype 1, devid 1, driver count 4, contains[@0x200]: Apple Partition Map, map block count 9, start block 1, block count 63, name Apple, type Apple_partition_map, valid, allocated, in use, readable, writable, contains[@0x400]: Apple Partition Map, map block count 9, start block 64, block count 56, name Macintosh, type Apple_Driver43, processor 68000, boot arguments ptDR, valid, allocated, in use, has boot info, readable, writable, pic boot code, real driver, contains[@0x600]: Apple Partition Map, map block count 9, start block 120, block count 76, name Macintosh, type Apple_Driver43, processor 68000, valid, allocated, in use, has boot info, readable, writable, pic boot code, real driver, chain driver, contains[@0x800]: Apple Partition Map, map block count 9, start block 49, block count 25, name Macintosh, type Apple_Driver43_CD, processor 68000, boot arguments CDvr, valid, allocated, in use, has boot info, readable, writable, pic boot code, real driver, chain driver, contains[@0xA00]: Apple Partition Map, map block count 9, start block 296, block count 56, name Macintosh, type Apple_Driver_ATAPI, processor 68000, boot arguments ptDR, valid, allocated, in use, has boot info, readable, writable, pic boot code, real driver, contains[@0xC00]: Apple Partition Map, map block count 9, start block 352, block count 100, name Macintosh, type Apple_Driver_ATAPI, processor 68000, boot arguments ATPI, valid, allocated, in use, has boot info, readable, writable, pic boot code, real driver, chain driver, contains[@0xE00]: Apple Partition Map, map block count 9, start block 452, block count 512, name Patch Partition, type Apple_Patches, contains[@0x1000]: Apple Partition Map, map block count 9, start block 964, block count 655360, name untitled, type Apple_HFS, valid, allocated, in use, has boot info, readable, pic boot code, real driver, chain driver, mount at startup, is the startup partition

Yes. My guess is there's a subtle timing-related problem

I definitely had the same thought, but Arbee has uncovered that the driver from Drive Setup 1.7.3 is super suspect in this since it affects MAME too. I would assume MAME and SCSI2SD respond way faster than real hard drives and CD drives at startup. I might need to dig up some physical hard drives and a CD drive and try to replicate this all on hardware. I have a feeling that physical drives are slow enough that they don't experience this issue. After all, adding the 10 second startup delay on the SCSI2SD fixes the issue on cold boots. I wonder if there's any old tech info out there saying to avoid Drive Setup 1.7.3...I feel like it would have been common knowledge if it affected real hardware back in the day.

You could try emulating four hard drives and see if something similar happens.

I may do this later for completeness...

I think it's something with Drive Setup 1.7.3's driver.

Nice tests! Thank you! You're seeing exactly what I am seeing on hardware with SCSI2SD. I think it's amazing that you were able to reproduce this in MAME. I'm impressed; we're really seeing the benefit of all of the hard work you've put into MAME.

I can't use MAME in my Linux VM running in VMware Workstation because the mouse pointer just goes insane and bounces all over the place in the emulated Mac when I move it, so it's unusable. Is that a known issue? Looks like if I run MAME on Windows instead it's fine, so I'll just do that instead for now.

In the first test with Drive Setup 1.7.3 and IDs 0, 1, and 3, what happens if you reboot the system after it boots from the CD? Does it just boot from the CD again? Still with no hard drives on the desktop? The SCSI2SD hangs up when I reboot after having booted from the CD, and I get the flashing question mark instead. I am pretty sure that really is a SCSI2SD bug. I guess I can just test it myself in MAME now instead!
 

dougg3

Well-known member
Also, how did you add a SCSI CD-ROM with ID 3, @Arbee? For some reason it looks like MAME allows me to add every ID other than 3...

Edit: Ahh, I see, it looks like I somehow ended up with ID 3 already being a CD drive by default, nevermind.

Edit 2: It looks like rebooting after having already booted from the CD drive in MAME causes the system to hang, I never even hear the boot chime. So it doesn't get quite as far as my hardware gets. But yeah, I reproduced it in MAME too...very very interesting!

Edit 3: Yes, I can confirm that updating the driver using Drive Setup 1.5 fixes it on MAME. That's so crazy!
 
Last edited:

mg.man

Well-known member
@dougg3 @Arbee - great testing / sleuthing guys! Really interesting reading and glad @dougg3's made progress! I'm wondering, though, if at least some of the (older driver) scenarios where the CD boots first regardless of SCSI ID / Startup Disk settings may actually be by design? IIRC, weren't there some scenarios where a CD came with instructions to 'insert CD and reboot your Mac'? I can think of some situations where this behaviour might be desirable.

Question... when did Apple introduce the "hold the 'C' key to boot from CD"? Could it be that in the early days that the HD driver looked for a "ready" (already loaded CD) drive on ID '3' and, if true, tried to boot from it first? I wonder what would happen if the SCSI2SD CD ID was set to other than '3' in the above scenarios?

Of course, the above would not explain the 1.7.3 behaviour, and it certainly sounds like timing is a factor too. I'm just curious if some of the above may be by design...? :unsure:
 

Phipli

Well-known member
I'm wondering, though, if at least some of the (older driver) scenarios where the CD boots first regardless of SCSI ID / Startup Disk settings may actually be by design? IIRC, weren't there some scenarios where a CD came with instructions to 'insert CD and reboot your Mac'? I can think of some situations where this behaviour might be desirable.
There were some macs that would ALWAYs boot from an installer CD if one was in the drives. Others that wouldn't even if you held down c (but would with cmd-shift-del).

I must have missed it, but didn't think this thread was about that?
 

Phipli

Well-known member
Question... when did Apple introduce the "hold the 'C' key to boot from CD"? Could it be that in the early days that the HD driver looked for a "ready" (already loaded CD) drive on ID '3' and, if true, tried to boot from it first?
Earlier than you'd expect. Even the IIci does it and I think the IIx.
I wonder what would happen if the SCSI2SD CD ID was set to other than '3' in the above scenarios?
I think it still boots from any CD drive it finds (that is an apple one)
 
Top