Copyright: Disk-Manager Help


Disk-Manager

The Disk-Manager can be used to

- create disk-images from single files

- maintain disk-images

Disk-Manager can only handle FAT filesystems <= 32 MB (also known as FAT12)!

Disk-Manager does also NOT support long names of the VFAT filessystem.

Note: informations within this helpfile are related to MSX-DOS and MS-DOS. Floppy-disk related topics are refering to MSX-DOS, differences to MS-DOS are marked separately. Hard-disk related topics are refering to MS-DOS only. This is because of different sources for these informations.


FAT12

Disk-Manager can only handle FAT filesystems <= 32 MB (also known as FAT12)!

The FAT12 filesystem uses a 12bit FAT to store allocated clusters, which means that a maximum of 4096 clusters can be handled. This limits each disk/partition with the FAT12-filesystem to a maximum size of 32MB.

Typically used cluster-sizes are:

- floppy disks: 2 sectors (1 KByte)

- hard-disks: 8 sectors (4 KByte)


FAT16

The FAT16 filesystem was introduced in the operating systems MS-DOS 4.0. The current Disk-Manager version does not support the FAT16 filesystem!

The FAT16 filesystem is similar to FAT, but uses a 16bit FAT to store allocated clusters, which means that a maximum of 65536 clusters can be handled. This limits each disk/partition with the FAT16-filesystem to a maximum size of 2GB.

Typically used cluster-sizes are:

- floppy disks: do not use FAT16

- hard-disks: 8 sectors (4 KByte)

MS-DOS is trademark of Microsoft Corp.


VFAT

The VFAT filesystem was introduced in the operating systems Windows 95 and Windows NT 3.51.

The VFAT filesystem supports long file- and directoy-names on FAT and FAT16 compatible medias. Using normal DOS you’ll see the old-stlye filenames, where Windows and/or Windows NT are supporting the full-length names.

Disk-Manager does not support long file- or directory-names. So you should take care renaming files or directories which are associated with long names!

Only Disk-Manager’s volume-label feature works correctly with these images (correct names are displayed, label change does not corrupt VFAT entries).

Windows, Windows 95 and Windows NT are trademark of Microsoft Corp.


VFAT32

The VFAT32 filesystem was introduced in the operating systems Windows 95B, Windows 98 and Windows 2000.

The VFAT32 filesystem works similar as VFAT, but uses a 32Bit FAT which supports larger partitions as normal FAT- and FAT16-systems. Disk-Manager does only support direct physical access to FAT12-medias!

Windows, Windows 95, Windows 98 and Windows NT are trademark of Microsoft Corp.


New disk-image

Copy data from disk

Creates a disk-image and copies data from a specified removeable disk-drive (except CD-ROM drives). If you select this choice, ”Disk format/capacity” is automatically unchecked to enable auto-detect of the disk-capacity. If the disk is corrupted or copy-protected you should check ”Disk format/capacity” again and select the appropiate capacity.

Disk-Manager supports FAT12 filesystems only (max. 32MB) and fails to read newer ones.

WARNING: it’s known that some copy-protected diskettes with software for MSX-computers will be corrupted if they are read from Windows. Therefore it’s strongly recommended to create backup-copies of such diskettes and keep them write-protected while reading within Windows (Disk-Manager might corrupt them as well as the Explorer).

Disk format/capacity

Select a format/capacity for the new disk-image. Default-selection is the 720KB disk-format (2 sides, 80 tracks, 9 sectors/track), which is compatible between PC’s and a lot of homecomputers.


File properties

Shows filename, type, location, size and last modification-date. This page also displays the following attributes, which can be modified:

Read only

Indicates that this file is read-only. Move- and delete- operations will be denied!

Hidden

Indicates that this file is hidden. You cannot see this file if you want to access it from DOS or Basic programs. Anyway direct access is possible in all cases (you must specify the full path and filename).

Archive

Indicates that this file is changed or new created since last backup.

System

Indicates that this file is related to the system. You should not: reset this attribute, rename or remove files that have this attribute set!


Volume

OEM signature

Shows the disk-id, which is specific to the producer of your disk-drive or disk-maintaining program. This Id can have up to 8 characters. You can’t modify this information.

Volume label

Shows the current volume label of your disk. You can modify this name, that can have up to 12 characters. Use the DOS-command VOL to view the volume-label on the command-prompt.

