RBF FILESYSTEM FOR LINUX
========================

The RBF filesystem is the native disk format for the OS-9/OS-9000 real-time
operating system from Microware Systems Corp. (now RadiSys).

This is an experimental implementation primarily intended for accessing
existing RBF disks under Linux. There is currently no support for creating
new RBF filesystems under Linux.


RBF allows a wide range of logical block sizes (referred to as sector size)
from 256 bytes to 32k bytes. This implementation has the following limitations
for sector sizes at the high and low extremes:

- if the sector size is less than the physical block size of the disk device,
or 512 bytes (whichever is the larger) then memory-mapped file access (mmap)
is unavailable. Note that this will always apply to filesystems with a
sector size of 256 bytes.

- for sector sizes larger than the system PAGE size (4k for most platforms,
8k for alpha & some others?) this file manager is not fully compatible with
the RBF specification, in that the size of the file segment list is limited
to the first PAGE of the FD sector. An attempt to open a file containing more
than this number of segments will fail with "bad inode".


The following RBF-specific mount options are supported:

debug		Enable runtime debug. Currently a dud (all debug is static)
verbose		Print some information on console when mounting filesystem
quiet		Disables reporting of some errors
dealloc		Always deallocate unused clusters when closing file
keepcase	Do not fold upper/lower case in filenames (*)
paranoid	Perform some runtime integrity checks
nomagic		Mount even if RBF "sync word" is not present in DD sector
nonamecheck	Do not check filenames for RBF conformity (*)
hardlinks	Allow creation of hardlinks (*)
owner		Use 16-bit file owner instead of 8 bit user/group
sector=<size>	Set sector size to be used if not specified in DD sector
sas=<numsect>	Set segment allocation size in sectors
sas=<size>k	Set segment allocation size in kbytes
umask=<mask>	Set file attribute mask Linux->RBF
uid=<uid>	Set file owner id when reading
gid=<gid>	Set file group id when reading
setuid=<user>	Set file owner id when writing
setgid=<group>	Set file group id when writing

(*) if these options are used the resulting filesystem may not be
compatible with a standard RBF file manager.


Notes about mount options:

The standard behaviour of RBF is to allocate disk space in minimum-sized
chunks where the minimum size is specified by the "sas" option. When a file
which is open for writing is closed, any excess space is deallocated ONLY
if the current file position is at end of file. This is supposed to reduce
fragmentation in files which are subject to random access and incremental
expansion, but wastes disk space. If the dealloc option is specified then
the excess space will ALWAYS be deallocated.

RBF normally treats upper and lower case as identical in filenames. The
keepcase option makes case significant but a filesystem written with this
option enabled may not be readable by a standard RBF file manager.

A legal RBF filename may only contain the characters '.', '$', '_' and
alphanumerics and at least one character must be alphanumeric. The nonamecheck
option causes any filename to be accepted. As above, the resulting filesystem
may not be readable by a standard RBF file manager.

Newer RBF filesystems should specify the logical block size in the DD sector.
If not specified the sector size could either be the same as the physical
block size (rbvccs) or 256 bytes (rbsccs). To handle this uncertainty the
sector=<size> option can be used to specify the "default" sector size.
If this option is not present then the default sector size is 256 bytes.

Very old RBF disks may not have the sync word "Cruz" in the DD sector. Such
a disk can still be mounted by specifying "nomagic". Some integrity checks
will still be performed.


Handling of file ownership & attributes

RBF only implements very basic file attributes (owner/public rwx). This file
manager forces group attributes to be the same as public (others).

Originally RBF implemented a 16-bit owner ID, which was later reinterpreted
as 8 bit owner and 8 bit group (strangely it would seem, as there are no
group attributes!)

This implementation uses the 8 bit user & group IDs by default; if mount
option "owner" is specified then the field is interpreted as a 16 bit user ID
and the group ID is set to the gid of the current process. When writing to
disk the owner is set to uid and gid is ignored.

The options "uid" and "gid" override the user/group on disk and force the file
to appear with the specified uid/gid.

The options "setuid" and "setgid" specify overriding values to be written to
disk.

If you have any patches, questions or suggestions regarding this RBF
implementation please contact the author:

Andrew Cannon <ajc@gmx.net>


PS:
Several attempts to reach Andrew Cannon, the author of the original software
version for the 2.4 kernel, by email failed. If you have any patches, questions
or suggestions regarding this RBF implementation, you may also contact
Carsten Emde at the Open Source Automation Development Lab (OSADL).

Carsten Emde <C.Emde@osadl.org>
http://www.osadl.org/
