• Please review our updated Terms and Rules here

Utility for reading RT-11 disk images

kgober

Veteran Member
Joined
Mar 19, 2017
Messages
626
Location
New Jersey, USA
Some months back, someone on reddit needed assistance recovering data from an RT-11 RL02 cartridge they had accidentally clobbered. I happened to have a program that could read RT-11 disk images and was able to offer a little bit of help, and it occurred to me at that point that it would be a good idea to share such a utility, except that the code needed a lot of cleanup first. That code is still not cleaned up.

However, I've written a new program that does most of what the old one did, in a more interactive style, and it's not code I'd be embarrassed to let other people see. I've just posted it at https://github.com/kgober/FSX

This utility lets you 'mount' a disk image, and then once it's mounted you can get a directory listing, or view or save files. If the disk image contains files that are themselves disk images, you can mount those too. For example:
Code:
FSX>mount DVD RT11DV10.ISO
DVD: = C:\Users\kgober\Personal\Emulators\PDP-11\RT-11 Disk Images\RT11DV10.ISO [RT11]

FSX>dir DVD:rtv2*
 19-Aug-2019
 System ID: DECRT11A     V05
 Volume ID: RT Dist V1-0
 Owner    : RK05 / RL02
RTV2R1.B     996P 01-May-1975    RTV2R1.C    1492P 20-Nov-1975
RTV2RK.B     844P 01-May-1975    RTV2RK.C    1228P 20-Nov-1975
< UNUSED >     0                 < UNUSED >     0
< UNUSED >     0                 < UNUSED >     0
< UNUSED >     0                 < UNUSED >     0
< UNUSED >     0                 < UNUSED >     0
< UNUSED >     0                 < UNUSED >     0
 4 Files, 4560 Blocks
 0 Free blocks

FSX>mount RTV2 DVD:RTV2R1.C
RTV2: = DVD:RTV2R1.C [-1KB] [RT11]

FSX>dir RTV2:
 19-Aug-2019
RTV213.C     494P 20-Nov-1975    RTV223.C     494P 20-Nov-1975
RTV233.C     494P 20-Nov-1975
 3 Files, 1482 Blocks
 0 Free blocks

FSX>RTV2:

FSX>mount d1 rtv213.c
d1: = RTV2:RTV213.C [C=4x494@0] [RT11]

FSX>save d1: rtv2-1.rx01
d1: => rtv2-1.rx01

FSX>dir d1:
 19-Aug-2019
MONITR.SYS    46  20-Nov-1975    DXMNFB.SYS    58  20-Nov-1975
DP    .SYS     2  20-Nov-1975    RK    .SYS     2  20-Nov-1975
RF    .SYS     2  20-Nov-1975    TT    .SYS     2  20-Nov-1975
LP    .SYS     2  20-Nov-1975    BA    .SYS     7  20-Nov-1975
SYSMAC.SML    18  20-Nov-1975    SYSMAC.8K     25  20-Nov-1975
BATCH .SAV    25  20-Nov-1975    EDIT  .SAV    19  20-Nov-1975
MACRO .SAV    31  20-Nov-1975    ASEMBL.SAV    21  20-Nov-1975
EXPAND.SAV    12  20-Nov-1975    CREF  .SAV     5  20-Nov-1975
LINK  .SAV    25  20-Nov-1975    LIBR  .SAV    15  05-Dec-1975
PIP   .SAV    14  20-Nov-1975    PATCH .SAV     5  20-Nov-1975
ODT   .OBJ     9  20-Nov-1975    VTHDLR.OBJ     8  20-Nov-1975
DEMOFG.MAC     5  20-Nov-1975    DEMOBG.MAC     4  20-Nov-1975
< UNUSED >   118
 24 Files, 362 Blocks
 118 Free blocks

FSX>type d1:demofg.mac
        .NLIST
; COPYRIGHT (C) 1974,1975
;
; DIGITAL EQUIPMENT CORPORATION
; MAYNARD, MASSACHUSETTS 01754
(remainder removed)
A disk image can be saved from within the utility, in SIMH format. This is useful if you have a logical block image of an RX01 floppy (a sequence of 512-byte blocks) and you want to save it in physical sector format (128-byte sectors, track 0 not used, with the appropriate interleave and skew expected by the DEC RX01 device driver). When mounting an RT-11 floppy image, the utility tries to figure out whether the image needs interleave applied or not, so it works for both physical diskette images as well as logical block images. While converting disk images to SIMH format wasn't the primary purpose this utility was made for, it's probably its most useful feature right now.

