You might want to look at sim_disk.c’s file system recognition logic.  John Forecast wrote the logic which walks through the data to determine the interleave and sector size (as I recall).

 

From: Robert Armstrong <bob@jfcl.com>
Sent: Thursday, December 28, 2023 1:39 PM
To: 'The Hobbyist DECnet mailing list' <hecnet@lists.dfupdate.se>
Subject: [HECnet] Sector interleave for RX01/2

 

  Ok, this is a long shot, but does anybody know the algorithm used by the VMS (and presumably RSX) RX01/RX02 driver for interleaving sectors?

 

  More specifically, logical blocks on VMS are always 512 bytes but RX01 sectors are 128 bytes and RX02 sectors are 256.  So each logical block consists of 4 RX01 sectors or 2 RX02 sectors.  I’m presuming these sectors are not contiguous, but rather the device driver uses some kind of interleave to minimize the rotational delays.  What exactly is that algorithm?

 

  Or even more detail, I have a bunch of RX01 and RX02 image files (as VMS disk files) that were created using a program that dumps consecutive VMS logical blocks (using SYS$QIOW(…IO$_READLBLK,…).  This works great for things where the logical to physical translation is hidden from the OS (like all MSCP drives) for RX drives that’s not the case.   I need to figure out how to unscramble the 512 byte blocks in my VMS file to re-create the original sectors.

 

  And no, I don’t have access to the actual diskettes to dump them again.   Shouldn’t matter – the data is in the file, I just have to figure out the correct bit shuffling to get it back in the right order.  I guess if I get really desperate I’ll try to find the source listings for the drivers, but I’m hoping somebody just knows.

 

Bob