^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Acorn Disc Filing System - ADFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Filesystems supported by ADFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) -----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) The ADFS module supports the following Filecore formats which have:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) - new maps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) - new directories or big directories
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) In terms of the named formats, this means we support:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) - E and E+, with or without boot block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) - F and F+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) We fully support reading files from these filesystems, and writing to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) existing files within their existing allocation. Essentially, we do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) not support changing any of the filesystem metadata.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) This is intended to support loopback mounted Linux native filesystems
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) on a RISC OS Filecore filesystem, but will allow the data within files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) to be changed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) If write support (ADFS_FS_RW) is configured, we allow rudimentary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) directory updates, specifically updating the access mode and timestamp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Mount options for ADFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) ============ ======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) uid=nnn All files in the partition will be owned by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) user id nnn. Default 0 (root).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) gid=nnn All files in the partition will be in group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) nnn. Default 0 (root).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ownmask=nnn The permission mask for ADFS 'owner' permissions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) will be nnn. Default 0700.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) othmask=nnn The permission mask for ADFS 'other' permissions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) will be nnn. Default 0077.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ftsuffix=n When ftsuffix=0, no file type suffix will be applied.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) When ftsuffix=1, a hexadecimal suffix corresponding to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) the RISC OS file type will be added. Default 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) ============ ======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) Mapping of ADFS permissions to Linux permissions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) ADFS permissions consist of the following:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) - Owner read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) - Owner write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) - Other read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) - Other write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) (In older versions, an 'execute' permission did exist, but this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) does not hold the same meaning as the Linux 'execute' permission
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) and is now obsolete).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) The mapping is performed as follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) Owner read -> -r--r--r--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) Owner write -> --w--w---w
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) Owner read and filetype UnixExec -> ---x--x--x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) These are then masked by ownmask, eg 700 -> -rwx------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) Possible owner mode permissions -> -rwx------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) Other read -> -r--r--r--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) Other write -> --w--w--w-
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) Other read and filetype UnixExec -> ---x--x--x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) These are then masked by othmask, eg 077 -> ----rwxrwx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) Possible other mode permissions -> ----rwxrwx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) Hence, with the default masks, if a file is owner read/write, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) not a UnixExec filetype, then the permissions will be::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) -rw-------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) However, if the masks were ownmask=0770,othmask=0007, then this would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) be modified to::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) -rw-rw----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) There is no restriction on what you can do with these masks. You may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) wish that either read bits give read access to the file for all, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) keep the default write protection (ownmask=0755,othmask=0577)::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) -rw-r--r--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) You can therefore tailor the permission translation to whatever you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) desire the permissions should be under Linux.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) RISC OS file type suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) RISC OS file types are stored in bits 19..8 of the file load address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) To enable non-RISC OS systems to be used to store files without losing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) file type information, a file naming convention was devised (initially
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) for use with NFS) such that a hexadecimal suffix of the form ,xyz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) denoted the file type: e.g. BasicFile,ffb is a BASIC (0xffb) file. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) naming convention is now also used by RISC OS emulators such as RPCEmu.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) Mounting an ADFS disc with option ftsuffix=1 will cause appropriate file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) type suffixes to be appended to file names read from a directory. If the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ftsuffix option is zero or omitted, no file type suffixes will be added.