RISC OS Open

RISC OS  OPEN


A fast and easily customised operating system for devices using ARM processor cores.

Documentation: OS_UpCall 3

Programmer’s Reference Manuals
» Part 15 – SWI Calls
» OS
» OS_UpCall
» OS_UpCall 3

OS_UpCall 3

(SWI &33)

The action performed depends on the reason code value in R9.

Reason Codes

0 &00 Saving memory to file
1 &01 Writing catalogue information
2 &02 Writing load address only
3 &03 Writing execution address only
4 &04 Writing attributes only
6 &06 Deleting file
7 &07 Creating empty file
8 &08 Creating directory
257 &101 Creating and opening for update
258 &102 Opening for update
259 &103 Closing file
512 &200 Ensure file size
520 &208 Renaming file
521 &209 Setting attributes

Saving memory to file

Entry
R0 3
R1 Pointer to filename
R2 Load address
R3 Execution address
R4 Pointer to start of buffer
R5 Pointer to end of buffer
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 0 (reason code)

Exit
R0 Preserved
All registers preserved

Writing Catalogue information

Entry
R0 3
R1 Pointer to filename
R2 Load address
R3 Execution address
R5 Attributes
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 1 (reason code)

Exit
All registers preserved

Writing Load Address only

Entry
R0 3
R1 Pointer to filename
R2 Load address
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 2 (reason code)

Exit
All registers preserved

Writing Execution Address only

Entry
R0 3
R1 Pointer to filename
R3 Execution address
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 3 (reason code)

Exit
All registers preserved

Writing Attributes only

Entry
R0 3
R1 Pointer to object name
R5 Attributes
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 4 (reason code)

Exit
All registers preserved

Deleting File

Entry
R0 3
R1 Pointer to object name
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 6 (reason code)

Exit
All registers preserved

Creating empty file

Entry
R0 3
R1 Pointer to filename
R2 Load address
R3 Execution address
R4 Start address
R5 End address
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 7 (reason code)

Exit
All registers preserved

Creating Directory

Entry
R0 3
R1 Pointer to directory name
R2 Load address (to be used as timestamp)
R3 Execution address (to be used as timestamp)
R4 Number of entries (0 for default)
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 8 (reason code)

Exit
All registers preserved

Creating and Opening for Update

Entry
R0 3
R1 Pointer to filename
R2 External handle that file will be given (if successfully opened)
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 257 (reason code)

Exit
All registers preserved

Opening for Update

Entry
R0 3
R1 Pointer to filename
R2 External handle that file will be given (if successfully opened)
R6 Pointer to special field (or 0)
R8 Filing system information word
R9 258 (reason code)

Exit
All registers preserved

Closing file

Entry
R0 3
R1 External file handle
R8 Filing system information word
R9 259 (reason code)

Exit
All registers preserved

Ensure file size

Entry
R0 3
R1 External file handle
R2 Size to ensure
R8 Filing system information word
R9 512 (reason code)

Exit
All registers preserved

Ensure file size

Entry
R0 3
R1 Pointer to current object name
R2 Pointer to desired object name
R6 Pointer to current special field
R7 Pointer to desire special field
R8 Filing system information word
R9 520 (reason code)

Exit
All registers preserved

Setting Attributes

Entry
R0 3
R1 Pointer to current object name
R2 Pointer to attribute string (control character terminated)
R8 Filing system information word
R9 521 (reason code)

Exit
All registers preserved

Use

The purpose of this call is to warn applications that a file is being modified.

Notes

It is made when a program calls one of several SWI provided by FileSwitch module:
  • Reason codes 0-8 are caused by calls to OS_File
  • Reason codes 257-9 are caused by calls to OS_Find
  • Reason codes 520 & 521 are caused by calls to OS_FSControl
The following general points apply:
  • All strings are 0-terminated except where specified
  • All object names will already have been expanded by FileSwitch, checked for basic validity, and had filing system prefixes stripped
  • Object names will also be canonicalised, except under RISC OS 2.

This UpCall is made before the operation, which may subsequently fail. For example, you may receive a rename UpCall for a locked file, which will subsequently fail to rename (because it’s locked). If a file name is invalid for a given operation (eg you try to create a file with a wildcarded leafname) FileSwitch will generate an error, and no UpCall will be generated.

The call is used by the desktop filer to maintain its directory displays. It’s provided for information only; if you wish to use this UpCall, you must not intercept it, nor must you alter the contents of any of these registers used to pass parameters.

See also

   .