Tuesday, January 28, 2014

Subversive Metadata for Existing Commodore Images

SYNOPSIS

Jim Brain has suggested a way to encode optional metadata into Commodore images.  Though there are problems with his suggestion, it has merit.

METHOD

Jim's suggestion is to put optional metadata into the final sector of the directory.  The reason given is that this sector is seldom used, since the directory is seldom filled up or exceeded, although this does happen from time to time.

The reason for making this metadata optional is because this sector can be used for other nonstandard purposes, as well as for directory entries.

METADATA

What sort of metadata could go into this block?  There is a lot of useful, but not critical, information that could go there.

1. Magic Strings.  A "magic string" is a short, constant data string that indicates the overall structure of the image.  This string could be scanned for, regardless of the file size, to verify how the file should be parsed.  For example, a D64 might have a magic string of "1541 Digital Image, 2014 January"-- a string that is highly unlikely to show up in any D64 file.  But if present, the parser can be certain that it's a D64 file.

2. Nonstandard Sizes.  Nonstandard image size data could go here.   For example, a byte that indicates the number of tracks present for this image could allow a D64 with 255 tracks, or as few as 18 tracks (stopping at the Directory track).

3. Nonstandard Formats.  Metadata may indicate that the image's format has been altered in specific ways.  For example, the BAM might be nonexistent, or error data is stored in data blocks as a file starting at a particular T/S link.  For that matter, the entire image may be rearranged, with the header at Block 0, the Directory pointed to with a T/S link, error data at another T/S link, and a disk structure having a variable number of tracks with 256 sectors each.  This sort of radical departure would require easy detection of a Magic String of course.



No comments:

Post a Comment