I've started reverse-engineering the disk format for Model II
TRSDOS-II 4.2. (I'd still like to get images of other TRSDOS
versions.) I haven't actually started disassembling the code yet.
I've gotten to the point of being able to extract unfragmented text
files and BASIC programs from a floppy image, and that was the primary
objective, so it's possible that I might not have to pursue the
reverse-engineering any further.
I was pretty sure before I started that they had switched to 16
512-byte sectors per track (vs. 26 256-byte in Model II TRSDOS 1.2 and
2.0). That is the case, but they still logically deal with it as
256-byte blocks, so they must have put in code to do blocking and
deblocking. They do allocation in units of the 256-byte blocks,
rather than in granules.
The most interesting part is that they use a hierarchical directory
structure. I'm not sure what versions of TRSDOS-II 4.x are covered by
the manual I have, but the manual doesn't say anything about
subdirectories, so perhaps they aren't made available to the end user.
The root directory on the disk image I'm examining has room for four
entries, of which only two are used, for SYSTEM/DIR and USER001/DIR.
As one might guess, all of the system files are in the former, and
user files go in the latter.
The filename portion of a directory entry is no longer rigidly 8+3,
but is now a 24-character field with the slash separating the filename
and extension explicitly included. If TRSDOS-II 4.2 limits the
filename to 8+3, that isn't due to the on-disk filesystem structure,
but might be enforced for compatibility with earlier versions of
TRSDOS.
A directory entry now contains a linear block number of an index block
for the file. Actually it contains two linear block numbers, for the
index blocks of a primary and a backup copy of the file, but I've only
seen this used in the root directory for the index blocks for the
primary and backup SYSTEM/DIR and USER001/DIR directories. The
superblock contains two linear block numbers for the index blocks of
the two copies of the root directory.
As far as I can tell, they have abandoned using a HIT (Hash Index
Table) to speed directory searches, as was done in the earlier
versions of Model II TRSDOS, as well as TRSDOS and compatible
operating systems for the Model I/III/4.
The index block apparently contains a list of extents, each of which
is specified by a starting linear block number and a block count. The
floppy image I'm examining has no fragmented files, so I've only seen
a single extent in each index block, and am only assuming that
additional extents pointers would be consecutively stored after the
first. I'm not sure whether they can support a file needing more
extents than can be listed in a single index block.
The linear block numbers are probably three or four bytes, to support
hard drives, but since I've only examined a floppy disk, I've only
seen two bytes used, with the following two bytes being zero and
presumed to be the high order part of the block number. Oddly enough,
the low 16 bits of the block number is stored in big-endian form,
which is unnatural on the 8080/Z80 processors. However, since a 24 or
32 bit block number would have the 8 or 16 bits stored after the low
16 bits, it is a mixed-endian format.
The format of SYSTEM/SYS, the system overlay file, has changed again.
They now use smaller overlays, most of which are only 256 or 512
bytes, but there are a lot more of them than there were in 1.2 and
2.0.
Eric
Show replies by date
I probably should have mentioned that since track 0 on a bootable disk
is single density (FM) with 26 sectors of 128 bytes, the usable
content of a bootable single-sided TRSDOS-II floppy starts on track 1
with block 32, so the blocks are numbered as if track 0 was the same
format as tracks 1 and up.
I haven't got an image of a double-sided TRSDOS-II floppy, so I don't
know exactly how they map the blocks with that.