A floppy disk holds one AmigaDOS volume that starts at block 0. An Amiga hard disk can hold several, and describes them in a small table at its start, the
Rigid Disk Block (RDB). An image of such a disk begins with these blocks (it is often given the extension .hdf, which is also the extension of unrelated HDF4 and HDF5 files; that naming is our own observation, not from a source read here), and each partition then begins with an ordinary
boot block of its own. A hardfile, by contrast, is “a file which contains an Amiga volume” and is described by Clévy’s section 7 as “a big floppy dump file”: it has no RDB, starts with an ordinary boot block and is described below.
There are five kinds of block. The RDSK block must be in the first 16 blocks of the disk (RDB_LOCATION_LIMIT in the AROS header), counted
in 512-byte sectors before the block size is known. It holds the geometry and the heads of three linked lists: partitions (PART), file system code (FSHD, then LSEG blocks) and bad blocks (BADB).
Every block has the same first four longs, all big-endian:
| Offset | Size | Name | Description |
|---|---|---|---|
0x00 | 4 | id | Four letters: RDSK, PART, FSHD, LSEG or BADB. |
0x04 | 4 | size in longs | How many longs the checksum covers: 64 for RDSK, PART and FSHD (256 bytes), the whole block (128 for 512-byte blocks) for LSEG and BADB. |
0x08 | 4 | checksum | Chosen so that the covered longs add up to zero (ignoring overflow), the same rule as the root block, but the sum is at offset 8 and not 0x14. |
0x0C | 4 | host id | SCSI target id of the host controller, 7 for IDE and ZIP disks. |
A list pointer of $FFFFFFFF (−1) means “none” or “last”. Block numbers in the RDB are counted from the start of the disk; block numbers inside a partition are counted from the first block of that partition.
In PART, FSHD, LSEG and BADB the next block of the list is the long at 0x10.
RDSK: the Rigid Disk Block
| Offset | Size | Name | Description |
|---|---|---|---|
0x10 | 4 | block size | Bytes per block, usually 512; “can be other powers of 2”. |
0x14 | 4 | flags | Usually $17. Bit 0 no more disks on this controller, 1 no more LUNs, 2 no more target ids, 3 do not try reselection, 4 disk id valid, 5 controller id valid, 6 synchronous SCSI (dangerous if the drive cannot). |
0x18 | 4 | bad block list | First BADB block, or −1. |
0x1C | 4 | partition list | First PART block, or −1. |
0x20 | 4 | file system header list | First FSHD block, or −1. |
0x24 | 4 | drive init code | Optional drive-specific initialisation code, called as DriveInit(lun, rdb, ior) (Clévy), or −1. |
0x28 | 24 | reserved | Six longs, −1. |
0x40 | 4 | cylinders | Number of cylinders. |
0x44 | 4 | sectors | Sectors per track. |
0x48 | 4 | heads | Number of heads. |
0x4C | 4 | interleave | |
0x50 | 4 | park | Landing-zone cylinder, soon after the last one. |
0x54 | 12 | reserved | Three longs, 0. |
0x60 | 4 | write precompensation | Starting cylinder. |
0x64 | 4 | reduced write | Starting cylinder for reduced write current. |
0x68 | 4 | step rate | |
0x6C | 20 | reserved | Five longs, 0. |
0x80 | 4 | RDB blocks, low | First block of the range reserved for these blocks. |
0x84 | 4 | RDB blocks, high | Last block of that range, inclusive. |
0x88 | 4 | low cylinder | First cylinder of the partitionable area. |
0x8C | 4 | high cylinder | Last cylinder of the partitionable area, inclusive. |
0x90 | 4 | blocks per cylinder | Heads × sectors. |
0x94 | 4 | auto park seconds | 0 for no auto-park. |
0x98 | 4 | highest RDSK block | The highest block used by these blocks (not counting replacement bad blocks). |
0x9C | 4 | reserved | 0. |
0xA0 | 8 + 16 + 4 | disk vendor, product, revision | Text, such as IOMEGA, ZIP 100, R.41. |
0xBC | 8 + 16 + 4 | controller vendor, product, revision | Text. |
0xD8 | 40 | drive init name | AROS lists a 40-character rdb_DriveInitName here; Clévy shows ten reserved longs (0), so it is undefined in practice. (Both sources agree on the position.) |
The geometry fields give the size: a cylinder is heads × sectors blocks (Clévy: “the ‘CylBlocks’ field equals ‘heads’ × ‘sectors’”). The reserved area is
often the first two cylinders, between the RDB-blocks low and high blocks inclusive; the partitionable area runs from the low to the high cylinder. Clévy’s geometry examples: a ZIP disk 2891 cylinders, 1 head, 68 sectors;
an 80 MB IDE disk 980 cylinders, 10 heads, 17 sectors.
PART: a partition
| Offset | Size | Name | Description |
|---|---|---|---|
0x10 | 4 | next | The next PART block, or −1. |
0x14 | 4 | flags | Bit 0 bootable, bit 1 no automount. |
0x18 | 8 | reserved | Two longs. |
0x20 | 4 | device flags | Preferred flags for OpenDevice. |
0x24 | 1 + 31 | drive name | A length byte and up to 31 characters, such as DH0. |
0x44 | 60 | reserved | Fifteen longs. |
0x80 | The DOS environment vector (the same numbers as in a MountList), 20 longs from here: | ||
0x80 | 4 | environment size | The size of the vector: Commodore’s dos/filehandler.h says DE_TABLESIZE “is set to the number of longwords in the table minus 1”, 11 at the least (it must reach NumBuffers); 16 reaches the DOS type, 19 the boot blocks (Clévy writes “16 (longs)”). See the environment vector. |
0x84 | 4 | block size | In longs: 128 for 512-byte blocks. |
0x88 | 4 | sector origin | 0. |
0x8C | 4 | surfaces | Heads of the drive. |
0x90 | 4 | sectors per block | 1. |
0x94 | 4 | blocks per track | |
0x98 | 4 | reserved blocks | At the start of the partition, usually 2 (at least 1). |
0x9C | 4 | preallocated | Reserved blocks at the end, normally 0; no effect on the root block’s position. |
0xA0 | 4 | interleave | 0. |
0xA4 | 4 | low cylinder | First cylinder of the partition, inclusive. |
0xA8 | 4 | high cylinder | Last cylinder, inclusive. |
0xAC | 4 | buffers | Often 30. |
0xB0 | 4 | buffer memory type | 0. |
0xB4 | 4 | maximum transfer | Often $7FFFFFFF (Clévy) or $00FFFFFF (amitools’ default). |
0xB8 | 4 | mask | Address mask; often $FFFFFFFE (Clévy) or $7FFFFFFE (amitools’ default). |
0xBC | 4 | boot priority | Signed, for auto-boot. |
0xC0 | 4 | DOS type | DOS and a flag byte (see DOS types); also UNI\0 AT&T System V, UNI\1 Unix boot, UNI\2 BSD for System V, resv reserved (swap space) (Clévy). Clévy advises reading the partition’s own boot block, “don’t rely only on the PART and FSHD ‘DosType’ field”. |
0xC4 | 4 | baud | Default baud rate for Commodore’s serial handlers, from the A2232 multiserial board. |
0xC8 | 4 | control | Used by Commodore’s AUX handler. |
0xCC | 4 | boot blocks | Kickstart 2.0: number of blocks of boot code to load at start-up. |
0xD0 | 48 | reserved | Twelve longs. |
Where the partition is. Its first block is low cylinder × surfaces × blocks per track and it holds (high − low + 1) × surfaces × blocks per track blocks, using the partition’s
own environment numbers (this is Commodore’s: Beats, Amiga Mail 1989, “The boot block is always on the first sector of a partition. This is calculated as LowCyl * Surfaces * BlocksPerTrack”, and the last block as ((UpperCyl + 1) × Surfaces × BlocksPerTrack) − 1; a block number inside the partition is added to that start, the physical block being LowerKey + Block# − Reserved with LowerKey the first block plus Reserved).
The partition’s root block is in the middle of it, by the rule on the boot block page.
FSHD: file system header, and LSEG: its code
An FSHD block says how to start the task for a file system that is stored on the disk itself, so an Amiga can use a file system its ROM does not contain. Clévy: “You don’t need it to reach partitions.”
| Offset | Size | Name | Description |
|---|---|---|---|
0x10 | 4 | next | The next FSHD block, or −1. |
0x14 | 4 | flags | |
0x18 | 8 | reserved | Two longs. |
0x20 | 4 | DOS type | The file system this code is for, such as DOS\1 or a third-party id. |
0x24 | 4 | version | High 16 bits the version, low 16 the revision: $0027001B is 39.27 (Clévy’s example). |
0x28 | 4 | patch flags | Bits for those of the following fields that must be substituted into a standard device node for this file system; for example $180 substitutes the segment list and the global vector. The bits are listed below. |
0x2C | 4 | type | Device node type, 0. |
0x30 | 4 | task | 0. |
0x34 | 4 | lock | Not used, 0. |
0x38 | 4 | handler | File name to load, 0. |
0x3C | 4 | stack size | 0. |
0x40 | 4 | priority | Signed, 0. |
0x44 | 4 | startup | Signed, 0. |
0x48 | 4 | segment list block | The first LSEG block (needs processing before substitution, says Clévy). |
0x4C | 4 | global vector | BCPL global vector, −1. |
0x50 | 92 + 84 | reserved | Twenty-three longs reserved “by PatchFlags” (0x50–0xAB), then twenty-one more (0xAC–0xFF). AROS names the last 84 bytes fhb_FileSysName, which Clévy lists as reserved; the sources agree on where they are. |
| Bit | Value | Field it selects | Offset |
|---|---|---|---|
| 0 | 0x001 | type | 0x2C |
| 1 | 0x002 | task | 0x30 |
| 2 | 0x004 | lock | 0x34 |
| 3 | 0x008 | handler | 0x38 |
| 4 | 0x010 | stack size | 0x3C |
| 5 | 0x020 | priority | 0x40 |
| 6 | 0x040 | startup | 0x44 |
| 7 | 0x080 | segment list block | 0x48 |
| 8 | 0x100 | global vector | 0x4C |
The nine bits are those of amitools’ FSHeaderBlock.py (get_flags, default mask 0x1FF), which tests bit 0x01 for type up to 0x100 for global_vec, in the order of the
fields in the block; so $180 is exactly bits 7 and 8, the segment list and the global vector. AROS hardblocks.h and Clévy give the fields but not the bit numbers. Bits 9 and up are not defined by any source read.
How a particular driver uses the substituted node is not described.
LSEG blocks carry the code: a block of id LSEG, the covered longs (the whole block), checksum, host id, the next LSEG block at 0x10 (−1 for the last) and then 123 longs (492 bytes
on a 512-byte block) of load data. Concatenated in order, the data is the file system “stored like an executable, with relocation hunks” (Clévy), that is an
Amiga HUNK file. The viewer lists these blocks but does not join or decode the code.
BADB: bad blocks
Id BADB, the covered longs (the whole block), checksum, host id, the next BADB block at 0x10, a reserved long, then pairs of block numbers from 0x18: the bad block and the
replacement block it is remapped to (((BSIZE / 4) − 6) / 2 pairs, 61 for 512-byte blocks).
The environment vector, all of it
The vector in a PART block (and in a MountList, a DosEnvec in memory) is the same table Commodore’s dos/filehandler.h (Developer Kit 3.1 and 3.5) lists, with the index DE_… of each entry. Nothing follows DE_BOOTBLOCKS in either header (AROS’s filehandler.h ends there too).
The PART block has room for 17 longs of it (pb_Environment[17], indexes 0 to 16, up to the DOS type) and then 15 longs “reserved for future environment vector” (pb_EReserved[15]), which is where indexes 17 to 19 (baud rate, control word, boot blocks) are stored, at 0xC4, 0xC8 and 0xCC; the rest of that reserved area is not used by any entry.
| Index | Offset in PART | Name | Meaning (Commodore’s comment) |
|---|---|---|---|
| 0 | 0x80 | DE_TABLESIZE | Number of longs in the table minus 1; minimum 11. |
| 1 | 0x84 | DE_SIZEBLOCK | Block size in longs; “standard value is 128”. |
| 2 | 0x88 | DE_SECORG | Not used; must be 0. |
| 3 | 0x8C | DE_NUMHEADS | Heads (surfaces); drive specific. |
| 4 | 0x90 | DE_SECSPERBLK | Not used; must be 1. |
| 5 | 0x94 | DE_BLKSPERTRACK | Blocks per track; drive specific. |
| 6 | 0x98 | DE_RESERVEDBLKS | Unavailable blocks at the start; usually 2. |
| 7 | 0x9C | DE_PREFAC | Commodore’s comment: “not used; must be 0”; the structure comment and Beats call it PreAlloc, reserved blocks at the end of the partition, which Beats says FFS uses. One header says unused, the text of 1989 says used by FFS. |
| 8 | 0xA0 | DE_INTERLEAVE | Usually 0. |
| 9 | 0xA4 | DE_LOWCYL | Starting cylinder, typically 0. |
| 10 | 0xA8 | DE_UPPERCYL | Maximum cylinder. |
| 11 | 0xAC | DE_NUMBUFFERS | Starting number of buffers; typically 5 (Clévy: often 30). |
| 12 | 0xB0 | DE_BUFMEMTYPE | Type of memory for the buffers. |
| 13 | 0xB4 | DE_MAXTRANSFER | Maximum bytes to transfer at a time. |
| 14 | 0xB8 | DE_MASK | Address mask to block out certain memory. |
| 15 | 0xBC | DE_BOOTPRI | Boot priority for autoboot (signed; −128 means not bootable, RKRM Devices). |
| 16 | 0xC0 | DE_DOSTYPE | The file system type as four characters, DOS and a flag byte for the Amiga file systems. |
| 17 | 0xC4 | DE_BAUD | Baud rate for the serial handler. |
| 18 | 0xC8 | DE_CONTROL | Control word for the handler or file system. |
| 19 | 0xCC | DE_BOOTBLOCKS | Number of blocks containing boot code. |
Beats’ (1989) note on DE_SIZEBLOCK: the old and fast file systems of V1.3 assume 512-byte blocks and variable block sizes were announced for V1.4; his structures all “assume a fixed, 512 byte disk block”.
What a driver does with the RDB
The Amiga ROM Kernel Reference Manual: Devices (3rd edition, 1991, the SCSI device chapter) describes the sequence, which is the practical meaning of the blocks above:
- It looks for
RDSKwith a correct checksum in the first 16 blocks (RDB_LOCATION_LIMIT). If there is none, it mounts nothing from that unit. If there is one but no partition list, it uses only theflags(last disk, last LUN, last target id) to stop looking for more units early. - For each PART block with a correct id and checksum: if
PBFB_NOMOUNTis set the partition only reserves space and is skipped. Otherwise it takes the drive name (DH0,work,wb-2.x), and if the name is already used by another mount-list or DOS device it alters it (the A590, A2091 and A3000 drivers append.n, then count up). - It builds a device node (
MakeDosNode()) from the name and the vector. If the DOS type is not the standardDOS\0of the ROM file system, the “alien file system” steps follow: look the DOS type and version up infilesystem.resource; if absent, find an FSHD block with that DOS type and a suitableversion, load it from its LSEG blocks (LoadSeg()) and add it to the resource; then use the patch flags to copy the chosen fields of the FSHD block into the new device node. (Before Kickstart 2.0 the first RDB driver had to create the resource itself.) - If the partition is bootable (
PBFB_BOOTABLE) and it is boot time, it enqueues a boot node with the boot priority of the vector (−128 means not bootable); otherwise the node just becomes a DOS device. The bootstrap then boots from the highest priority node, floppies at 5 (df0:), −10, −20 and −30 fordf1:todf3:.
The drive-init code (rdb_DriveInit) and the bad block list are the two things that text does not describe: the header says only that the former is called as DriveInit(lun, rdb, ior) and the latter is an “optional bad block list”. What a driver does with the bad block pairs is not stated by any source read. The partition flags
and the FSHD flags field (Commodore’s header says nothing about FSHD flags beyond the field) are as in the tables above.
The same header says the RDB blocks should not be put in a partition’s reserved area, because “Format”, “Install” and “DiskCopy” overwrite it; the recommended layout is to keep all of them in the first cylinders. The XT-type disks of the A590 also use the RDB standard (the text’s note that RDB is SCSI-biased but not SCSI-only).
Block sizes other than 512
Commodore’s hardblocks.h (the header comment in the Developer Kit 3.1 and in the 1991 manual) says: “Though only 512 byte blocks are currently supported by the file system, this proposal tries to be forward-looking by making the block size explicit, and by using only the first 256 bytes for all blocks but the LoadSeg data.”
That gives the rules for a larger block, which the structures’ own comments back up: RDSK, PART and FSHD (and the checksummed SummedLongs of 64) occupy the first 256 bytes of whatever the block size is; a BADB block checksums the whole block and holds (BSIZE ÷ 4 − 6) ÷ 2 pairs (“[61] assumes 512 byte blocks”); an LSEG block checksums the whole block and holds
BSIZE ÷ 4 − 5 longs of data (“[123] assumes 512 byte blocks”). rdb_BlockBytes (RDSK 0x10) says which size to use for the rest of the disk; the scan for RDSK itself, in the first 16 blocks, must work before it is known, so (as stated at the top of this page) it is counted in 512-byte sectors. The partition’s own file system block size is in its vector
(DE_SIZEBLOCK in longs: 128 for 512 bytes). Larger blocks came later: Barthel writes that blocks “can be as large as 65536 bytes”, and the Linux affs driver documents 512, 1024, 2048 and 4096-byte blocks as supported (and says all the file systems allow 512 to 32 KB). Those are file system block sizes; no text read gives an RDB laid out on blocks larger than 512 bytes beyond the sentence above, and
no such image was available, so the rules for it are Commodore’s intent and not a checked layout. (Stage 9 adds two texts and a code reading, below; the layout is still not checked on a Commodore-written image.)
What HDToolBox 45.2 and the Hyperion 3.1.4 notes say about block sizes (stage 9)
- Vendor text: the Hyperion AmigaOS 3.1.4(.1) release notes for HDToolBox (
hdtoolbox-RelNotes, free from Hyperion) say that 40.x foundGetRDB()“expects to read RigidDiskBlock data with each block containing as many bytes as there are in a sector, as reported by a READ_CAPACITY SCSI command. This means that the RigidDiskBlock is by no means independent of the medium which it is stored on”; that 40.14 examines an RDB written with a shorter sector size than the medium reports and resumes scanning at the shorter size, and ignores RDB blocks that say they hold more data than was read; that 40.16 can override the sector size (MIN_SECTOR_SIZE,MAX_SECTOR_SIZE, multiples of 512 and powers of two); that 46.21 sets the default file system block size to 4096 bytes (8 sectors) on disks of more than 223 blocks and rounds blocks per cylinder down to a multiple of 8; and that 46.24 stopped writing a file system entry with patch flags that force the byte size, relying on the RDB instead. So Hyperion’s HDToolBox of 2016 to 2019 writes an RDB in sectors of the size the medium reports, which agrees withrdb_BlockBytesbeing the sector size of the medium. The notes give no example image. - Commodore/Haage code analysis (HDToolBox 45.2, 21.12.2000, from the OS 3.9 install tree on an archive.org copy; file offsets inside its first code hunk; this is the 3.9 program, not the 3.1.4 one): the data hunk holds a 256-byte template of an RDSK block (
RDSK, 64 longs, host id 7,rdb_BlockBytes0x200, flags0x10), and the routine at0x2874copies it into the drive record (0x100bytes) and then stores a 16-bit value read from a library call into the long at0x10of that record (0x28F4), together with cylinders, sectors and heads (0x40,0x44,0x48) and the cylinder size (0x90). So the 512 in the template is a default that this routine replaces; which call supplies the value, and whether it is the medium’s sector size, was not resolved. The partition builder at0x89B8to0x8AF8writes thePARTblock as 64 longs, and in the environment vector setsDE_SIZEBLOCKto the drive’s sector size divided by 4 (0x8A0Eto0x8A14) andDE_SECSPERBLKto 1 when the sector size is above0x200and to 2 when it is not (0x8A48to0x8A54). TheFSHDandLSEGbuilders (0x8CB6,0x8D54) store their size argument divided by 4 as the summed longs, not a constant. HDToolBox was not run: it is a window program, and keyboard and mouse input cannot be sent to Amiberry here, so none of this was seen working.
Hardfiles
A hardfile is a file that contains one Amiga volume and nothing else (Clévy, section 7). It is made by an emulator (Clévy names WinUAE; in the emulator an AmigaDOS device of type uaehf.device is attached to it and formatted from Workbench) and is not partitioned: there is no RDB.
Clévy: “An hardfile is like a floppy disk dump, but bigger: it has a bootblock, a rootblock, a bitmap and perhaps dircache blocks. The first three bytes of a hardfile is then ‘D’ ‘O’ ‘S’.” Its geometry is heads = 1, sectors = 32 and as many cylinders as its size needs; the example mount list for an 8 MB file gives Surfaces = 1,
BlocksPerTrack = 32, Reserved = 1, Interleave = 0, LowCyl = 0, HighCyl = 511, Buffers = 5, DosType = 0x444F5300, BufMemType = 1 (512 cylinders × 32 blocks × 512 bytes is 8,388,608 bytes).
So an image whose first four bytes are DOS and a flag byte and whose first 16 blocks hold no RDSK is read like a large floppy image: the boot block at block 0, the root block in the middle (Clévy’s rule with the file’s block count: for the 8 MB example the highest block is 16,383 and the root block is 8,192 with Reserved 1 as well as 2 by integer division; our arithmetic), the bitmap
where bm_pages says. The bitmap then needs several bitmap blocks (one covers 127 × 32 = 4,064 blocks, about 2 MB) and, above 25 of them, extension blocks. Clévy’s two statements about the boot area (“the first two blocks” for a partition, and Bootblocks × BSIZE) are reconciled on the disk blocks page: a hardfile has no environment vector in the file, so the number of boot blocks is whatever the mount list says (the example does not give it).
The reserved count, which sets how many blocks lie before the first bitmap-covered block, is likewise not in the file (Reserved = 1 in the example, 2 on floppies): a reader that wants the exact block range tries the middle block for a header of type 2 and secondary type 1 with a correct checksum, which is our suggestion and not from a source.
Reading a disk image
- Look for
RDSKat the start of blocks 0 to 15. If it is not there the image is not an RDB disk (a hardfile or a floppy-style image). - Check the checksum; take the block size from the RDSK block.
- Follow the partition list from
0x1C; each PART block gives a partition’s name, DOS type and cylinder range. - For each partition, read its boot block at its first block; the first four bytes name the actual file system, as for a floppy.
The explorer here opens such an image when the file is named .adf, or .hdf when it passes the strict test described below: it lists the RDB blocks and the partitions and opens each partition as a volume of its own. The .hdf extension also belongs to HDF4 and HDF5 in the explorer’s registry, which keep their magic numbers first.
Sources
- AROS
devices/hardblocks.h– the five structures (C, AROS Public Licence); read raw 2026-11-14. - Laurent Clévy, “The Amiga filesystem explained”, section 6 – offsets and notes; the page says its structures are “mainly extracted from the ‘devices/hardblocks.h’ and ‘dos/filehandler.h’ files delivered in Commodore developer kits”. Read raw from the Internet Archive copy, because lclevy.free.fr refused connections.
- amitools
fs/block/rdb– which long each field is read from (GPL 2 or later); read raw 2026-11-14. - Amiga ROM Kernel Reference Manual: Devices, 3rd edition (Commodore-Amiga, Addison-Wesley, 1991), the SCSI device chapter: the
devices/hardblocks.hlisting, “How a driver uses RDB”, “Alien file systems” and “Amiga bootstrap”. Read as the Internet Archive’s OCR text (samples/adf/sources/ia-rkrm-devices-3rd_djvu.txt; the OCR garbles the listing, so the field names were matched to the AROS header and the Developer Kit header below). - Commodore’s Developer Kit 3.1 headers
devices/hardblocks.handdos/filehandler.h(the 3.5 kit’sfilehandler.hwas compared with it fromstruct DosEnvecto the end of the file, 62 comment-separated pieces: only the two structure comments ofde_SizeBlockandde_SectorPerBlockdiffer, above), as text on the Amiga Developer CD 2.1: the block comments,pb_Environment[17], theDE_…list. - Steve Beats, Low Level Differences Between FFS and the ROM Filing System, Amiga Mail 1989 (same CD): where a partition starts, its last block, the 512-byte assumption.
The AROS header, Clévy and amitools agree with each other on every offset above, and the Commodore header agrees with all three; where they differ (the usual maximum transfer and mask, the last bytes of RDSK and FSHD) the page says so.
Where Commodore’s texts differ from this page
| Field | Reading A | Reading B | What this page does |
|---|---|---|---|
de_SizeBlock (index 1) and de_SectorPerBlock (index 4) of the environment vector |
Developer Kit 3.1 dos/filehandler.h ($VER: filehandler.h 36.6 (9.8.92)): de_SizeBlock “in longwords: standard value is 128”; de_SectorPerBlock “not used; must be 1”. The same words are on the DE_SIZEBLOCK and DE_SECSPERBLK lines. |
Developer Kit 3.5 ($VER: filehandler.h 44.1 (24.8.1999)): in the structure, de_SizeBlock is “in longwords: Physical disk block size” and de_SectorPerBlock is “N de_SizeBlock sectors per logical block”; the #define lines for DE_SIZEBLOCK and DE_SECSPERBLK still read “standard value is 128” and “not used; must be 1”, so the 3.5 header disagrees with itself. Every other entry reads the same in both kits. |
Both kits give the same table; the two entries above are worded differently. The environment vector table gives the 3.1 meaning, as the vectors on this page are read for volumes with one sector per block. The 3.5 meaning would make the logical block de_SizeBlock × de_SectorPerBlock longwords: AROS’s file system (third-party) computes exactly that (afs/volumes.c: SizeBlock = de_SizeBlock * de_SectorPerBlock, blocksectors = de_SectorPerBlock). The viewer reads the logical block the 3.5 way (de_SizeBlock × de_SectorPerBlock longwords, so 128 and 1 give 512 bytes) and opens the partition when that is a power of two from 512 to 65,536, and says why otherwise. |
The DE_PREFAC disagreement between the header’s “not used; must be 0” and the structure’s de_PreAlloc (“DOS reserved blocks at end of partition”, in both kits) is in the environment vector table.
Described from third-party sources only
No Commodore text found has the items below; each is described from the sources named and is third-party source only. Sources are in samples/adf/sources.
| Item | What the sources say | Sources |
|---|---|---|
| Hardfiles | A hardfile is one Amiga volume in a file, made by an emulator: no RDB, the boot block at block 0, a root block in the middle, bitmap blocks as the root block says (several, with extension blocks above 25), geometry 1 head and 32 sectors per track with as many cylinders as the size needs, and a mount list with Reserved = 1 in the example. The file system is formatted by the Amiga side, so every layout of the other pages applies. The explorer reads a file that has DOS and a flag byte at block 0 and a valid root block at the position its size gives as a volume of its own; the position is (blocks − 1 + reserved) ÷ 2 (AROS afs/volumes.c: (countblocks-1+de_Reserved)/2; Linux super.c: (reserved + size - 1) / 2, and for odd sizes the block after it, which the viewer also tries). The reserved count is not in the file: 2 is tried first, then 1, 3 and 4, and the count for which the root block and the bitmap blocks are marked used is taken. |
Clévy section 7 (“A hardfile is a file which contains an Amiga volume”, the uaehf.device mount list with Reserved = 1, HighCyl = 511, Buffers = 5); AROS afs/volumes.c; Linux fs/affs/super.c. |
| FSHD patch flag bits | Bit 0 0x001 type, bit 1 task, bit 2 lock, bit 3 handler, bit 4 stack size, bit 5 priority, bit 6 startup, bit 7 0x080 segment list block, bit 8 0x100 global vector; 0x180 is bits 7 and 8, as in Clévy’s example. Bits 9 and up are not defined anywhere read, and the viewer says so when one is set. The table is above. |
amitools rdb/FSHeaderBlock.py (get_flags, default mask 0x1FF); Clévy (the 0x180 example). |
| The usual maximum transfer and mask, buffers and flags | Maximum transfer: often $7FFFFFFF (Clévy) or $00FFFFFF (amitools’ default). Mask: often $FFFFFFFE (Clévy) or $7FFFFFFE (amitools’ default). Buffers: often 30 (Clévy, amitools), 5 in the mount list example. RDSK flags: typically $17 (Clévy; amitools default). Host id 7. They are habits of the tools that wrote disks, not rules: Commodore’s header only says “Max number of bytes to transfer at a time” and “Address Mask to block out certain memory”. AROS’s file system treats a zero maximum transfer as unlimited (volumes.c). |
Clévy, PART table (MaxTransfer, Mask, NumBuffer) and RDSK table (flags “typically 0x17”, hostID); amitools rdb/PartitionBlock.py and RDBlock.py (default arguments); AROS afs/volumes.c. |
UNI\x and other DOS type ids |
UNI\0 is the AT&T System V file system, UNI\1 a Unix boot file system, UNI\2 a BSD file system for System V; resv marks reserved (swap) space. The viewer shows these ids as text and does not name them. |
Clévy, the DosType description of the PART table. |
What the viewer does
- Partitions as volumes. Every PART block gives a row in the partition table (name, DOS type, cylinders, blocks, size, boot priority, flags, the DosEnvec geometry, the first four bytes of the partition’s own boot block and whether it opens). A partition with a non-empty cylinder range, an end inside the file and a logical block of 512 to 65,536 bytes (a power of two) opens as a level of its own, named
<drive name>.adf, with its first sector atLowCyl × Surfaces × BlocksPerTrackand(HighCyl − LowCyl + 1) × Surfaces × BlocksPerTracksectors, counted in the blocks of the Rigid Disk Block, from the DosEnvec of that partition; the level is read like any floppy, with the bitmap checked against the tree and the other checks of the disk blocks page. The logical block is read the Developer Kit 3.5 way (above):de_SizeBlocklongs make a sector andde_SectorPerBlocksectors make a block, so 128 longs and 1 sector is 512 bytes, 256 longs and 1 sector is 1,024 bytes, and 128 longs and 2 sectors is 1,024 bytes too (a 0 inde_SectorPerBlockis taken as 1). The volume reader finds the block size of the volume itself from its root block (block sizes); when it differs from the DosEnvec’s the partition still opens and the difference is a problem. A partition whose block is not a power of two from 512 to 65,536, whose length is not a whole number of blocks, or that does not meet the other conditions is listed and reported as a problem with the reason. - Bad blocks. The BADB pairs are collected (
(SummedLongs − 6) / 2pairs a block, an unused pair of two zeros or two$FFFFFFFFends a block’s list) and, when a bad block lies inside a partition, the partition is not offered as a slice of the file but as a rebuilt copy in which each such block (counted in the Rigid Disk Block’s blocks from the start of the disk) is replaced by its good block, wherever that lies; the table says how many were replaced. The copy is made as it is read, block by block, so a partition of gigabytes with a bad block is read without ever holding it whole (as a windowed source of the engine, when it is over the 256 MB the explorer keeps of a decoded level). A pair that names a block off the disk, or a block replaced by itself, is a problem and is not applied. A bad block listed twice is one problem too, but the first pair is applied and the later pair is ignored (the problem says “the first pair is used”). Only one step is made: a good block that is itself listed as bad is not followed. - File system code. The LSEG blocks of an FSHD are joined in order and offered as a HUNK file; the LSEG and BADB blocks show their fields (the bad block pairs one by one).
- Hardfiles and
.hdf. The registry row for.hdfkeeps HDF5 and HDF4 first, by their magic numbers; a third entry, “Amiga hardfile”, is taken when the strict test passes (anRDSKblock with a correct checksum in the first 16 blocks, orDOSand a flag byte at block 0 with a root block of type 2, secondary type 1 and a correct checksum at a position its size allows); anything else keeps the neutral HDF entry. A hardfile is shown as one volume, labelled as a hardfile or partition image.
Not described
Known, not yet covered
- Reference: a second real RDB image was read in round 14: a backup of the hard disk of an A2500 (41,998,336 bytes, from an archive.org item,
samples/adf/real/hdisk-a2500): 512-byte blocks, drive string “QUANTUM P40S 940-40-94xx 6.3”, 1,171 cylinders, 1 head, 70 sectors, one partitionDH0of typeDOS\1, and a file system header block withDOS\1and version 0 (patch flags 0x180). The viewer reads it with no Problem. It is again 512-byte blocks, so the unknown below stays open. The AROS partition code (rom/partition/partitionrdb.c, third-party, read in round 14) scans for the RDB with the device’s sector size, applies its checksum rule over the block-size count in the header and takes the sector size fromrdb_BlockBytes; that is a second implementation, not a real image. - Reference: one real RDB image was found in round 11 (ADFlib’s
a590_WD93028XA_6parts.hdd, 21,620,736 bytes, 512-byte blocks, partitioned and formatted by AmigaOS 3.1 in an emulated A1200 according to ADFlib’sinfo.txt): its six partitions (DOS\0 to DOS\5, Reserved 2, 2 surfaces, 27 blocks per track, no file system header block) read the same through the viewer and through an independent walk, and every partition volume opens with no Problem. It has no hardfile, no block size other than 512 and no bad block list, so those parts stay checked on built images only. The layout is also checked against Commodore’s ownhardblocks.handfilehandler.h(Developer Kit 3.1 text, and the 1991 Reference Manual’s OCR listing) and agrees with AROS, Clévy and amitools field by field, but all the images the viewer was tested on were built from the description. - Reference: what the FSHD device-node fields mean in practice beyond Commodore’s “zero placeholder” comments, what a driver does with the bad block pairs, and the standard names of other file system ids (
UNI\0and the like are from Clévy alone). - Reference:
DE_PREFAC: Commodore’s header calls it unused and must be 0, while its structure comment and Beats’ 1989 text describe it as reserved blocks at the end of the partition used by FFS; the sources disagree and a real partition image was not available to see which values occur. - Reference: the Developer Kit 3.5
dos/filehandler.h(44.1) re-wordsde_SizeBlockandde_SectorPerBlock; both readings and the 3.5 header’s own disagreement are stated above. What stays open: no Commodore text says which release first honoured ade_SectorPerBlockabove 1, and no disk or partition image with one was available. - Reference: hardfiles are described from Clévy and the root block rule of AROS and Linux only (third-party source only): no Commodore text exists for them (they come from emulators), and no real hardfile was available to check the root block position, the reserved count or the bitmap on (the six partitions of the real image above, opened as volumes of their own, have the root block at the middle of the volume,
(blocks - 1 + Reserved) / 2rounded down: 3,078 of 6,156 blocks and 5,670 of 11,340, with a boot block that names no root block, the long at offset 8 being 0). - Viewer: see what the viewer does. Partitions open as volumes (512 to 65,536-byte blocks, one or more sectors per block), the bad block pairs are applied to the partitions they fall in, the FSHD code is joined and offered as a HUNK file (the code inside is read by the HUNK viewer, not here),
.hdfhardfiles (including Reserved 1) and RDB images are recognised. What is not done, and why: the geometry of a partition (LowCyl,BlocksPerTrack) is counted in the blocks of the Rigid Disk Block, and whende_SizeBlocksays another size the sources disagree on which unit the geometry then uses (AROS counts it inde_SizeBlocksectors; the Linux partition reader counts it in the Rigid Disk Block’s blocks and ignoresde_SizeBlock; the viewer reports the difference as a problem and keeps the Rigid Disk Block’s unit, as Linux does); a bad block whose replacement is itself bad is not followed, and the replacement is applied by reading, never to the Rigid Disk Block’s own blocks; the bad block remapping rests on the field names ofhardblocks.honly, since neither amitools (“TODO: add bad block blocks”) nor ADFlib implements it and no real BADB block was available;de_BootBlocks(the boot block count when the table is long enough, AROS) is not used, and neither is the DosEnvecReservedfield for the volume level: the partition opens as an image of its own and the reserved count (1, 2, 3 or 4) is read from the bitmap, the first count for which the bitmap marks the root block and the bitmap blocks as used, so the volume reader cannot be told a count the bitmap does not show (for a partition of a Rigid Disk Block a Problem on the partition says when its DosEnvecReservedis not 2; a volume opened on its own, such as a hardfile or the partition image, gets only the “Boot blocks” row and no Problem). Images, partitions and hard disk images are read block by block up to 253 bytes (8 PiB, the exact byte positions of a JavaScript number); the Rigid Disk Block and its partitions are read the same way whatever the size, tested with sparse sources of 2 GiB and, for volumes, 8 GiB, 64 GiB and 3 TiB. All of it was tested on images built from this page, because no RDB disk or hardfile was available.
Unknown
- Reference: an RDB on blocks larger than 512 bytes: the Commodore header says only the first 256 bytes of every block but LSEG are used and the structures “assume 512 byte blocks” where an array length depends on it. No Commodore text beyond that statement, and no image, shows such an RDB. Round 9 found one implementation that reads them: the Linux partition reader (
block/partitions/amiga.c, third-party, read for checking) looks forRDSKat the start of each of the first 16 blocks counted in 512-byte units (so the Rigid Disk Block sits at byte 0 to 8,191 whateverrdb_BlockBytessays, as this viewer also does), takesblksize = rdb_BlockBytes / 512, multiplies every block pointer it follows (the partition list and eachpb_Next) by it, counts the geometry in RDB blocks (cylblk = Surfaces × BlocksPerTrack × blksizesectors, start =LowCyl × cylblk, size =(HighCyl − LowCyl + 1) × cylblk), ignoresde_SizeBlockand reads the DosEnvec at the same offsets (ReservedandSectorPerBlockare only printed), sumsSummedLongs & 0x7Flongs, and accepts an RDSK block whose sum is wrong only because the long at0xDCwas overwritten (“Windows might have trashed it”). The viewer does the same in every respect except the mask onSummedLongs, and it reports the trashed-word case as a Problem that says how it adds up (test-adf-huge.mjs). That also answers which unit the geometry uses whende_SizeBlockdisagrees with the Rigid Disk Block (Linux: the Rigid Disk Block’s; AROS:de_SizeBlock): the viewer keeps Linux’s reading and reports the difference. It remains a third-party reading, tested here on built images only, because no real image with blocks over 512 bytes was available. A fourth third-party statement (round 11, amitools’ owndocs/tools/rdbtool.rst, lines 130 to 136 and 167 to 175, on creating and opening disks withbs=1024and larger): “Amigas only support RDBs with a 512 byte block size!”; the Commodore text for it is still missing. Stage 6: the Hyperion HDToolBox notes andhardblocks.hin NDK 3.2 (vendor documents) say Rigid Disk Blocks are sector-sized (rdb_BlockBytes), that any block size works and that 256 is deprecated; the viewer now also looks forRDSKat multiples ofrdb_BlockBytes(1024 to 65536) inside the first 16 such blocks. Still no real image with blocks over 512 bytes. - Viewer, round 11: for every partition that opens as a volume the viewer now compares the DosEnvec
Reservedwith the boot area that the volume’s own bitmap implies and reports a difference as a Problem (the volume is still shown with the count the bitmap gives, because the volume reader is opened on the slice alone and is not passed the count). It also checksde_BootBlockswhen the DosEnvec table has at least 19 entries and the long is not 0 (RKRM Devices, boot chapter: 0, or a shorter table, means BootPoint booting; otherwise that many blocks are read from the start of the partition and must start withDOSand add up to 0xFFFFFFFF with carry): a partition whose first blocks do not is reported. The real 3.1 image has 16-entry tables with Reserved 2 and no BootBlocks long, so neither check fires there; both are tested on edited copies of it (test-adf-real-11.mjs).