I haven't packaged a GitHub 'release' for this utility yet, but there's a pre-compiled EXE in the bin folder if you don't want to compile this yourself. It's written using Visual Studio 2005 so it should work on anything from WinXP up (although on WinXP you may need to install .NET Framework 2.0 if you haven't already).

The utility is intended to support multiple file system formats, but currently only RT-11 and Commodore DOS (e.g. CBM 2040/4040/8050/8250/1541 format) are implemented (and the CBMDOS support is currently incomplete).

I am considering adding Files-11 support next. Possibly support for ISO-9660 and ZIP archives; currently only .gz and ImageDisk .IMD files are supported, as well as any kind of raw block/sector image file. The example above shows an ISO file being mounted, but that's only because it's specially formatted to be accessible as an RT-11 volume. I have some MS-DOS 1.0 FAT12 code I plan to import at some point. I would be willing to add CP/M support if I had some CP/M disk images to play with.

I'd like to add the ability to delete/rename/add files in an image but of course writing to an image is a lot more work than reading one, so for now this is what you get.
 
I have been working on a Windows GUI program that can read OS/8, ADSS, and LAPS/DIAL SIMH disk and DECtape images. It is far from finished, but getting better and useful.
 
Not necessarily, it can probably build under .NET Core and then run on Mac and Linux too. Lots of things can and Core is only getting better with each release. I just tried to build it as such, however, it might stand a better chance of building if the missing file Files11.cs was provided.
 
Just building the existing solution on 4.7.2 at the moment, I will try Core later. Got it to build by dropping the red herring Files11.cs from the project. Then needed to wrap the logical drives check to catch IOException so it would not chuck a wobbly on my logical device D: (DVD drive) not being ready. Now it's progressed to the FSX> prompt.

EDIT
Builds and appears to run on .NET Core 3.0 without dramas, I can replicate the OP's commands above. I suppose I could test it on Linux now.
 
Last edited:
Sorry about leaving Files11.cs out, it was empty so I figured I could leave it out. I forgot it would still be listed in the project file.

It's a command-line program so it should be easily moved to .NET platforms other than Windows, but if you do so you will probably want to update HostFS.cs, to change the format of host directory listings if nothing else. Rather than using the same directory listing format for every file system, I try to display each directory in its 'native' format, as near as I can manage. So RT-11 directory listings show up the way RT-11 would have displayed them, for example. Since I use Windows, HostFS directories display the same way "DIR" would in a Windows Command Prompt window.

Also, "not ashamed to share" does not mean "finished". There are a lot of things missing still, like exception handling. Certain typos will cause FSX to crash right now.
 
In the last couple of days I've filled the gaps in the CBMDOS support, added basic support for Unix v5 file systems, and I've started work on Files-11 (aka ODS-1) volumes.

The Unix v5 support will work for Unix v6 volumes as well, as long as you don't try to read any files larger than 917504 bytes. Full support for Unix v6 and v7 will come in the future, and probably BSD file systems as well.

For Files-11 volumes, right now you can only get simple directory listings and change directories. File reading/saving will be added soon. I'm working from the June 1975 spec now and will look for changes in the June 1977, April 1981 and Sept 1986 specs later.

Incidentally, for RT-11 volumes it's possible to read or save portions of the volume using "num@start" syntax, where num is the number of blocks to read, and start is the starting logical block to start reading from (numbered from 0). You can also read ranges of blocks using "start-end" syntax, which reads all the blocks between start and end inclusive. Similarly, it's possible to read or save portions of a CBMDOS volume using "num@track/sect" or "num@track,sect" syntax. Keep in mind that in CBMDOS, tracks are numbered from 1 while sectors are numbered from 0. This functionality isn't described by the "help" command.
 
Files-11 support is mostly working at this point. Viewing a file with "type" or "cat" works, and handles the sequential variable-length record format. Saving a file saves it in raw binary format. Directories are supported, using either [mmmnnn] or [m,n] syntax. There's nothing left that I consider terribly urgent. For browsing and saving files it's basically functional.

Code:
FSX>mount RK0 rms11-v18-rsx11m-v32.rk.gz
RK0: = C:\Users\kgober\Personal\Emulators\PDP-11\RK05 Disk Images\RSX-11M 3.2\rms11-v18-rsx11m-v32.rk.gz [-24KB] [ODS1]

FSX>RK0:

FSX>dir
INDEXF   .SYS;1 (1,1,0)
BITMAP   .SYS;1 (2,2,0)
BADBLK   .SYS;1 (3,3,0)
000000   .DIR;1 (4,4,0)
CORIMG   .SYS;1 (5,5,0)
200200   .DIR;1 (6,1,0)
001001   .DIR;1 (7,1,0)
001020   .DIR;1 (8,1,0)
001024   .DIR;1 (9,1,0)
001054   .DIR;1 (10,1,0)

FSX>dir [200,200]
RMS11    .CMD;1 (11,1,0)
CBLV40   .CMD;1 (12,1,0)

FSX>type [200,200]rms11.cmd

;
;  R M S 1 1 . C M D            VERSION 1.8
;
;  COPYRIGHT (C) 1979      DIGITAL EQUIPMENT CORP.
;
;  COMMAND FILE TO INSTALL RMS-11 ONTO AN RSX-11M USER SYSTEM.
;
;  YOU MUST BE LOGGED INTO A PRIVILEGED ACCT TO EXECUTE THIS CMD FILE.
;
;
(remainder removed)

CBMDOS support is similarly mostly working; it now reads enough of the BAM to be able to calculate the correct "blocks free" value for directory listings, which was the last significant defect. I will probably focus more on Unix support at this point, although if anyone has an interest in a particular target or image format I might be persuaded to look into it. I briefly considered adding OS-9 RBF volume support today but I don't actually have any OS-9 RBF disk images to test with. The next big feature will probably be some way to mount a subset of an image (i.e. a single partition of a multi-partition drive image). The code is mostly written, I just need a convenient syntax for invoking it.

Also a clarification regarding the Unix support: file systems up to 32MB are supported; the 917504-byte restriction is for reading an individual file contained within a Unix file system. Without partition support, right now only single-disk file systems such as RX01, RK05, or RL02 images are supported (plus DECtape of course). When partitioning is added you'll be able to mount things like RP03 partitions.

Now that Files-11 and RT-11 support are close enough to being finished to warrant being called "done", I will probably stop posting unasked-for updates in this thread. Other features I add will likely not be DEC-specific and I feel like they'll be off-topic for this forum.
 
Last edited:
Back
Top