[File] [PATCH] Magdir/filesystems for TransCopy disk image *.tc *.img

Jörg Jenderek joerg.jen.der.ek at gmx.net
Wed Oct 27 19:16:45 UTC 2021


Hello,

some times ago i handled some disk images. Some unexpected
results lead me to inspection of TransCopy disk images with
file name extension TC and IMG.

When running running file command version 5.41 on such images and
related files i get an output like:

DISK1.TC:                                     data
VOCALC2.TC:                                   data
WIZ1_320.IMG:                                 data
WIZ2_720.IMG:                                 data
disk02.tc:                                    data
grub_t400_8mb_libgfxinit_txtmode_colemak.rom: Intel serial flash
					      for ICH/PCH ROM <= 5 or
					      3400 series A-step

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies disc
examples as "TransCopy disk image" by definition
tc-transcopy.trid.xml via 2 byte start pattern 5AA5 (See appended
tc_img-trid-v.txt).

It also displays an URL on Wikipedia about Central Point Software
(CPS) and its ISA floppy controller card "Option Board". This
information is now expressed by comment lines inside
Magdir/filesystems like:
# URL:	en.wikipedia.org/wiki/Central_Point_Software#cite_note-6
# Ref.:	http://mark0.net/download/triddefs_xml.7z
#	defs/t/tc-transcopy.trid.xml
With this information i found documents (image_format.txt
TranscopyFormat.txt) about the Transcopy image format. That
information is expressed by comment lines like:
# www.robcraig.com/download/transcopy-5-x-file-format
# www.robcraig.com/download/transcopy-file-format-by-gene-thompson

Unfortunately TransCopy files have only a weak 2 byte magic
pattern 0x5AA5 at offset 0x0. So the displaying part is done by
sub routine tc-floppy. So tests for more characteristics must be
added. This sub routine start like:
  0	name		tc-floppy
  >0	beshort		x		TransCopy disk image
  !:mime	application/x-floppy-image-tc
  !:ext	tc/img
Instead of generic mime type application/octet-stream a user defined
one is shown. The original file name extension was 3 byte "IMG", but
that extension is often used by others. So also 2 byte extension "TC"
is found, but maybe never used official by CPS.

After signature 2 description lines are stored, which are optional
zero-terminated and have a maximal length of 32 characters. So this
is done by lines like:
  >2		string		>\0		%.32s
  >0x22		string		>\0		"%.32s"
In first description i found ASCII text like "Project Workbench
2.20", "Visi On Calc" or "Wizardry V Disk 1 of 3". In second
description in found text like "(1988).", "Advanced - Utility" or
'Program Disk 2". So that information can be used to skip Intel
serial flash ROM with unlikely description starting with hexadecimal
F0F0 by additional line like:
  >>>2		beshort		!0xF00f

At offset 256 the disk type is stored as byte value. Typical only low
values (2~MFM High Density 3~MFM Double Density 4~Apple II GCR 5~FM
Single Density 6~Commodore GCR 7~MFM Double Density 8~Commodore Amiga
Ch~Atari FM) occur or 0xFF for Unknown. That is often found in my
inspected example. This information is shown by line like:
  >0x100		ubyte		!0xFF		\b, disk type %u

So that information can be used to skip Intel serial flash ROM with
invalid disk types 89h 88h by additional test line like:
  >>>>0x100	byte		!0x89

Afterwards the starting cylinder number is stored as byte value. In
my inspected examples this value was 0 as typical expected. So that
information is shown by line like:
  >0x101		ubyte		x		\b, cylinder
  >0x101		ubyte		!0		start=%u
So that information can be used to skip Intel serial flash ROM with
unlikely "high" start cylinder 100 by additional line like:
  >>0x101	ubyte		<100

Afterwards the ending cylinder number is stored as byte value. In my
inspected examples this value often was 40, but i also found value 41
and 79. So that information is shown by line like:
  >0x102		ubyte		x		end=%u

Afterwards the number of sides is stored. In my examples i only found
value 2. So that information is shown by line like:
  >0x103		ubyte		!2		\b, %u sides
Because we consider floppy disc images i only expect also value 1
here. So i skip Intel serial flash ROM with invalid 0 disk sides by
second test line like:
  >0x103		ubyte		!0

After applying the above mentioned modifications by patch
file-5.41-filesystems-tc.diff then all my inspected disk images
are now described and no misidentification occurs. This now looks like:
DISK1.TC:                                     TransCopy disk image
					      , cylinder end=41
VOCALC2.TC:                                   TransCopy disk image
					      Visi On Calc
					      "Program Disk 2"
					      , cylinder end=40
WIZ1_320.IMG:                                 TransCopy disk image
					      Wizardry I Disk 1 of 1
					      320kb
					      , cylinder end=41
WIZ2_720.IMG:                                 TransCopy disk image
					      Wizardry II Disk 1 of 1
					      720kb
					      , disk type 7
					      , cylinder end=79
