tosvd [-s fmt] [-o fmt] [-w on|off] [-cCvtmirVg] filename [filenames...] > outputfile
This command is used to convert floppy images into the internal format of the Semi-Virtual Diskette (SVD). It can also be used to figure out the format of floppy images and convert between the different formats.
The command is used by the SVD Control Program (SVD-CP) graphical interface when converting images for download to the SVD. This program must reside in the same directory as the SVD-CP.
filename(s)  This command takes one or more filenames. If converting an image, only a single filename should be specified, and the converted image is sent to the standard output stream. If multiple filenames are specified the output stream will be the concatenation of all of converted files. If reporting (in any one of the forms including "guessing") multiple filenames are allowed and processed.
-r  This option produces a report of the file to the standard output stream. Errors are send to the standard error output stream. Use the -v in conjuction with this option to generate a more verbose output.
-vThis command is the verbose modifier for the report option (-r above). When used it causes a very detailed report of the incoming format to be generated. The format of this output will only be useful to those who understand floppy formats, and changes from image format to image format.
-tUsed with the report option (-r above), this option causes terse output. In a fight, the -t option will beat the -v option.
-mWhen used with -r this option outputs a "machine readable" version of the report. The format of this output is subject to change, and is used exclusively by the SVD-CP program.
-qQuery/list the output formats supported. When used with the -v (verbose) option, a multi-line verbose listing is generated. This form is used by the GUI.
-QQuery/list the input formats supported. When used with the -v (verbose) option, a multi-line verbose listing is generated.
-iCauses CRC errors to be ignored. Normally CRC errors are bad, and indicate that the input image is either corrupt or was created improperly. However, some copy-protected images use CRC errors as part of their scheme. If this is the case, use this option to allow the CRC errors to filter though the SVD. If you think you should, instead, correct these errors, use the -C option below.
-CThis option causes any CRC errors to be corrected. As described in the -i option (above) CRC errors are normally bad. Use this option to correct them. Use the -i option if you think that the errors are part of the copy-protection scheme for the target image, and should be ignored instead of corrected.
-w on|offSets the write-protect flag for the image when generating output. If this option isn't used, the write-protect flag present in the input image is used. In addition to "on" and "off", the values "0" and "1" can be used.
-cChecks the image for CRC errors and reports an error if one or more are found.
-s fmtThe program is quite good at guessing what format the incoming image is in...at least for those formats that it knows about. If, for whatever reason, it doesn't guess it right, you can set the incoming image format, forcing the program to treat an incoming file as a particular format. This is not recommended. The file converters can easily get confused with bad input and abnormal program termination (core dumps) are possible.
-gReads the given filename(s) and guesses each file's format. No conversion is performed. If a format isn't recognized, this isn't an error. In this case, the word "UNKNOWN" will be output.
-VReturns the version number of the program, along with its compilation date and time.
-o fmtGenerate output in the specified format. Default for the output format is the SVD internal format (named coincidentally "SVD"). Valid output formats at the time of this writing include: SVD, JV1, JV3, H17, and JVC. Use the -q option to determine which output formats are supported by your version of the program.
-?This option lists all of the valid options for the command. Further, all supported image formats for both input and output are listed. Note that the set of supported input formats may be different from the set of supported output formats.
As of the writing of this document, the following file formats were supported for either reading, writing, or both. Over time, it is expected that the number of formats will expand.
JV1  The "JV" in this format refers to Jeff Vavasour who originally used this format for his TRS-80 emulator. The format is simply a binary image of sectors, starting with track 0 through track 35 (or 40). Information is in this format. It is assumed that the image is in "single density" format.
JV3As in the JV1 format "JV" in this format refers to Jeff Vavasour who originally used this format for his TRS-80 emulator. The format is a more expressive mechanism for encoding images. It allows for double density, write-protection, and even non-standard numbering of tracks...which is useful for representing copy-protected disks.
JVCAs in the two "JV" formats above, the "JV" in this format refers to Jeff Vavasour who originally created this format for his TRS-80 Color Computer emulator. It is somewhere in the middle between JV1 and JV3 in expressiveness.
DMKThe DMK format is the most expressive format in this list, and was created by David Keil for his TRS-80 emulator. It includes information that is very close to the way in which data is stored on real floppies. However, this makes the format rather complex. The DMK format is able to represent nearly all copy-protected disks.
H17The H17 format is the name given to the data format created by Dave Shaw and Dave Wallace for their Heathkit H8 emulators. This format is in ascii, and represents the sector data along with the volume number of the diskette image.
H17V1This format is identical to the H17 format above except that all of the formatting and identification information has been removed.
SVDThe SVD format is the internal format that is used by the SVD hardware. It is not as expressive as the DMK format, but can represent most copy-protected images. It is formatted to promote SVD operation, and is, therefore, a bit convoluted. It consists of binary data with a header block comprised of sector encoding, CRC, and other sector information. Sectors trail the header block. However, the real start of each sector is just after the byte position of its associated header information in the header block.
Note that in the following examples a dollar sign ($) is used to indicate the user's prompt, it should not be typed. The user's input is in bold, and the program's response is not.Checking what version of the program you have; both the version number and the compilation time are shown.:
$ tosvd -V tosvd: version 1.6 (Wed Apr 21 10:13:04 2004)To see the list of the floppy input formats that are supported, use the -Q option.
$ tosvd -Q DMK, SVD, H17, H17V1, JVC, JV3, JV1Here's an example of checking the floppy format of a single image, where zaxxon.dsk is the target floppy image. Note that this disk is an example of a non-standard as well as copy-protected disk. In the program's return text, the type of the disk image file is shown "DMK" along with the number of tracks and sectors. The star next to the format name indicates that the image is write-protected. The output indicates that the image has 14 tracks and 10 sectors. However, the star next to the 10 indicates that there is a track on the image with a different number of sectors. Finally, the "SD" refers to WD1771 single density FM encoding.
$ tosvd -r zaxxon.dsk tosvd: zaxxon.dsk - DMK* 14 tracks, 10 sectors*, 1 side, SD encodingThe program's real job is to convert file formats. Here's an example of converting a DMK image to the SVD internal format. This format is suitable for sending to the SVD. The SVD-CP uses the program in this mode when preparing images to be sent to the SVD. You can store images in the SVD format if you like as well. Note: normally with this command there is no other output other than the converted file. In the case of the zaxxon image, however, a CRC error is returned:
$ tosvd zaxxon.dsk > zaxxon.svd data crc error: id 2 side 0 sector 105 sizecode 1 CRC 1 128 CRC 2 34)This CRC error is actually part of the copy protection for the zaxxon image. In the command above, no output was generated into the output file because of this error. When using copy protected images, you should use the "-i" option to ignore CRC errors. The SVD-CP always uses the -i option.
$ tosvd -i zaxxon.dsk > zaxxon.svdThe program is quite good at guessing what format the incoming image is in...at least for those formats that it knows about. If, for whatever reason, it doesn't guess it right, you can force the program to treat an incoming file as a particular format. This is not recommended. The file converters can easily get confused with bad input and abnormal program termination (core dumps) are possible.
$ tosvd -C -s DMK zaxxon.dsk > zaxxon.svd
The program returns 0 to the shell upon success, which is defined as either an appropriate report or a successful conversion. Note that a report indicating an UNKNOWN FORMAT does not cause an error return value.Returns values of non-zero indicate either that images files couldn't be read, or their conversion failed for one reason or another.
In the future, it would be quite nice to have specific error returns.
The options described here are current as of version 1.7 of tosvd. Version 1.6 has the following exceptions:
- The -w option only turns ON write-protect. It doesn't take any options, and there is therefore no way to turn off write-protect.
- The -o option doesn't accept options...or do anything for that matter.
- The -s option doesn't work. All specified formats appear incorrect.
- The -Q and -q options don't work.
Numerous.
fstool, fquery