Used memory

Disk-space used by stored files, subdirectories and other disk-objects.

Free memory

Disk-space available to save files and create subdirectories.

Total capacity

Total summary of used and free disk-space, including the overhead for management of the formatted disk (boot-sector, FAT’s, directory and reserved sectors).


Errors

This dialog shows media-errors linked to the disk-image. Typically this are errors which are used for copy-protection. All errors are ‘I/O-Error’s’, no CRC-errors or other kind or media-problems are supported!

This feature is used i.e. by RuMSX (also FreeWare by Lex Lechz).

DiskError-image

Disk-errors are saved in ‘*.der’ files, which contains read-error bits: DiskError images must have a 20 byte header ”DiskImage error” + 0x0D (CR) + 0x0A (LF) + 0x1A (EOF) + 0x00. Missing bytes are indicating read-success. Available bytes must set bits to 0 for allowing read/write-access. Set bit to 1 to disable read/write-access for a specific sector. One byte contains flags for 8 sectors, where the topmost bit is for the 1st sector of a group.

The ‘*.der’ file must be located in the same directory as the disk-image. If the disk-image has an extension, this one will be replaced - otherwise ‘.der’ will be added to it’s name.


Add sector

Select the number of a bad sector to add to the disk-image. You can select one of the valid values in the combobox or enter it manually.


Write to disk

Copies data from the disk-image to a specified removable disk-drive (except CD-ROM drives). If you don’t select ”Format” the target-disk must be already formatted with the specified capacity.

If you select  ”Format” then the target-disk is automatically formatted with the required capacity.

Important: Disk-Manager cannot write error-informations (from an optional error-image) to the target-disk!


Custom disk-format

The creation of disk-image custom disk-formats is for evaluation only. This feature is still in development and intended for creation of harddisk-images. Please note that you might not be able to load custom-images by using later releases of Disk-Manager or other utilities!

THE CUSTOM DISK-FORMAT IS UNDER-CONSTRUCTION!

For informations about used terms in this dialog see:

The FAT-ID-byte

The boot-sector

The directory

The File Allocation Table(FAT)


The boot-sector

Rules for MSX-homecomputers: The sector number 0 contains the “boot-strap loader” as well as several other informations. The following table is a summary of these informations, including the offset (hexadecimal) within the sector.

To determine the format of a disk first check byte 0 of the bootsector. If this byte is 0xE9 or 0xEB then read bytes 0x0B to 0x1D. Here you’ll find the required informations.

If the 1st byte is not 0xE9 or 0xEB or the range from 0x0B to 0x1D (drive-parameter block, DPB) contains only zeroes you need to determine the format by using the FAT-ID-byte.

Byte	Contents

00	0xE9 or 0xEB (JMP-opcode of the 8086 processor)

01-02	most likely start-address of a MS-DOS boot-strap loader

03-0A	OEM-Signature: this string can be OEM specific

0B-0C	number of bytes per sector

0D	number of sectors per cluster

0E-0F	number of reserved sectors

10	number of FATs

11-12	number of directory entries

13-14	number of sectors per disk (0000 on harddisk)

15	ID-byte (“Media descriptor”)

16-17	number of sectors per FAT

18-19	number of sectors per track

1A-1B	number of heads

1C-1D	number of “hidden” sectors

Numeric values, which are using 2 bytes are always stored in the commonly used x86 (or Z80) format, which means that the least significant byte is the 1st one and the most significant is the 2nd one.

Harddisks are using following additional informations:

20-23	big total number of sectors

24	physical drive number (i.e. 0x80)

25-26	extended boot-record signature

2C-35	volume-label

36-3D	file-system ID (i.e. “FAT16”)

(don’t know where the volume serial-number is stored)


The directory

The directory contains all informations specific to a file. Each file is represented by 32 bytes with following contents:

Byte	Contents

00-07	filename

08-0A	extension

0B	file-attribute

0C-15	reserved

16-17	time

18-19	date

1A-1B	1st cluster of the file

1C-1F	filesize

  0                    7  8    10 11 12       15

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

|        Filename       |Extens. |At|XX|XX|XX|XX|

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

 16             21 22 23 24 25 26 27 28       31

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

|XX|XX|XX|XX|XX|XX|Time |Date |Clust| FileSize  |

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

