SITS file system
This is a partial description of the SITS file system disk format. It should be good enough for reading data, but not writing.
To SITS, an RK05 disk pack is viewed as 2436 blocks of 1024 bytes. In the file system, block addresses are linear.
Directory format
A directory is a series of entries that each describe one file or subdirectory.
Block 46 (octal) on a disk pack is the root directory for that pack. The root directory should have the files DESCR and BITS; they are not yet covered in this description.
The entry begins with a header, after which follows some optional data.
Offset | Size | Description |
---|---|---|
0 | 1 | Entry size |
1 | 1 | Flags |
2 | 2 | Version |
The flags field has these bits.
EOFB | ACCB | SHRB | MFISTB | ||||
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
The EOFB flag bit signals the header is followed by end-of-file and timestamp data.
Offset | Size | Description |
---|---|---|
0 | 2 | File size in 8192-byte pages, rounded down. |
2 | 2 | Additional bytes in file size. |
4 | 2 | Timestamp date. |
6 | 2 | Timestamp time. |
The timestamp date and time are formatted like this:
Year - 1900 | Month | Day | |||||||||||||
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
Hour | Minute | Second / 2 | |||||||||||||
15 | 14 | 13 | 12 | 11 | 10 | 09 | 08 | 07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
The ACCB flag bit signals the presence of access protection data, which is a series of three-byte blocks. The last block has bit 7 cleared.
Next in the entry comes the name. It's an ASCII string with the last byte having bit 7 cleared.
Finally comes a descriptor that specifies the file data blocks. It runs until the end of the entry as per the length field in the header. The descriptor is a series of bytes that specify linear block numbers. The current block number starts at 0 and is modified as the bytes are parsed. Skip means add to the current block number. Pick means to include a range of blocks in the file.
Descriptor type 0: skip n blocks, and pick one data block.
0 | n | ||||||
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
Descriptor type 1: pick n+1 data blocks.
1 | n | ||||||
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
Descriptor type 2: set the current block number to the next little endian 16-bit, and pick n+1 data blocks.
2 | n | ||||||
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |
Descriptor type 3: skip n blocks, and pick m+1 data blocks.
3 | n | m | |||||
07 | 06 | 05 | 04 | 03 | 02 | 01 | 00 |