This is a quick and dirty implementation of a VersaDOS filesystem reader and a System V68 filesystem reader. Neither program writes to the disk image. I needed it so i could look at VersaDOS source and to examine the System V68 files, to help in implementing a VME10 Emulator..

Both use the same code from the Z80 Emulator to access IMD disks. Only IMD disk images are supported, since raw images with multiple track densities are difficult to work with. 

VersaDOS disks can be in two formats.. Motorola and IBM...I have only VME10 disk images. The VME10's Winchester Disk Controller supports IBM System 34 1D/2D formats.. 

If someone has 8 inch Exormacs IMD images, and is willing to send them to me, i can modify the viewer to read them. 

In the folowing ASCII Art, Vx represents Versados track numbering on an IBM format disk, and Cx represents CPM 68K track numbering on a CPM formatted disk. 

The Motorola Firmware, used to boot load an OS, requires that Versados Logical sector numbers be used to access the Initial Program Loader (IPL), so both Unix and CPM uses a trick to make a disk bootable. CPM reserves V0, V1 and V2 for the IPL program. then C2 - C158 is used for CPM's Filesystem. 


          Side 0     Side 1
        |----------|----------|
 Cyl 0  | V0  C0   | V1  C159 |   V0/C0, is always FM
        |----------|----------|
 Cyl 1  | V2  C1   | V3  C158 |   For Versados and Unix V1-V159 are MFM 16 256 byte SPT
        |----------|----------|
 Cyl 2  | V4  C2   | V5  C157 |   For CPM 68k C1-C159 are MFM 8 512 byte SPT
        |----------|----------|
        | .......  | ........ |
        |----------|----------|
 Cyl 78 | V156 C78 | V157 C81 |
        |----------|----------|
 Cyl 79 | V158 C79 | V159 C80 |
        |----------|----------|



The Versados 5 inch disk format always formats Track 0 (V0/C0) (cyl 0 head 0) as 16 128 byte FM sectors. For VersaDOS, and UNIX, the rest of the disk is formatted 16 256 byte MFM sectors.  For CPM the rest of the disk is 8 512 byte MFM sectors. (The Z80 emulator will read and write CPM VME 10 disk images.)

The Versados viewer does not support the SYSTEM V68 filesystem, nor the CPM filesystem.

The System V68 viewer does not support the Versados filesystem, nor the CPM filesystem.

The CPM 68K filesystem can be read using the Z80 Emulator, by running CPM80 V2.2 and using the DC.COM program to reconfigure a Drive for the VME10 format.

Versados uses logical sector numbers (LSN) where each sector is considered to be a 256 byte block. (even if 128 byte sectors on a track...two become one). All pointers are LSNs.

VersaDOS does record IO, only. Each record can be fixed or variable length. Text files are stored as Variable Length record files with no keys; in either a Sequencial file or an Indexed Sequential file with Duplicate keys, KEYlen=0. NO CRLFs are stored in the file; only the length of each record. A blank line is represented by a record, length 1, containing a single Blank.  Also, some text files are stored with spaces compressed into a single byte representing from 1 to 127 blanks.

Clicking on any option causes the current file (or the Volume info) to be read , converted and placed into a Rich Text Box control used for display. This can take a while, so there's a STOP button if it is wasting your time. the display options determine whether or not spaces are expanded and CRLFs are added to the display of the file.

The display area can display a file as plain data, (ascii) or the file's data blocks as hexadecimal. Or the directory info for the file.

NOTE.. DUMP displays the entire data block, whereas DISPLAY only displays the record data in the data blocks...data blocks may be partially full. Internal fragmentation is common.

The Save Display menu option will save whatever is currently displayed in the RTF box display area. if you have displayed a text file with CRLF added and expanded spaces, then the contents of the display is sufficient to be used as a conversion of the Versados file, and when saved will approximate the text file as a PC file. However, control characters will have been converted to user readable codes. Like...<EOT> 

Another way to save a text file is via the menu, Save Records. If it is a text file, you should set the Expand Spaces(expands space compression code) and Add CRLF (adds CRLF to end of each record) options to save the file as something that can be used by PC editors. Control codes will be saved as-is.

Each type of Versados file has pre-determined options for saving, but may not be what you want. Some .SY files are keyed text , while others are binary.

It is rational to save fixed length record files without adding any record delimitors.( a load module has 256 byte fixed length records, and when saved, correctly represents the original file) But most Variable length record files must have some type of record delimiter saved, in order to use them. You can either add CRLF to each record's end , or use the Save Length Option to add a 16 bit (little end-ian or big end-ian) Length to the beginning of each record.

If a file has Keys, then those Keys will be saved and/or displayed as regular data. You will have to figure out what to do with the keys. Keys are the first (key length) bytes of each record. The indexing of keys is handled by Versados, and the disk structures that implement the keyed access are, effectively, lost when you save a keyed file.

The Save Blocks Option can be used to save complete Data Blocks, including any internal fragmentation. But again the Key Access Info is not saved.

NOTE - Odd length records are padded to even sizes by VersaDOS. But, when saved as records by VDFS the pads are removed. By doing this, file access works for windows. 

When saving all files to a directory, ID (RECL=0 KL=0) and SQ (RECL=0) are saved as text files (converted to Windows - spaces expanded and CRLF added). Fixed record size files are saved with internal fragmentation removed.  Contigous files are saved as-is. Others are saved as close to the original as possible, but with internal fragmentation removed. 