Showing changes from revision #5 to #6:
Added | Removed | Changed
Offset | Contents | |
---|---|---|
&00 | Offset of filing system name (null terminated) | |
&04 | Offset of filing system startup text (null terminated) | |
&08 | Offset of routine to open files | (FSEntry_Open) |
&0C | Offset of routine to get bytes from media | (FSEntry_GetBytes) |
&10 | Offset of routine to put bytes to media | (FSEntry_PutBytes) |
&14 | Offset of routine to control open files | (FSEntry_Args) |
&18 | Offset of routine to close open files | (FSEntry_Close) |
&1C | Offset of routine to do whole file operations | (FSEntry_File) |
&20 | Filing system information word (see below) | |
&24 | Offset of routine to do various FS operations | (FSEntry_Func?) |
&28 | Offset of routine to do multi-byte operations | (FSEntry_GBPB) |
&2C | Extra filing system information word (optional) |
The offsets held in each word are from the base of the filing system module. The GBPB entry (at offset &28 from the start of the information block) is optional if the filing system supports non buffered I/O, and not required otherwise.
The block need not exist for long, as FileSwitch takes a copy of it and converts the entry points to absolute addresses. So you could set up the block as an area in a stack frame, for example.
The filing system information word (at offset &20) tells FileSwitch various things about the filing system:
Bit | Meaning if set |
---|---|
31 | Special fields are supported |
30 | Streams are interactive (ie prompting for input is appropriate) |
29 | Filing system supports null length filenames |
28 | Filing system should be called to open a file whether or not it exists |
27 | Tell the filing system when flushing by calling FSEntry_Args 255 |
26 | Filing system supports FSEntry_File 9 |
25 | Filing system supports FSEntry_Func? 20 |
24 | Reserved – must be zero |
23 | Filing system supports image filing system extensions |
22 | Pass & and % in paths when appropriate |
21 | Need not store directories for this filing system |
20 | Use Open/GetBytes/Close entry points rather than File 255 |
19 | Use Open/PutBytes/Close entry points rather than File 0 |
18 | Use FSEntry_Func 9 in preference to FSEntry_File entry points |
17 | Extra filing system information word is present (see below) |
16 | Filing system is read-only |
15 – 8 | Maximum number of files that may be open (see below) |
7 – 0 | Filing system number |
Bits 16 – 23 are ignored by RISC OS 2. File systems that were written for RISC OS 2 should have these bits clear, which may cause problems: for example, RISC OS 2 read-only filing systems will incorrectly have bit 16 clear.
Bits 8 – 15 tell FileSwitch the maximum number of files that can be easily opened on the filing system (per server, if appropriate). A value of 0 means that there is no definite limiting factor – DMA failure does not count as such a factor. These bits may be used by system extension modules such as the Font Manager to decide whether a file may be left open or should be opened and closed as needed, to avoid the main application running out of file handles.
Bits 0 – 7 contain the filing system identification number.
The extra filing system information word is present if bit 17 of the filing system information word is set. If absent, it is assumed by FileSwitch to have value zero. The meaning of the bits in the word is as follows:
Bit | Meaning if set |
---|---|
0 | Filing system supports FSEntry_Func? 34 |
1 | Filing system should be called to do Cat |
2 | Filing system should be called to do Ex |
3 | Filing system supports FSEntry_Args 11 |
4 | Reserved for RISC OS Select (exclude from special case FS table) |
5 – 31 | Reserved – must be zero |
You should only set bits 1 and 2 if your filing system provides a non-standard format for Cat and Ex respectively.