RISCOS.com

www.riscos.com Technical Support:
Programmer's Reference Manual

 

FileSwitch


Introduction and Overview

Under RISC OS 3.6 FileSwitch has been extended to support larger capacity storage devices, such as those now supported by FileCore-based filing systems.

The only change made has been to provide three new reason codes for OS_FSControl, each of which duplicates previously available functionality, but allows 64 bit values to be passed or returned instead of 32 bit values.

New OS_FSControl reason codes

The three new reason codes are:

R0 Action
55 Read the free space on the disc or image file that holds a specified object
56 Return the defect list for an image
57 Map out a defect from an image

New filing system entry points

For each of the new OS_FSControl reason codes, a corresponding new reason code has been added to those that may be passed to a filing system's FSEntry_Func entry point and to an image filing system's ImageEntry_Func entry point.

If you are writing a filing system, and hence need to know the details of these new reason codes, you should see Writing a filing system.

SWI Calls


OS_FSControl 55
(SWI &29)

Reads the free space on the disc or image file that holds a specified object

On entry

R0 = 55 (reason code)
R1 = pointer to name of object (null terminated)

On exit

R0 = bits 0 - 31 of free space
R1 = bits 32 - 63 of free space
R2 = largest creatable object
R3 = bits 0 - 31 of disc size
R4 = bits 32 - 63 of disc size

Use

This call reads the free space on the disc or image file that holds the specified object. It also returns the size of the largest creatable object, and the size of the disc.

This call is similar to OS_FSControl 49, except the values for disc size and free space returned are 64 bit values. If an error occurs, this may mean the filing system does not support this call, in which case you should then try OS_FSControl 49.

This call is only available from RISC OS 3.6 onwards, and returns incorrect information for NetFS.


OS_FSControl 56
(SWI &29)

Returns the defect list for an image

On entry

R0 = 56 (reason code)
R1 = pointer to name of image (null terminated)
R2 = pointer to buffer
R5 = buffer length

On exit

R0 preserved
R1 = number of defects placed in buffer
R2, R5 preserved

Use

This call fills the given buffer with a defect list, which gives the byte offset to the start of each defect. Each entry in the list is a pair of words - with the least significant one first - giving the address of the defect as a 64 bit value.

This call is similar to OS_FSControl 41. If an error occurs, this may mean the filing system does not support this call, in which case you should then try OS_FSControl 41.

This call is only available from RISC OS 3.6 onwards, and returns incorrect information for NetFS.


OS_FSControl 57
(SWI &29)

Maps out a defect from an image

On entry

R0 = 57 (reason code)
R1 = pointer to name of image (null terminated)
R2 = bits 0 - 31 of offset to start of defect
R3 = bits 32 - 63 of offset to start of defect

On exit

R0 - R2 preserved

Use

This call maps out a defect from the given image.

This call is similar to OS_FSControl 42, except the offset to the defect is passed as a 64 bit value. If an error occurs, this may mean the filing system does not support this call, in which case you should then try OS_FSControl 42.

This call is only available from RISC OS 3.6 onwards, and returns incorrect information for NetFS.

This edition Copyright © 3QD Developments Ltd 2015
Last Edit: Tue,03 Nov 2015