Disc Filing System
Encyclopedia
The Disc Filing System (DFS) is a computer file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

 developed by Acorn Computers Ltd
Acorn Computers
Acorn Computers Ltd. was a British computer company established in Cambridge, England, in 1978. The company produced a number of computers which were especially popular in the UK. These included the Acorn Electron, the BBC Micro, and the Acorn Archimedes...

, and introduced in 1982 for the Acorn BBC Microcomputer
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...

. It was shipped as a ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

 to be inserted onto the BBC Micro's motherboard. It has an extremely limited design, and uses a flat directory structure. Each filename can be up to 7 letters long, plus one letter for the directory in which the file is stored.

The DFS is remarkable in that unlike most filing systems, there was no single vendor or implementation. The original DFS was written by Acorn, who continued to maintain their own codebase, but various disc drive vendors wrote their own implementations. Companies who wrote their own DFS implementation included Cumana, Opus and Watford Electronics. The Watford Electronics implementation is notable for supporting 62 files per disc instead of the usual 31, using a non-standard disc format. Other features in third-party implementations included being able to review free space, and in-built FORMAT and VERIFY commands, which was shipped on a utility disc with the original Acorn DFS.

Acorn followed up their original DFS series with the Acorn 1770 DFS, which used the same disc format as the earlier version but added a set of extra commands and supported the improved WD1770 floppy drive controller chip.

Physical format

DFS conventionally uses one side of a double-density 5¼" floppy disc. Discs are formatted as either 40 or 80 track, giving a capacity of 100 or 200 KB per side (10 256-byte sectors per track, with FM encoding).

The capacity is limited by the choice of the Intel 8271 controller in the original BBC Micro, which only supports FM
Frequency modulation
In telecommunications and signal processing, frequency modulation conveys information over a carrier wave by varying its instantaneous frequency. This contrasts with amplitude modulation, in which the amplitude of the carrier is varied while its frequency remains constant...

 encoding, not the MFM
Modified Frequency Modulation
Modified Frequency Modulation, commonly MFM, is a line coding scheme used to encode the actual data-bits on most floppy disk formats, hardware examples include Amiga, most CP/M machines as well as IBM PC compatibles. Early hard disk drives also used this coding.MFM is a modification to the original...

 encoding which was already in common use by the time of the BBC Micro's launch. FM encoding gives half the recording capacity of MFM for a given physical disc density.

FM and MFM encoding are commonly referred to as "single density" and "double density", although the discs and drives are the same, unlike "high density", which uses different drives and discs.

Double-density 3½" discs can be formatted and used with 1770 DFS (the Intel 8271 controller has problems with many 3½" drives), giving the same "single-density" capacity with FM encoding, but this was not originally standard practice. 3½" discs were normally formatted as MFM "double density" using the later Advanced Disc Filing System
Advanced Disc Filing System
The Advanced Disc Filing System is a computing file system particular to the Acorn computer range and RISC OS based successors. Initially based on the rare Acorn Winchester Filing System, it was renamed to the Advanced Disc Filing System when support for floppy discs was added and on later 32 bit...

, as this is present in all machines supplied with 3½" drives. As of 2009, 3½" drives are more commonly used with BBC Micros than in the past, including use with DFS, due to their greater availability and easier data interchange with more recent computers.

High-density 5¼" and 3½" discs are not supported by DFS.

Single/double-sided operation

The DFS does not directly support double-sided discs; instead, the two heads of a double-sided drive are treated as two separate, independent drives. The DFS can itself support up to four volumes, numbered from 0 to 3. Drive 0 is the default with drive 1 representing a second drive attached to the cable. "Drive" 2 referred to the reverse side of drive 0, and "drive" 3 was the reverse of drive 1. There is no support for more than two physical drives.

Due to the installed base of single-sided drives, commercial software was normally provided on single-sided discs, or as "flippy" discs that were manually reversed to access the other side.

40/80-track compatibility

