LoadDskF/SaveDskF
m (→Format details)  | 
			|||
| Line 11: | Line 11: | ||
== Format details ==  | == Format details ==  | ||
| − | The LoadDskF documentation says "all diskette sectors are written [to the image file] up to and including the highest occupied data sector". So, uncompressed files can   | + | The LoadDskF documentation says "all diskette sectors are written [to the image file] up to and including the highest occupied data sector". So, uncompressed files can be converted to raw [[FAT]]/[[IMA]] format by deleting the header, and appending padding if needed.  | 
| + | |||
| + | === File structure ===  | ||
| + | The following information is from a [https://www.vcfed.org/forum/forum/technical-support/vintage-computer-software/13222-savedskf-exe-meaning-of-1-sector-leader#post183877 forum post].  | ||
| + | <pre>  | ||
| + | +0  DW  magic     [all words are in Intel little-endian order]  | ||
| + |             0x5AAA => Compressed   | ||
| + |             0x59AA => No compression  | ||
| + |             0x58AA => Older format (no compression), with sector data   | ||
| + |                     beginning at fixed offset 0x200 rather than immediately   | ||
| + |                     after the comment. Created by SAVEDSKF with the   | ||
| + |                     undocumented /C option.  | ||
| + | |||
| + |                 (In fact, LOADDSKF accepts any magic number in the range   | ||
| + |                  58AAh-5AAAh, but these are the ones SAVEDSKF generates).  | ||
| + | |||
| + | +2  DW  media type  | ||
| + |                 The first byte of the FAT.  | ||
| + | +4  DW  sector size, bytes  | ||
| + | +6  DB  cluster mask  | ||
| + |                 The number of sectors per cluster, minus 1.  | ||
| + | +7  DB  cluster shift  | ||
| + |                 = log2(cluster size / sector size)  | ||
| + | +8  DW  reserved sectors  | ||
| + |                 As in the BIOS parameter block  | ||
| + | +10 DB  FAT copies  | ||
| + |                 As in the BIOS parameter block  | ||
| + | +11 DW  Root directory entries     | ||
| + |                 As in the BIOS parameter block  | ||
| + | +13 DW  Sector number of first cluster (ie, count of sectors used by boot  | ||
| + |         sector, FATs and root directory)  | ||
| + | +15 DW  Number of clusters in image. This is probably less than the number of  | ||
| + |         clusters the disc can hold, since empty clusters at the end are not  | ||
| + |         saved.  | ||
| + | +17 DB  sectors/FAT  | ||
| + |                 As in the BIOS parameter block  | ||
| + | +18 DW  Sector number of root directory (ie, count of sectors used by   | ||
| + |                 boot sector and FATs)  | ||
| + | +20 DD  checksum  | ||
| + |                 Sum of all bytes in the file.  | ||
| + | +24 DW  cylinders  | ||
| + |                 Number of cylinders, 40 or 80  | ||
| + | +26 DW  heads  | ||
| + |                 Number of heads, 1 or 2  | ||
| + | +28 DW  sectors/track  | ||
| + |                 Number of sectors per track  | ||
| + | +30 DB  0,0,0,0      | ||
| + |                 Do not appear to be used.  | ||
| + | +34 DW  number of sectors in image  | ||
| + | +36 DW  offset to comment  | ||
| + | +38 DW  offset to the first sector. If this is 0, assume it is 0x200.  | ||
| + | |||
| + |   After the header, an ASCII comment may follow.   | ||
| + | |||
| + |   The sectors then follow, stored in cylinder/head/sector order. If the magic  | ||
| + | number is 5AAAh, the data will be compressed using a 12-bit LZW scheme.  | ||
| + | </pre>  | ||
== Identification ==  | == Identification ==  | ||
Revision as of 19:55, 20 April 2021
LoadDskF and SaveDskF are floppy disk imaging utilities by IBM. They have an associated file format, sometimes called DSK or SKF. The format was notably used for OS/2 service packs.
It most likely contains an image of a FAT12 filesystem.
Some files are compressed. The compression scheme is some form of LZW.
Contents | 
Format details
The LoadDskF documentation says "all diskette sectors are written [to the image file] up to and including the highest occupied data sector". So, uncompressed files can be converted to raw FAT/IMA format by deleting the header, and appending padding if needed.
File structure
The following information is from a forum post.
+0  DW  magic     [all words are in Intel little-endian order]
            0x5AAA => Compressed 
            0x59AA => No compression
            0x58AA => Older format (no compression), with sector data 
                    beginning at fixed offset 0x200 rather than immediately 
                    after the comment. Created by SAVEDSKF with the 
                    undocumented /C option.
                (In fact, LOADDSKF accepts any magic number in the range 
                 58AAh-5AAAh, but these are the ones SAVEDSKF generates).
+2  DW  media type
                The first byte of the FAT.
+4  DW  sector size, bytes
+6  DB  cluster mask
                The number of sectors per cluster, minus 1.
+7  DB  cluster shift
                = log2(cluster size / sector size)
+8  DW  reserved sectors
                As in the BIOS parameter block
+10 DB  FAT copies
                As in the BIOS parameter block
+11 DW  Root directory entries   
                As in the BIOS parameter block
+13 DW  Sector number of first cluster (ie, count of sectors used by boot
        sector, FATs and root directory)
+15 DW  Number of clusters in image. This is probably less than the number of
        clusters the disc can hold, since empty clusters at the end are not
        saved.
+17 DB  sectors/FAT
                As in the BIOS parameter block
+18 DW  Sector number of root directory (ie, count of sectors used by 
                boot sector and FATs)
+20 DD  checksum
                Sum of all bytes in the file.
+24 DW  cylinders
                Number of cylinders, 40 or 80
+26 DW  heads
                Number of heads, 1 or 2
+28 DW  sectors/track
                Number of sectors per track
+30 DB  0,0,0,0    
                Do not appear to be used.
+34 DW  number of sectors in image
+36 DW  offset to comment
+38 DW  offset to the first sector. If this is 0, assume it is 0x200.
  After the header, an ASCII comment may follow. 
  The sectors then follow, stored in cylinder/head/sector order. If the magic
number is 5AAAh, the data will be compressed using a 12-bit LZW scheme.
Identification
Old format files start with bytes 0xaa 0x58.
New format uncompressed files start with 0xaa 0x59.
New format compressed files start with  0xaa 0x5a.
Software
- DIUNPACK Rel. 3.03 (1996-01-30) (OS/2 software)
 - loaddf.zip - LoadDskF 1.16r (1993-01-14) and SaveDskF 1.14r (1992-05-26) - DOS and OS/2-compatible binaries; probably requires a floppy disk + drive.
 - DSKXTRCT - Exracts files (uncompressed disk images only) (OS/2 software)
 - dskdcmps - Decompresses compressed disk images (source code)
 - MAKEDSKF - Utility for creating disk images (OS/2 software)
 - 7-Zip can often handle uncompressed LoadDskF files, using its generic support for FAT.
 
Sample files
- http://cd.textfiles.com/hobbesos2/2_1/SERVPAK/ - Old format
 - https://archive.org/details/IBMOS22.11XR06200EnglishDiskettes → "IBM OS2 2.11 - XR06200 - English - Diskettes.zip" → *.DSK - Examples of new format, uncompressed
 - https://archive.org/details/OS2_Install_Disks → OS2_W3B-D1CD_2000-03-19.zip → DISK1.DSK - Example of compressed format