Showing changes from revision #2 to #3:
Added | Removed | Changed
There are two different types of directories that FileCore currently supports. They are:
Directories | Size (entries) | Size (bytes) | Top bit set chars |
---|---|---|---|
47 | 1280 | No | |
77 | 2048 | Yes |
Both Diretory Types are very similar in their structure, but with subtle differences. Both are detailed separately so they can be understood more easily.
The directory format is as follows:
Data Field | Description |
---|---|
DirHeader | Specifies the start of a Directory |
Entries [n]1 | Specifies attributes such as Load/Address and Read/Write access for each entry |
DirTail | Specifies other miscellaneous attributes such as name and disc address of parent |
1 Where n = 47
Name | Bytes | Meaning |
---|---|---|
Name | Bytes | Meaning |
---|---|---|
StartMasSeq | 1 | Update sequence number to check dir start with dir end |
StartName | 4 | ‘Hugo’ or ‘Nick’2 |
2 For reasons of compatability, L-format discs should use ‘Hugo’. For all other formats, either ‘Nick’ or ‘Hugo’ can be used.
Name | Bytes | Meaning |
---|---|---|
DirObName | 10 | Name of object |
DirLoad | 4 | Load address of object |
DirExec | 4 | Exec address of object |
DirLen | 4 | Length of object |
DirIndDiscAdd | 3 | Indirect disc address of object |
OldDirObSeq | 1 | ??? |
Name | Bytes | Meaning |
---|---|---|
OldDirLastMark | 1 | 0 to indicate end of entries |
OldDirName | 10 | Directory name |
OldDirParent | 3 | Indirect disc address of parent directory |
OldDirTitle | 19 | Directory title |
Reserved | 14 | Reserved – must be zero |
EndMasSeq | 1 | To match with StartMasSeq |
EndName | 4 | ‘Hugo’ or ‘Nick’, to match with StartName |
DirCheckByte | 1 | Check byte on directory |
The directory format is as follows:
Data Field | Description |
---|---|
Specifies the start of a Directory | |
Specifies attributes such as Load/Address and Read/Write access for each entry | |
Specifies other miscellaneous attributes such as name and disc address of parent |
1 3 Where n = 77
Name | Bytes | Meaning |
---|---|---|
StartMasSeq | 1 | Update sequence number to check dir start with dir end |
StartName | 4 | ‘Hugo’ or ‘Nick’4 |
4 For reasons of compatability, L-format discs should use ‘Hugo’. For all other formats, either ‘Nick’ or ‘Hugo’ can be used.
Name | Bytes | Meaning |
---|---|---|
DirObName | 10 | Name of object |
DirLoad | 4 | Load address of object |
DirExec | 4 | Exec address of object |
DirLen | 4 | Length of object |
DirIndDiscAdd | 3 | Indirect disc address of object |
NewDirAtts | 1 | Object attributes |
Bit | Meaning when set |
---|---|
0 | Object has owner read access |
1 | Object has ownver write access |
2 | Object is locked |
3 | Object is a directory |
4 | Object is executable5 |
5 | Object has public read access |
6 | Object has public write access |
7 | Reserved (must be zero) |
5 Bit 4 is treated as a second owner read bit; if either this bit or bit 0 are set, the object is treated as having owner read access
Name | Bytes | Meaning |
---|---|---|
NewDirLastMark | 1 | 0 to indicate end of entries |
Reserved | 2 | Reserved – must be zero |
NewDirParent | 3 | Indirect disc address of parent directory |
NewDirTitle | 19 | Directory title |
NewDirName | 10 | Directory name |
EndMasSeq | 1 | To match with StartMasSeq |
EndName | 4 | ‘Hugo’ or ‘Nick’, to match with StartName |
DirCheckByte | 1 | Check byte on directory |
The last entry is indicated by there being a 0 in the first byte of the next entry’s DirObName. The xxxDirLastMark entry is there so that when the directory is full, and hence the last entry is not followed by a null DirObName, it is still followed by a null byte to indicate the end of the directory.
DirObNames and DirNames are control character terminated, and may be the full length of the fields they occupy (in which case there is no terminator).
The indirect disc address of an object on an old map disc is the most significant 3 bytes of its physical disc address. The indirect disc address of an object on a new map disc is the least significant 3 bytes of its internal disc address.
StartMasSeq and EndMasSeq are there to check whether the directory was completely written out when it was last written out. For an unbroken directory they are always equal, and are increased by one (wrapping at 255 back to 0) whenever the directory is updated. This means that if the writing of the directory was stopped halfway through then the start and end master sequence numbers will not be the same, and so the directory will then be identified as broken. Their values should equal each other, but, apart from that, they can be anything.
This is an accumulation of the used bytes in a directory. The used bytes are all the bytes excluding the hole between the last directory entry and the beginning of the structure at the tail of the directory. The generation of the check byte is best described as an algorithm:
Starting at 0 an accumulation process is performed on a number of values. Whatever the sort of the value (byte or word) it is accumulated in the same way. Assuming r0 is the accumulation register and r1 the value to accumulate this is the accumulation performed:
EOR r0, r1, r0, ROR #13