www.riscos.com Technical Support:
The Free module has been updated in RISC OS 3.6 to support displaying free space in the desktop for filing systems with discs of more than 4 GB capacity.
If a filing system's free space routine does not recognise a reason code passed to it, it should return with all registers preserved.
A new reason code has been defined in RISC OS 3.6 for the filing system's free space routine (as registered using this call). The new reason code (4) returns the free space on the disc in 64 bits, rather than the 32 bits allowed by reason code 2:
R0 = 4
R1 = filing system number
R2 = pointer to 6 word buffer
R3 = pointer to device name / ID
R0 = 0
R1 - R3 preserved
This entry point is called to get the free space for a device. You should fill in the buffer pointed to by R2 with the following information:
|0||bits 0 - 31 of total size of device (0 if unchanged from last time read)|
|4||bits 32 - 63 of total size of device (0 if unchanged from last time read)|
|8||bits 0 - 31 of free space on device|
|12||bits 32 - 63 of free space on device|
|16||bits 0 - 31 of used space on device|
|20||bits 32 - 63 of used space on device|
From RISC OS 3.6 onwards, the Free module calls this reason code to find the free space, rather than calling reason code 2. If R0 is non-zero on exit (ie unaltered), or if an error is generated, the Free module then calls reason code 2. Thus when returning an error from this reason code, your free space routine must also return the same error for reason code 2 before the Free module believes it to be an error.