Filenames and extensions are well known, they are consisting of ASCII-characters. If the first character is 229 (0xE5), then the entry is invalid because it’s associated with a deleted file.

Most file-attributes are only supported by MS-DOS and MSX-DOS 2.xx (but not MSX-DOS 1.xx). Attributes can be used to i.e. protect a file against delete by setting bit 0 of the attribute-byte.

MSX-DOS 1.x supports only hiding of files by setting bit 1 (0x02). But take care because you will not be able to access this file any more!

Computers with internal clock can save the create/change-time of a file within the directory. Both time-bytes are stored in the commonly used x86 (or Z80) format. The five highest bits are containing the hour (0 to 23) the following six bits the minute (0 to 59) where the entry was created/changed. If the computer has no internal clock both bytes are 0, which means “time not known”.

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

| 0  1  0  1  1| 0  1  1  1  1  1| 0  1  1  0  1|

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

      Hours          Minutes        Seconds / 2

       11               31              26

The next two bytes are specifying the date, where the entry was created/changed. If the computer has no internal clock, this is the date which was entered during the system-startup (DOS prompts you to enter a date).

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

| 0  0  0  0  1  0  1| 1  1  0  0| 1  0  1  1  1|

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

       Year - 1980       Month         Day

          1985            12           23

The format is similar to the time-entry. The seven topmost bits are containing the date minus 1980, i.e. 0000101 for 1985, 0000110 for 1986 and so on. The following four bits are specifying the month (1 to 12), the remaining five bits the day (0 to 31). If both bytes are 0 this means “date not known”.

Take care: if your computer has no internal clock and you entered no date during system-startup this date is “1st January 1984” and not “date unknown” (at least on MSX computers)! The reason of this difference seems only known to the developers of Microsoft.

Explaining the following bytes is a more complex task. As you know the diskette is splitted into single sectors. If the computer creates a file he also needs to save the sectors where the parts of this file are stored. Also he needs to know which sectors are still available and which are already allocated.

To reduce the effort of maintenance no single sectors will be assigned to files, instead of it groups will be used. Groups are normally containing more than a single sector and are named “Cluster”.

These clusters again are numbered sequentially, and if you know the disk-format then you’ll be able to calculate the cluster-number for each sector and reverse. More details can be found in the capter “The File Allocation Table (FAT)”.

For this description of the directory it’s enough to know that you can find the number of the first cluster of the file.

