Revision as of 14:50, 7 May 2011

IDEDOS is a hard disk formatting scheme designed for ZX Spectrum computers and clones. It was designed by Garry Lancaster for his +3e ROMs and ResiDOS RAM based operating system, and extended by Jarek Adamski to support his ZXVGS, CPM22QED and YaPaDOS operating systems.

Format

Note: The following is not an official specification, it has been reverse engineered from hard disk images and information collected from various sources. The labels given to bytes are entirely arbitrary and should not be taken as the official labels.

IDEDOS supports up to 65535 partitions on a hard disk, with a theoretical maximum partition size of 2TB. However IDEDOS does not support LBA mode therefore the hard disk capacity is limited to 128GB by the limitations of CHS addressing.

8-bit vs 16-bit interfaces for Z80 based computers

Since the Z80 microprocessor has as an 8-bit data bus and IDE requires a 16-bit data bus some circuitry is required to combine a pair of 8-bit read/write operations into a single 16-bit operation. This extra circuitry increases cost and complexity in a hard disk interface so some interfaces omit this circuitry and simply treat the IDE bus as a normal 8-bit wide I/O device. This means that when any 16-bit word is read from or written to the hard disk, the upper byte is simply ignored, therefore half the hard disk's capacity cannot be utilised by computer.
IDEDOS supports these halved capacity interfaces as it simply means that each hard disk sector contains 256 bytes instead of the standard 512 bytes. Software which reads from an IDEDOS formatted disk should not therefore make assumptions about the number of bytes per sector as it depends on the hardware used to format the disk.

The IDEDOS System Partition

The IDEDOS System Partition is normally the first partition on the drive located at Cylinder 0, Head 0, Sector 1 (C0/H0/S1).
The specification also allows placing the system partition at Cylinder 0, Head 1, Sector 1 (C0/H1/S1) to allow an MS-DOS Master Boot Record to be present.

The IDEDOS System Partition contains the Partition Table for the drive. The Partition Table consists of a number of Partition Table Entries each 64 bytes long containing the partition type, location, size, and additional type specific information.

The first partition entry in the table describes the IDEDOS System Partition itself and contains information about the drive geometry and initialisation information for the +3e system ROMs

Partition Types

Partition Type 0x00 - Unused Partition

This is an empty partition table entry. Type 0x00 entries do not describe any disk space and should be left blank.

Partition Type 0x01 - The IDEDOS System Partition

The first partition entry in the partition table is always the IDEDOS system partition. There must only be one System Partition on a hard disk. The partition label must always be the string "PLUSIDEDOS" followed by six spaces (ascii 0x20) as this string is used to determine whether the disk was created using an 8 or 16-bit interface.
The starting head and ending head are either zero or one depending on where the partition table has been written.
The drive geometry is written in the type specific data in the bytes 0x0020 to 0x0027

Partition Type 0x02 - Swap Space

Swap partitions can be created with the +3e ROMs however no software is known to use them.

Partition Type 0x03 - +3DOS

The +3e ROMs create partitions of type 0x03 i.e. +3DOS partitions. The type specific data portion of the Partition Entries for these partitions contain a +3DOS XDPB (eXtended Disc Parameter Block) between 0x0020 to 0x003A and also the +3DOS drive letter to which the partition has been mapped (if any)

Partition Type 0x04 - CP/M Partition

CP/M partition with an XDPB which reflects the geometry of the physical disk. The partition must use a whole number of cylinders and use whole number of tracks. If the partition does not start at track 0 of the cylinder the area before the partition on that cylinder must be marked as reserved tracks in the XDPB.

Partition Type 0x05 - Boot Partition

A partition of type 0x05 is accessed as a single file. This can be used as a boot file for example a Timex FDD3000 with a YABUS.TF searches for a type 0x05 partition with the label "YABUS.TF". If found the contents of the partition
are copied to RAM and executed.

Partition Type 0x0F - Movie Partition

Partition containing a sequence of screenshots (and sound).

Partition Type 0x10 - FAT-16 Partition

Partition containing a FAT-16 filesystem.

Partition Type 0x20 - UZI(X) Partition

Partition for UZI(X) the UNIX Implementation for MSX.

Partition Types 0x3x - Non-CP/M Disk Image Partitions

For partitions containing non-CP/M floppy disk images the type specific information defines a virtual geometry. More than one disk image partition can be present on each track, i.e. the partitions do not have to align to track boundaries.
This is achieved by specifying a sector shift in the partition table entry. For example for a disk with 980 cylinders, 5 heads, 17 sectors per track and 512 bytes per sector, a 800kB partition takes 1600 sectors which is equal to 18 cylinders + 4 tracks + 2 sectors, so the shift for next partition is 2.