Discs can be formatted using 40 or 80 tracks, and drives can be either 40 or 80 track. This is the most common compatibility issue for DFS users: 40-track discs were the norm for commercial software distribution, due to the installed base of 40-track drives, but 80-track drives became more common as prices dropped, allowing users to store more data. An 80-track drive won't automatically read 40-track discs.

The disc capacity is stored as a sector count, in the catalogue on track zero. Track zero is located in the same place on both 40- and 80-track discs, allowing a disc file system to set the motor stepping accordingly. However, the Intel 8271-based Acorn DFS does not do so, and so dual-format capability was addressed in a number of ways:
  • by simply attaching both a 40-track drive and an 80-track drive to the BBC Micro, although this was costly for the home user;
  • some disc drive resellers, notably UFD (User Friendly Devices) and Akhter Computer Group, offered drive assemblies fitted with switches to select 40- or 80-track operation;
  • magazines such as The Micro User
    The Micro User
    The Micro User was a British specialist magazine catering to users of the BBC Microcomputer series, Acorn Electron, Acorn Archimedes and, to a limited extent, the Cambridge Z88...

    offered kits to build circuit boards that could be wired into the disc drive cable, optionally 'double-stepping' the attached drives;
  • The Micro User also published an article on creating dual-format discs, with 21 tracks' worth of data stored in both formats so that either type of drive could access the contents; however these had limited capacity and once created were read only;
  • Acorn User
    Acorn User
    Acorn User magazine was founded by Acorn Computers in 1982, contract-published by Addison-Wesley, to coincide with the launch of the BBC Micro. It covered the range of Acorn home computers, the BBC Micro and Atom at first and later the Electron, Archimedes and Risc PC.The first issue was dated...

    magazine distributed 40-track cover discs with a small utility program in track zero, so that owners of 80-track drives could reformat it into an 80-track disc with the original contents on the first 40 tracks; or
  • the user could upgrade to a WD1770 or similar controller. Acorn 1770 DFS and some third-party controller systems provided dual-format capability in software by reprogramming the controller during track seeks; as a bonus, third-party systems offered proprietary MFM (so-called "double-density") formats for even greater disc capacity.


Failure to use the correct setting would result in errors from the DFS such as Disk fault 18 at 01/00, or damage to the disc drive by trying to step the heads beyond the physical end of the disc surface.

Switching to 80 tracks did not extend the catalogue in any way, leaving the user prone to running out of filename slots before running out of space on the disc. This situation resulted in a "Cat full" error.

Filenames