The last four bytes of the directory entry are a 32bit wide value which describes the size of the file. As you expect these bytes are also stored in reverse order. If you i.e. find the size-entry “A0 03 02 00” then you can calculate the filesize by the following formula ((0x00*256 + 0x02)*256+0xA0, and this are 132000 bytes.


The FAT-ID-byte

If you cannot determine the disk-format by the specifications within the boot-sector, then read the 1st byte of sector 1. Here you’ll find (but in coded form) the signature of the used format.

If you’re not pedantic you can also skip the evaluation of the boot-sector and use the ID-byte (from sector 1) directly to determine the format. For now - at least for MSX - there is no known format, for which this information is not enough.

This byte can only have values from 0xF8 to 0xFF (or 0xF0 for other PC-diskettes and hardisks) and is the most-important information, which is required to manage all further data on the disk. Therefore you should, if you’re using a disk-editor, never change this ID-byte!

The following table shows how the ID-byte can be translated to disk-parameters.

Common to all formats are 512 bytes per sector and 2 FATs.

The number of directory entries specifies also the number of files which can be stored on the diskette (at least if all files are stored in the root-directory). If the root-directory is full you can not store more informations, even if there would be enough remaining space on the disk. Therefore it might be useful to concatenate multiple Basic-programs (by using MERGE) to one larger program and precede it by a selection (menu).

FAT-ID	F8	F9	FA	FB	FC	FD	FE	FF

Format code	891	892	881	882	491	492	481	482

Directory entries	112	112	112	112	64	112	64	112

Sectors / FAT	2	3	1	2	2	2	1	1

Sectors / track	9	9	8	8	9	9	8	8

Heads	1	2	1	2	1	2	1	2

Sectors / head	80	80	80	80	40	40	40	40

Sectors / cluster	2	2	2	2	1	2	1	2

Total sectors	720	1440	640	1280	360	720	320	640

Total clusters	360	720	320	640	360	360	320	320

Total Kbytes	360	720	320	640	180	360	160	320


The File Allocation Table (FAT)

Note: the following description is only valid for 12bit FAT’s, even if FAT16 and FAT32 filesystems are using similar technologies.

Once more we need to remember that each diskette contains of clusters. The FAT begins in sector 1 and contains, for each cluster one entry which explains “in which state I am”. Following states are possible:

- free

- allocated by a file; file ends here

- allocated by a file; file continues

By using the table to the FAT-ID-byte you can see that each floppy-disk can have up to 720 clusters (and more). Therefore one byte per cluster is not enough, on the other hand it’s not necessary to waste two bytes for a single cluster. Therefore the decision was made to use 3 bytes for storing informations of two clusters, which results in 12 bits per cluster.

Unfortunately this leads to a mixture of half and full bytes. To explain this problem check the following example:

F8 FF FF 55 40 00 05 60 00 07 F0 00 ...

For a better overview this informations are splitted into groups of 3 half-bytes. Each middle byte must be slitted:

F8 F/F FF 55 4/0 00 05 6/0 00 07 F/0 FF ...

And now it’s becoming strange: Each right half-byte (“nibble”) must be moved to the left, where the left nibble must be moved to the right within the group of 3:

FF8 FFF 055 004 005 006 007 FFF ...

This leads to the final information about the assignment of the cluster:

Cluster #  000 001 002 003 004 005 006 007 ...

Info       FF8 FFF 055 004 005 006 007 FFF ...

How to read this list? Remember the three possible states of a cluster:

- free

  the associated entry in the FAT is “000”

- allocated by a file; file ends here

  the FAT-entry is “FFF”

- allocated by a file; file continues

  the FAT-entry contains the cluster to continue

So we can attempt to decrypt the above table.

The first entry (would be cluster 000) is nothing else as our well-known ID-byte. So we are dealing with a disk in 891-format.

The entry in cluster 001 says “Cluster is allocated”. In this special case it’s not associated with a file, instead of it it’s a part of the directory.

Cluster 002 now is part of a file. The file is not finished and continues in cluster 055 (hex).

Cluster 003 is also part of a file, which continues in cluster 004, 005, 006 to 007 where the file ends.

While evaluating the FAT take care that the groups are also existing on sector-boundaries. This means that sector 2 begins within a “middle” byte, when the FAT occupies multiple sectors.

Because the FAT contains important informations for the management of the disk, there exists a backup-copy. This copy is located immediately behind the original, i.e. in general (using 2 sectors per FAT) in sectors 3 and 4 of the diskette.

The only remaining question: on which sector cluster number 000 can be found?

Using the above table you can evaluate the number of sectors per FAT, multiply it by the number of FAT’s (always 2), and add 2 again. The result is the 1st sector in cluster 000:

   FO = SF * 2 + 2

From here you can reach the next clusters:

   S = FO + CL * SC

In these both formulas is:

   SF	Sectors/FAT

   SC	Sectors/Cluster

   CL	Number of Cluster, which position is to be calculated

   FO	”FAT Offset”, the sector-number, under which cluster 000 can be found

   S	Queried sector number


Harddisk partitioning

IMPORTANT NOTE: CURRENT VERSIONS OF DISK-MANAGER DO NOT SUPPORT HARDDISK-IMAGES (INCLUDING MANAGEMENT OF PARTITION-TABLES). ALSO THE FOLLOWING DESCRIPTION IS NOT COMPLETE (AND MIGHT BE OUTDATED IN SOME TOPICS)!

THIS INFORMATION IS ONLY PROVIDED TO LIST ALL TECHNICAL INFORMATIONS FOR MANAGEMENT OF FLOPPY- AND HARDDISKS.

Partitioning of a harddisk

Each partition of a harddisk is limited to a maximum of 32MB capacity. This upper limit is also a limitation for different operating-systems: you cannot manage any media with storage-capacity of more than 32MB in one operating-system. I.e. a hardisk with a capacity of 40MB has a limited use because in DOS you can only access 32MB.

Partitioning using DOS 3.3

To fix this limitation the developers of DOS 3.3 introduced the possibility to manage more than one partition. So medias larger than 32MB can be used. Since version 3.3 a harddisk can be splitted into multiple parts, where each part cannot be larger than 32MB. This possibility is enabled by using the so called extended DOS-partition, which can be created beside a primary DOS-partition. The primary DOS-partition can be compared to partitions of older DOS-versions. The primary DOS-partition must be the first created partition for DOS and can occupy (maximal) the first 32 MByte of the harddisk. DOS can only be booted from the primary DOS-partition.

Beside this partition it’s possible to create an extended partition, which size is not limited. In principle it’s possible to use the whole capacity of the harddisk for the extended partition. The tricky thing: the extended partition must be splitted into logical drives, where each drive is limited to 32 MBytes because this is the maximum which can be handled by DOS 3.3. In this way you can create up to 23 logical drives with a total capacity of 768 MBytes.

Partitioning using DOS 4.0

Because several users need to store data which exceeds 32 MByte and more the solution of DOS 3.3 needed to be discarded. Because of several internal changes in device-drivers as well as some system-functions it’s possible - since DOS 4.0 - to maintain harddisks with a total capacity up to 2 GBytes - in one single partition!

To ensure compatibility with older versions, it’s possible to use DOS 4.0 for creation of primary and extended DOS-partitions with several logical drives. The primary DOS-partition in DOS 4.0 can be larger than 32 MByte. This feature is supported by adjusted cluster-sizes. The following table explains, which cluster-sizes are used.

+--------------------+-------------+---------+

|Max. partition-size | Clustersize | Sectors |

+--------------------+-------------+---------+

|       128 MByte    |  2.048 Byte |     4   |

|       256 MByte    |  4.096 Byte |     8   |

|       512 MByte    |  8.192 Byte |    16   |

|     1.024 MByte    | 16.384 Byte |    32   |

|     2.048 MByte    | 32.768 Byte |    64   |

+--------------------+-------------+---------+

Where partitions are stored

Obviously the entered partition-informations must be stored anywhere, to ensure that they are always available. The maximum of 4 partitions is stored within the absolute sector 0 of the harddisk (head 0, cylinder 0, sector 1), beside the so called partition-code. The partiton-code is the program-code which analyzes the partition-information and reacts on it. The partition-program is executed automatically on system-startup (by the BIOS). So the partition-program needs to detect, which of the max. 4 partitions is active. This partition must be selected and the control must be passed to the boot-sector of the corresponding partition. In this way the operating-system of the active partition is booted.

The BIOS loads the specified sector after startup of the PC, if it recognizes the registered and connected harddisk, on address 0000:7C00. If you analyze the code of the partition-sector you can see that the address 0000:7C00 is used as start-address for these 512 bytes. But the absolute sector 0 is only accepted as partition-sector if the last both bytes are 0x55 and 0xAA. Assuming that a useful routine for analysis of this data is available this routine is started by the following jump:

   JMP  0000:7C00

If a harddisk is installed, but no valid bootsector present an errormessage is displayed. Some BIOS-versions (most likely older PC’s) Tape-Basic is started, a limited Basic-version which is stored in the computer’s ROM. Other computers will report an error which informs you that the partition-informations could not be successfully read. If the partition-sector recognizes an active partition, the memory-block on 0000:7C00 is moved to 0000:0600, because the bootsector needs also to be loaded to 0000:7C00 and would overwrite the information of the partition-sector. Because the informations from the partition-sector needs to be processed subsequently it’s required to move it. The first DOS routine will only become active, after a DOS-partition is recognized as active. So the partition-routine for determination of the active partition is no part of DOS, it could also be used to start another operating-system. Therefore the partition-routine is absolutely independent.

Which informations are stored in the partition-sector

What are essential informations within the partition-sector? The following table shows the contents of this important sector:

+-------------------------------------+---------+

| Adr. | Content                      | Size    |

+-------------------------------------+---------+

| 000h | Partition start program      | Code    |

| 1BEh | 1st entry of partition-table | 16 byte |

| 1CEh | 2nd entry of partition-table | 16 byte |

| 1DEh | 3rd entry of partition-table | 16 byte |

| 1EEh | 4th entry of partition-table | 16 byte |

| 1FEh | Magic number AA55h           |  1 word |

+-------------------------------------+---------+

As you can see there is enough reserved space for the max. four possible partitions. Each entry uses exactly 16 bytes and looks like this:

+-------------------------------------+---------+

| Adr. | Content                      | Size    |

+-------------------------------------+---------+

|  00h | State of the partition       | 1 byte  |

|      |  00h = not active            |         |

|      |  80h = active                |         |

|  01h | first write-/read head       | 1 byte  |

|  02h | first sector/cylinder        | 1 word  |

|  04h | partition-type               | 1 byte  |

|  05h | last write-/read head        | 1 byte  |

|  06h | last sector/cylinder         | 1 word  |

|  08h | first absolute sector        | 1 dword |

|  0Ch | number of sectors            | 1 dword |

+-------------------------------------+---------+

Only one partition can be active, and this also only on the 1st harddisk. On a possibly existing 2nd harddisk you can also switch one partition active. Only primary partitions can be activated. The partition-routine uses the partition-state to recognize which partition should be used to boot the system.

Please note that the first (or only one) partition must not be defined on address 0x01BE. Some versions of FDISK are writing the 1st entry to the 4th position. In general it does not matter on which position a partition is defined, because partition-type 0 uses a free undefined partition-entry.

The start of a partition as well as it’s end is defined exactly . The absolute first sector is defined in form of a 32bit value (offset 0x08), also it’s size (offset 0x0C) which is once more a 32bit entry. To ease the management there are also informations, on which head, which track and which sector the corresponding partition starts and ends.

Please note that the complete 1st track is reserved for the partition-sector. In theory you could use the remaining sectors of this track to store important (secret) informations, which can not be read with OS-functions for logical drives. You cannot load or modify these informations with any DOS-function. To do so you need to use BIOS-functions on interrupt 0x13. On the other hand it would be possible that the remaining sectors of track 1 are also required for the partitioning-routine, if it was extended - i.e. to realize some sort of access-protection.

Third party products might create more than 4 partitions. The available memory can only be used to define 4 partitions, but there is no restriction to create an own partition-routine which i.e. can manage 32 partitions - so much partitions could be defined in a 512 byte sector (with 16bytes per partition). The developers of some partition-programs i.e. Speedstor are using similar techniques - in this case the partition-sector is no longer compatible to the standard partition-sector which is documented here.

Exact position of a partition

Each partition is defined by a lot of parameters. This does not only include the startsector, also the BIOS-parameters for the 1st sector in the partition (the bootrecord). Interrupt 0x13 - the BIOS-function to read and write single absolute sectors - expects the definition of a sector not in form of a sector-number xxxx by specifying a 32bit value. Instead of this three parameters must be defined:

- head (0 to n)

- track (0 to n)

- sector (1 to n)

The head is always defined by a complete byte, for more informations refer to offset 1 and 5. Each cylinder (track) and sector is encoded in a word. Most harddisks are using 17, some others 26 or more sectors. Some harddisks are also using more than 256 tracks, so that a word cannot be simply splitted into 2 byte-values. The 2 most significant bits of the cylinder (track)-value are therefore encoded in the sector:

15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

|                       |     |                 |

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

 |                       |     |

 |                       |     +- Sector

 |                       +------- Cylinder (bit 8 and 9)

 +------------------------------- Cylinder (bit 0 to 7)

This coding exactly matches with the functions in BIOS interrupt 0x13, therefore no translation is necessary. Start and end of the partition are defined in this form.

If you verify the start-informations for the first partition, so you’ll see that the (already described) whole first track is reserved for parition-informations. The first partition begins always on head 1, track 0, sector 1.

Extended DOS-partitions

Extended DOS-paritions are managed more complex. As already described FDISK allows only to create one extended partition. Within this extended partition a (nearly) unlimited number of logical drives can be defined to use it’s memory-space.

Internally this is handled different: the extended partition starts with a partition-sector, which does not contain code (as the original partition-sector on the 1st harddrive) but all informations about the logical drive. Additional to the informations of the own partition the extended bootrecord (so these sectors are called) contains also a reference to the next logical drive, which is also called next extended partition - if some exists. The partition-type of the extended partition is always 1 or 4, so it defines a 12bit FAT (1) or a 16bit FAT (4). While DOS is started this linked list is tracked and a new entry for a logical drive will be created. The end of this list is indicated by the partition-type 0 in the second entry of the partition-table.


Partition type
Partition-type

The partition-type can be one of the following values:

00 = free

01 = DOS with 12bit FAT

02 = XENIX

03 = XENIX

04 = DOS with 16bit FAT

05 = Extended DOS (since DOS 3.3)

06 = DOS 4.0 partition (> 32MB)

DB = Concurrent DOS

Please note that different operating-systems on the market might define some more partition-types!


Disk-images

There are several types of disk-images which are indicated by their file-extension. Anyway some images might have different contents. In general all images are storing their informations in order of logical sector-numbers (i.e.: head 0, track 0, sectors 1-n; head 1, track0, sectors 1 - n; head 0, track 1, sectors 1-n; ...). Also some informations from the boot-sector might be useful to determine the exact format of the data stored within the disk-image.

PLEASE NOTE THAT CURRENT VERSIONS OF DISK-MANAGER DO ONLY SUPPORT RAW DISK-IMAGES (WITHOUT HEADER, COMMENTS, COMPRESSSION)!

Known structures of disk-images are as following:

*.DSK

This is the most common file-type and is supported by several utilities, which are providing several product-dependent features:

DCopy is developed by Marat Fayzullin and provided for use with his fMSX emulator. DCOPY writes the raw floppy-disk data to a disk-image. DCOPY does not create any image-header, comments and it does not compress the image in any way.

LoadDisk is written by IBM. This is a very old utility which has been replaced by LoadDSKF. Currently there are no known informations about the data-format of maintained disk-image(s).

SaveDSKF and LoadDSKF is written by IBM and supports several options as:

- data compression

- omitting the 1 sector leader

- adding comments

- producing a file compatible with LoadDisk

In general SAVEDSKF can be used to create a disk-image containing the raw disk-data as described for several other utitities. Because the created disk-image might become a very complex format it’s described in the seperate chapter “SaveDSKF-image”.

VMware is a virtual PC (by VMware, www.vmware.com) and recommends a harddisk-image to be created for each virtual machine. Therefore VMware can be used to create raw harddisk-images which must be managed by the operating-system which will be (or is) installed on this virtual machine. As far as I analyzed VMware images are starting with “COWD” where the total header-size is 0x1200 bytes.

*.DS1

This type specifies a single-sided 3.5” disk (360KB). This image contains the raw disk-data (similar to the *.DSK format), but does not support comments, some sort of compression or other features.

*.DS2

This type specifies a double-sided 3.5” disk (720KB). This image contains the raw disk-data (similar to the *.DSK format), but does not support comments, some sort of compression or other features.

*.DDI

This type specifies a Disk-Dupe image (DiskDupe is written by Micro System Designs, Inc.). As far as I analyzed DiskDupe images are starting with “IM” where the header-area from 0x000B to 0x001D is always zero. Other contents of the header are not known yet (it seems that the remaining part seems to contain the sector-numbers, which might be changed on heavily copy-protected disks). The total size of the image-header is 0x1200 bytes. This header is followed by the raw uncompressed disk-data. DiskDupe images do not support comments, some sort of compression or other features.

*.IMG

This type specifies a disk-image, which is similar to the *.DSK, *.DS1 and *.DS2 images, but starts with one additional leading byte. This byte specifies the number of sides (heads) and is therefore usually 1 or 2. After this leading byte you’ll find the raw uncompressed disk-data. IMG-files do not support comments, some sort of compression or other features.


SaveDSKF-image

If the disk-image contains heading-imformation it starts with 0xAA and a single byte specifying the length of the additional header. This header does not include the leading 0xAA-byte, after the header the image-information is stored. Including all trailing information the disk-image has the following layout:

0000	MagicID: 0xAA

0001	size of header

0002	the FAT-ID byte

0003	? always 0x00

0004-0005	? number of bytes per sector? (usually 0x0200)

0006	? normally 0, but 1 if image is compressed

0007	? normally 0, but 1 if image is compressed

0008-0009	? normally 0x0100

000A	number of FAT’s

000B-000C	number of directory-entries

0018-0019	number of tracks

001A-001B	number of heads

001C-001D	number of sectors per track

0024-0025	absolute offset of comment, usually 0x0028

0026-0027	absolute offset of image-data

0028-...	comment, ASCII-string is terminated with 0x00

(string ends typically with CR/LF: 0x0D, 0x0A)

Note: absolute offsets are always starting from the beginning of the image-file!