RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

FileCore Error Numbers

Programmer's Reference Manuals
» Part 15 – SWI Calls
» FileCore
» FileCore_DiscOp
» Error Numbers

Error Numbers

Old Style Error Codes.

This whole scheme is predicated on addresses having their top bits clear.

Bit 31 Bit 30 Bit Meaning
Clear Clear 0 – 7 Error number
8 – 29 Clear
Set Clear 0 – 20 Disc byte address / 256
21 – 23 Drive number
24 – 29 Disc error number
Clear Set   R0 is an error pointer, (after bit 30 is cleared)
Set Set 0 – 29 Pointer to a two-word block:
  Offset +0:
0 – 7 Disc error number
8 – 29 Clear
  Offset +4:
0 – 28 Disc sector number
29 – 31 Drive number

New Style Error Codes.

For the new scheme, this is changed to use the least significant bits to distinguish the types:

R0 < 256: R0 = disc error number

Else:

Bit 1 Bit 0 Bit Meaning
Clear Clear   R0 is an error pointer
Clear Set   R0 is an error pointer (once bit 0 is cleared); Points to a three word block:
  Offset +0:
0 – 7 Drive number
8 – 15 Disc error number
16 – 31 Clear
  Offset +4:
  64-bit bits address
Set Clear   Reserved for future use
Set Set   Reserved for future use

Clearly, this scheme is not compatible with the old-style error codes, but the two forms can easily be mechanically converted between.

To use this error scheme, a FileCore module must set bit 10 in the descriptor block passed to FileCore_Create.

However, if you wish your module to work with older versions of FileCore, you must return old-style errors when running with such a version. These versions can be distinguished by calling FileCore_Features after registering. If no error is returned, and bit 0 of R0 is on exit, you are running on a new FileCore, and should return the new error codes. Otherwise, you should return the old error codes – this can be easily be dealt with by using new-style errors throughout the core of your module, and putting a small conversion veneer on the error exit cases from your entry points.

Note that the same error codes are used in the process error word of background transfer scatter lists; these should also use either the old or new scheme appropriately.

If you are returning new-style errors, you must also store the most significant 30 bits of the block pointer in the background transfer process status word (i.e. bits 29-0 of process status correspond to bits 31-2 of the address of the scatter list entry corresponding to an error).

See also

  • FileCore
  • FileCore FS Descriptor Block
  • FileCore_Create
  • FileCore_DiscOp
  • FileCore_DiscOp FS Specific Error Numbers
Revised on May 4, 2012 10:37:10 by Jon Abbott (1421)? (81.151.118.88)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source | Linked from: FileCore_DiscOp, FileCore_DiscOp FS Specific Error Numbers, FileCore_DiscOp64, FileCore FS Descriptor Block

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
  • Export
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys