AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
=>     R0 =     0 (NoOp)
           1 (GetFSName)
           2 (GetFreeSpace)
           3 (CompareDevice)
           4 (GetFreeSpace64)
     others dependant on R0

The routine will be called in User mode with a stack consisting only of the return address (no other use should be made of it). The routine can either:
·     construct a new stack.
·     use the SVC stack by calling OS_EnterOS, remembering to return to User mode before returning.
·     do all the hard work with a SWI (PRM suggests OS_FSControl 49 for reason 2, but this still alters registers that must be preserved somewhere...)

The routine should exit using:
·     LDMIA R13!,{PC}

See also:     PRM 2-5125a-2575a-665
Free GetFSName (1)
=>     R0 =     1 (GetFSName)
     R1 =     FS number
     R2 =     pointer to buffer
     R3 =     pointer to device or ID
<=     R0 =     number of bytes placed into the buffer, including the terminator
     R1-R3 preserved

You should expand the device or ID into a name, and copy it to the buffer at R2, and update R0.

See also:     PRM 2-513 5a-258
Free GetFreeSpace (2)
=>     R0 =     2 (GetFreeSpace)
     R1 =     FS number
     R2 =     pointer to 3 word buffer
     R3 =     pointer to device or ID
<=     R0-R3 preserved, R2 buffer :
           0 = total size of device (or 0 if unchanged)
           4 = free space on device
           8 = used space on device

This is used to find the free space on a device, which should be written to the buffer. On RISC OS 3.60 or later, reason code 4 is used in preference to this, but this should also be supported.

See also:     PRM 2-5145a-258
Free CompareDevice (3)
=>     R0 =     3 (CompareDevice)
     R1 =     FS number
     R2 =     pointer to filename
     R3 =     pointer to device or ID
     R6 =     pointer to special field
<=     R0-R3 and R6 preserved
     Z set if R2, R6 point to a file on R3.

This call is used to check if a file exists on a particular drive. A fast filing system (RAMFS) is allowed to always return Z set.

See also:     PRM 2-5145a-258
Free GetFreeSpace64 (4)
=>     R0 =     4 (GetFreeSpace64)
     R1 =     FS number
     R2 =     pointer to a 6 word buffer
     R3 =     pointer to device name or ID
<=     R0 =     0
          R1 - R3 preserved, R2 buffer updated.

This is used to find the free space on a device. From RISC OS 3.60, this call is used rather than 2. If R0 is non-zero on exit, or if an error occurs, then reason code 2 is called. Thus your routine must give an error for both reason codes 4 and 2 before Free will believe it.

See also:     PRM 5a-258
Buffer contents for Free GetFreeSpace64
The format of the buffer is as follows:

Offset     Meaning

[0,4]     total size of device (or 0 if unchanged)
[8,12]     free space on device
[16,20]     used space on device

The bit order for the pairs of word are:

Word     Bits

0     0-31
4     32-63

[sh-index] Back to list of manuals