disk02.tc:                                    TransCopy disk image
					      Project Workbench 2.20
					      "Advanced - Utility"
					      , cylinder end=40
grub_t400_8mb_libgfxinit_txtmode_colemak.rom: Intel serial flash
					      for ICH/PCH ROM <= 5 or
					      3400 series A-step

I hope my diff file can be applied in future version of file utility.

With best wishes
Jörg Jenderek
--
Jörg Jenderek
























































-------------- next part --------------
-- 
File mailing list
File at astron.com
https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tc_img-trid-v.txt.gz
Type: application/x-gzip
Size: 603 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20211027/1617fad5/attachment.bin>
-------------- next part --------------
--- file-5.41/magic/Magdir/filesystems.old	2021-09-20 14:07:28 +0000
+++ file-5.41/magic/Magdir/filesystems	2021-10-27 19:03:54 +0000
@@ -2405,6 +2405,66 @@
 
 0	string	\074CPM_Disk\076	disk image data (YAZE)
 
+# From: 	Joerg Jenderek
+# URL:		https://en.wikipedia.org/wiki/Central_Point_Software#cite_note-6
+# Reference:	https://www.robcraig.com/download/transcopy-5-x-file-format
+#		https://www.robcraig.com/download/transcopy-file-format-by-gene-thompson
+#		http://mark0.net/download/triddefs_xml.7z/defs/t/tc-transcopy.trid.xml
+# TransCopy signature
+0		beshort		0x5AA5
+# skip Intel serial flash ROM with invalid 0 disk sides handled by ./intel
+>0x103		ubyte		!0
+# skip Intel serial flash ROM with unlikely "high" start cylinder 100 handled by ./intel
+#>>0x101		ubyte		<100		VALID_START_CYLINDER
+# skip Intel serial flash ROM with unlikely descrition handled by ./intel
+#>>>2		beshort		!0xF00f		VALID_DESCRIPTION
+# skip Intel serial flash ROM with invalid disk types 89h 88h handled by ./intel
+#>>>>0x100	byte		!0x89		VALID_DISK_TYPE
+>>0	use	tc-floppy
+#	display information of Central Point Software (CPS) Option Board TransCopy floppy image
+0	name		tc-floppy
+>0		beshort		x		TransCopy disk image
+#!:mime	application/octet-stream
+!:mime	application/x-floppy-image-tc
+# like: disk04.tc VOCALC2.TC WIZ5_A.tc WIZ2_720.IMG
+!:ext	tc/img
+# 1st description (optional 0-terminated maximal 32) like:
+# "Project Workbench 2.20" "Visi On Calc" "Wizardry V Disk 1 of 3"
+>2		string		>\0		%.32s
+# 2nd desc. (optional 0-terminated maximal 32) like:
+# "(1988)." "Advanced - Utility" 'Program Disk 2"
+>0x22		string		>\0		"%.32s"
+# Looks like ascii (like MESSAGES) formatted with attribute bytes (190)? 
+# not needed for disk copy
+#>>0x42		string		x		'%.190s'
+#>>0x88		lestring16	x		"%.8s"
+# disktype: 2~MFM High Density 3~MFM Double Density 4~Apple II GCR 5~FM Single Density
+# 6~Commodore GCR 7~MFM Double Density 8~Commodore Amiga Ch~Atari FM FFh~Unknown
+>0x100		ubyte		!0xFF		\b, disk type %u
+# StartingCylinder like: 0
+>0x101		ubyte		x		\b, cylinder
+>0x101		ubyte		!0		start=%u
+# EndingCylinder like: 40 (often) 41 79
+>0x102		ubyte		x		end=%u
+# NumberOfSides like: 2
+>0x103		ubyte		!2		\b, %u sides
+# TrackIncrement like: 1
+>0x104		ubyte		!1		\b, track increment %u
+# TrackPosTbl Track skew
+#>0x105		ubequad		x		\b, Track skew %#16.16llx
+# TrackOffsTbl
+#>0x305		ubequad		x		\b, TrackOffsTbl %#16.16llx
+# TrackLngthTbl
+#>0x505		ubequad		x		\b, TrackLngthTbl %#16.16llx
+# TrackTypeTable
+#>0x705		ubequad		x		\b, TrackTypeTable %#16.16llx
+# Address mark timing
+#>0x905		ubequad		x		\b, Address mark timing %#16.16llx
+# Track fragment
+#>0x2905 ubequad			!0		\b, Track fragment %#16.16llx
+# Track data
+#>0x4000		ubequad		!0		\b, Track data %#16.16llx
+
 # ReFS
 # Richard W.M. Jones <rjones at redhat.com>
 0	string	\0\0\0ReFS\0	ReFS filesystem image
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.41-filesystems-tc.diff.sig
Type: application/octet-stream
Size: 1541 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20211027/1617fad5/attachment.obj>


More information about the File mailing list