DFS is case preserving but not case sensitive. The prevalence of all-capitals filenames is most likely due to the BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...

 defaulting to caps lock being enabled after a hard or soft reset. The character set is quite permissive, and all printable characters of 7-bit ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 are allowed, including spaces, but excluding:
  • The single wildcard character "#".
  • The multiple wildcard character "*".
  • Control codes
    Control character
    In computing and telecommunication, a control character or non-printing character is a code point in a character set, that does not in itself represent a written symbol.It is in-band signaling in the context of character encoding....

     generated by the shell escape character
    Escape character
    In computing and telecommunication, an escape character is a character which invokes an alternative interpretation on subsequent characters in a character sequence. An escape character is a particular case of metacharacters...

     "|", although the sequence "||" can be used to represent a single | character in the filename.
  • The drive specifier character ":" as the first character of a leaf name (the file's name proper). This causes a "Bad drive" or "Bad name" error. Where the colon is unambiguous, for example in "FOO:BAR", then it is allowed as part of the leaf name.
  • The directory specifier character "." as the first or second character of a leaf name. "." cannot be used as a directory character. Where the dot is unambiguous, such as in "PRG.BAS", then it is allowed as part of the leaf name, and is not treated as a directory specifier (whereas "F.MONEY" would be a file "MONEY" in directory "F").


For the sake of portability to third-party DFS implementations, it is best to avoid ":" and "." in leaf names.

Quotation marks are allowed, although BBC BASIC
BBC BASIC
BBC BASIC is a programming language, developed in 1981 as a native programming language for the MOS Technology 6502 based Acorn BBC Micro home/personal computer, mainly by Sophie Wilson. It is a version of the BASIC programming language adapted for a U.K...

 requires them to be escaped twice:
  • SAVE """""""A""" passes the string """A" to the DFS, which then saves a file named "A.
  • Conversely SAVE "A""" saves a file named A".
  • The same technique is used to insert spaces: SAVE """B A R""" saves a file named B A R.


A fully qualified filename, or "file specification" ("fsp" for short) contains a colon then the drive number, a dot, then the directory letter, another dot, and the name. For example, a file in the default directory of "drive" 2 called "BOB" would have a complete specification of ":2.$.BOB". The drive and directory specifiers are both optional.

Directories

"Directories" in the DFS are single character prefixes on filenames – such as "F" in "F.BankLtr" – used to group files. The arrangement is flat and a default directory of "$" is used instead of a root directory. On requesting a catalogue of the disc (with the *CAT or *. shorthand), files in the current directory are shown with no directory prefix in one block, and below that are listed all other files in a second block, with their directory prefixes visible. For example (from Acorn DFS - third party DFS implementations may vary slightly):

PROGRAM (12)
Drive 0 Option 2 (RUN)
Dir. :0.$ Lib. :0.$

!BOOT HELLO
SUMS TABLE
TEST VECTORS
ZOMBIE

A.HELLO L B.SUMS
F.BankLtr


The top seven files are all in the current directory which is $ on drive 0. Below that are all the files in other directories, in this case A, B and F. An "L" after a filename (as with "A.HELLO", above) shows the file is locked against modification or deletion. The first line contains the disc title and the modification count.

The DFS provides a working space, divided up into the directory and the library. The "directory" is the working directory
Working directory
In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. When the process refers to a file using a simple file name or relative path , the reference is interpreted relative to the current working directory of...

 on the current volume, much like the working directory on any other command line system. The "library" is a second, alternative working directory that functions more like PATH
Path (variable)
PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located...

and had the benefit of being able to be on any volume. Requests to open files with unqualified names, will first be searched for in the working directory; failing this, the library directory will also be searched. The directory and library both default to the same directory.

Disc structure

The catalogue (file table) occupies the first two disc sectors: one for the names and directories of each file, and a matching sector holding the file locations, sizes and metadata. Eight bytes of each sector are used for each file. With a further eight bytes from each sector reserved for the 12-byte disc title and the volume information, the total number of files on the disc (irrespective of which directory each file is in) is limited to 31. In the interests of saving space, the most significant bit of the directory letter for a file is used as the locked (read-only) flag.

Volume size

Although physical disks are usually formatted as either 100 KB or 200 KB, DFS supports volume sizes up to 256 KB.

The largest DFS file size allowed is the volume size minus ½ KB for the catalogue, as file sizes are stored as an 18-bit quantity.

File allocation

The DFS does not support data fragmentation
Fragmentation (computer)
In computer storage, fragmentation is a phenomenon in which storage space is used inefficiently, reducing storage capacity and in most cases reducing the performance. The term is also used to denote the wasted space itself....

, meaning a file's data must be stored in a single run of consecutive sectors, but free space is prone to becoming fragmented. Random-access file writes fail when the end of the file reaches the beginning of the next, even though there may be free sectors elsewhere on the disc. In such cases the DFS aborts with a Can't extend error. SAVE cannot split a file to fit the available space either, but as the failure occurs at the sector allocation stage, the error returned is Disk full.

A *COMPACT command is provided to relocate all files on disc to a solid block, placing all the free space after it in a second block. This allows the next file created to fill the disc, but only the last existing file can be extended without being moved. SAVE virtually deletes any existing file and copies the specified block of memory to wherever there is space on the disc. In contrast the *COMPACT command uses program memory as a buffer to relocate the files, overwriting any program and data in memory.

Metadata

Like the cassette filing system, the Acorn DFS supports the BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...

's standard file metadata: load address and execution address, required because Acorn MOS
Acorn MOS
Acorn's Machine Operating System or OS was a computer operating system used in the Acorn BBC computer range. It included support for four-channel sound and graphics, file system abstraction, and digital and analogue I/O including a daisy-chained fast expansion bus...

 (the operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 used by the BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...

) does not support relocation of binary code. A file should be loaded to the address the programmer intended, as the contents may refer to internal locations by absolute addresses. An execution address is also recorded as the entry point is not necessarily at the beginning, or even within the file.

File attributes are limited to a single bit; when set, an L appears to the right of the file's name in the catalogue, and the file may not be altered, overwritten or deleted.

Dates

DFS discs do not track any dates (because Acorn MOS prior to version 3 did not maintain a real-time clock) but instead offered a peculiar feature: a modification count. Every time the disc is written to, the count increments. The count is shown in parentheses after the title in the first line of the disc catalogue, such as the 12 in the catalogue listing shown earlier.

Other features

The DFS also supports a means to start up disc software based on a key sequence. If the shift key is held while the machine is soft or hard reset, the DFS checks the active drive for a disc containing a positive boot flag. The boot flag is either 0 (ignore), 1 (load file), 2 (run machine code file) or 3 ("execute" script). If the boot flag is positive, a file called !BOOT is looked for and loaded into memory (1), loaded and executed as machine code (2) or fed into the keyboard buffer (3). Option 3 reads "EXEC" files, text files used as very primitive shell script
Shell script
A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language...

s. These are not true shell scripts but simply a series of keys to be typed, like a recording to play back. Thus, they cannot loop or branch unless they input such code into the BASIC interpreter. As well as being used during a reset, they can be executed at any time with the operating system's EXEC command. EXEC files are not DFS-dependent.

Alternatives

There was a variant of the DFS called the DNFS, or Disc/Network Filing System, that contained the Econet Network Filing System (NFS), standard Disc Filing System and Tube co-processor support software on a single ROM; this ROM installed two filing systems into the OS at once.

The initial design for the DFS was based around an Intel Corporation
Intel Corporation
Intel Corporation is an American multinational semiconductor chip maker corporation headquartered in Santa Clara, California, United States and the world's largest semiconductor chip maker, based on revenue. It is the inventor of the x86 series of microprocessors, the processors found in most...

 FDC 8271 disc drive controller, the immediate predecessor of the 8272 design found in the IBM Personal Computer. The 8271 controller was of limited functionality and obsolete, and later versions of the file system from various vendors including Solidisk, Acorn and Watford Electronics were based on the later WD1770 and WD1772 drive controllers. The 1770 controller quickly became the standard controller in the Acorn range following the advent of ADFS.

The DFS was superseded by the Advanced Disc Filing System
Advanced Disc Filing System
The Advanced Disc Filing System is a computing file system particular to the Acorn computer range and RISC OS based successors. Initially based on the rare Acorn Winchester Filing System, it was renamed to the Advanced Disc Filing System when support for floppy discs was added and on later 32 bit...

 (ADFS) which was fully hierarchical and was suitable for running hard drives on the BBC Micro
BBC Micro
The BBC Microcomputer System, or BBC Micro, was a series of microcomputers and associated peripherals designed and built by Acorn Computers for the BBC Computer Literacy Project, operated by the British Broadcasting Corporation...

. The ADFS was the default filing system on the BBC Master
BBC Master
The BBC Master was a home computer released by Acorn Computers in early 1986. It was designed and built for the British Broadcasting Corporation and was the successor to the BBC Micro Model B. The Master 128 remained in production until 1993....

 but most users are likely to have reverted to the DFS for compatibility reasons; ADFS could not read DFS discs. The ADFS was also chosen as the standard filing system for RISC OS
RISC OS
RISC OS is a computer operating system originally developed by Acorn Computers Ltd in Cambridge, England for their range of desktop computers, based on their own ARM architecture. First released in 1987, under the name Arthur, the subsequent iteration was renamed as in 1988...

.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK