SCSI2SD on QBUS PDP-11

Until recently I was using an MFM hard drive as the primary hard drive on my QBUS PDP-11 systems. Typically this would be an RD31 (ST-225) on an RQDX3 MSCP controller.

Over time, I am converting to using an 8GB microSDHC card as the primary hard drive. This is achieved by using a QBUS SCSI controller (either an Emulex UC07 or a CMD CQD220) connected to a V5.0a orV5.0b SCSI2SD board.

The SCSI2SD is configured using a PC-based application called “scsi2sd-util.exe”, with the SCSI2SD board connected to the PC via a USB cable.

The SCSI2SD firmware allows you to configure the SCSI2SD board to appear (on the SCSI bus) as up to 4 virtual devices. All these virtual devices are on the one microSDHC card. Each device can be a hard drive or a CDROM drive. You can’t drag-and-drop virtual hard drive files on to the microSDHC card, but you can import/export them from the card using the Linux “dd” command. When you configure the SCSI2SD card, you tell the firmware where each device starts on the microSDHC card, and the length of the device. Knowing these parameters, it is easy to use the “dd” command to import and export virtual hard drive (or CDROM) images.

The “standard” memory map that I am using for the SCSI2SD (with an 8GB microSDHC card) is as follows (the values in square brackets are for use with the “dd” command’s skip, seek and count options):

Device DU0: Up to 256M (524,288 [or 512K] sectors, starting at sector 0 on the card)

Moving DU disk files between SIMH and the SCSI2SD microSDHC card

I’ve found that virtual files for DU drives in SIMH can be transferred directly to/from the microSDHC card, without the need for any manipulation. I use “WinSCP” or “FileZilla” to transfer the SIMH files from my Windows laptop (where I run SIMH) to a HP N40L Microserver (where I do most of my Linux work). I do the transfers between the Linux box and the microSDHC card using the Linux “dd” command, with the microSDHC card plugged into a USB-to-microSDHC card reader.

Before plugging the microSDHC card into the Linux box, I use the following command to list the existing hard drives and partitions that make up the Linux system:

We can now use the “dd” command to transfer individual virtual disk files (each one corresponding to a particular DU device). Extreme care needs to be taken here, as you can very easily trash your microSDHC card (or the main hard drive in your Linux system!) by any miscalculation or typo.

Some notable things about the dd command:

“bs” is the block size. We set this to 512 bytes, as this is the standard DEC sector length

“skip” is the number of blocks of the input file to skip past, before reading the input file

“seek” is the number of blocks of the output file to seek past, before writing to the output file

“count” is the maximum number of blocks to read or write

“conv=fdatasync” ensures the data actually gets written to the SD card

IMPORTANT NOTE: Sometimes dd will work without the “conv=fdatasyn” switch, other times it will silently fail. I recommend using it all the time when reading or writing SD cards with the dd command. Without this switch, sometimes only partial data gets written to the card. You can see this by reading back from the SD card (after writing) using the dd command again, then examining the resultant file with the “xxd” command.

Writing files to the microSDHC card

For the sake of this example, let’s say we want to transfer the following virtual disk files (perhaps created in SIMH) to the microSDHC card:

Note: I’ve not been able to positively confirm the number of cylinders that the RD54 has. Perhaps the best guide is Maxtor’s Product Specification and OEM manual. The calculations shown in Section 1.2.3 of that document confirms the cylinder count (1224) and total sector count (312,120) that I have outlined above. However, when you read Section 7.1 carefully, it suggests the drive may have up to 1226 (or 1227?) cylinders of usable space. At some point I need to look carefully at the SIMH source code, to determine how many total cylinders (including any that are set aside for bad block replacements, etc) SIMH uses for the RD54.