OmniDisk v2.9+ DFS.txt (30 Nov 2004) Copyright 2002-2004 J. Watton. [jason.watton @ lycos.co.uk (remove spaces)]

You'll need word-wrap enabled to read this document easily.

For sector-level access to disks of any format in OmniDisk see the attached FAQ.txt. This file deals with the enhancements made to OmniDisk to handle the Acorn DFS format only.

DFS Extensions to OmniDisk
==========================

Do you want to use DFS under DOS? Or DFS under Windows?

OmniDisk has a set of DFS ('*') commands for handling:

	- DFS floppy disks (DOS, Windows3, Windows 95-ME)
	- DFS disk image files (DOS, Windows3, Windows95-ME, WindowsNT, 2000, XP)
	- DFS .inf files (DOS, Windows3, Windows95-ME, WindowsNT, 2000, XP)

When handling .inf files, you can use the DOS filename or the DFS filename contained within them.

Command List
------------

These are 3 types of DFS commands implemented:

  - Standard (barely modified from their DFS equivalent, e.g. *DUMP, *ACCESS, *WIPE)
  - DOSsed (changed to interface with DOS .inf or .img files rather than other DFS drives/files, e.g. *COPY, *BACKUP)
  - New (DFS-style commands specific to OmniDisk, e.g. *IMAGE, *DUMPW, *CREATE).

The commands are listed below, although this list may become outdated - use *HELP interactively for a current list.

DFS[80|40]|*DFS[80|40]
        Selects Acorn (BBC) DFS format (without disk scan). Default 80-track.
*DISK|*DISC
        Attempts to interpret disk as BBC DFS. Includes a disk SAMPLE.
*HELP [<command>]
        Provides help on <command>.
*VERBOSE [ON | OFF]
        Enables/Disables diagnostic DFS handling information.
*DRIVE [<drive>[<volume>]]
        Selects a default BBC DFS drive number/DDOS drive and volume.
*CAT [<drive>[<volume>]]
        Catalogues the currently selected/given DFS disk/DDOS volume.
*CAT <DOS filespec>
        Lists all DFS file images matching <DOS filespec> (do not add .inf).
*CAT <DOS directory>\
        Lists all DFS .inf file images in the DOS directory.
        Trailing '\' is mandatory. See also *INFO, DIR.
*INFO [<afsp>]
        Lists the catalogue details for files matching <afsp> on DFS disk.
*INFO <DOS directory>\
        Details all DFS .inf file images in the DOS directory.
        Trailing '\' is mandatory. See also *CAT, DIR.
*COPY <DFS drive> <DOS fsp> <DFS fsp>
        Copies file from DFS disk to DOS file (+.inf). DFS directory default $.
*COPY <DOS afsp> <DFS drive> <DFS afsp>
        Copies specified DOS .inf images matching DFS afsp to DFS disk.
*COPY <DOS fsp> <DFS drive> <DFS fsp>
        Copies DOS image to DFS disk using DFS filename specified. Do not add
        .inf to <DOS fsp>.
*COPY <DFS drive> <DOS directory>\ <DFS afsp>
        Copies files from DFS disk to DOS directory. Wildcards * and # allowed.
        e.g. $.!BOOT -> $!BOOT and $!BOOT.inf. Note trailing '\'.
*COPY <DOS directory>\ <DFS drive> <DFS afsp>
        Copies DFS files matching <afsp> from DOS .inf files to DFS disk.
        Wildcards * and # allowed. Note trailing '\' on DOS directory.
*IMAGE <DOS image file> [CHS|HCS]
        Use a DFS disk image file (of the order specified) instead of a floppy
        drive. Image order defaults to HCS.
ORDER|*ORDER [CHS|HCS]
        Displays/sets sector order used for READing from/WRITEing to a disk.
*CREATE <DOS image file> [<tracks> [<sides> [<order>]]]
        Creates an empty DFS/DDOS disk image file.
        <tracks> = 40 or 80 (default), <sides> = 1 (default) or 2,
        <order> = HCS (default) or CHS (only for 2 sides - see *IMAGE).
*ACCESS <afsp> [L]
        Locks/unlocks DFS files matching <afsp>.
*BACKUP <DFS drive>|* <DOS file> [<order>]
        Creates an image backup of the DFS/DDOS drive. '*' backs up both sides
        of default DFS drive. Image file <order> is CHS or HCS (default).
*BACKUP <DOS file> <DFS drive>|* [<order>]
        Restores an image backup to a DFS disk. '*' restores both sides of
        default DFS drive. Image file <order> is CHS or HCS (default).
*COMPACT [<drive>[<volume>]]
        Compacts DFS disk/DDOS volume.
*DELETE <fsp>
        Deletes one DFS file from the disk/image.
*DESTROY <afsp>
        Destroys a set of DFS files from the disk/image.
*DUMP <fsp>
        Dumps the contents of the DFS file to the screen.
*DUMPW <fsp>
        As *DUMP but wider (16 byte) output.
*LIST <fsp>
        Displays the contents of the DFS file as numbered lines of printable
        characters.
*OPT 1,<extended file info>
        Enables display of file info when accessed (if 1 or greater).
*OPT 4,<boot type>
        Sets auto-boot option for current drive.
*RENAME <fsp> <entsp>
        Renames DFS file (& directory).
*TITLE ["]<title>["]
        Sets the title of the disk in the current drive.
*TYPE <fsp>
        Displays the contents of the DFS file as lines of printable characters.
*WIPE <afsp>
        Optionally deletes files from DFS disk.
*DIR [:<drive>[<volume>].]<dir>
        Selects default directory and DFS drive number/DDOS drive & volume.
*FORMAT [<drive>|*]|
        Formats DFS/DDOS drive to currently selected format (DFS80/DFS40). '*'
	formats both sides of the currently selected drive.
*VERIFY [<drive>]
        Verifies DFS/DDOS drive against the currently selected format
        (DFS80/DFS40/DDOS).

Useful other command:
DIR [<filespec>]
        Lists DOS files matching filespec. Use trailing '\' for directories.

Getting going
-------------
For an Acorn DFS floppy disk, insert the DFS disk and select the drive using '*DRIVE n', where n is the drive numbered as for a BBC. Type '*DISK'. Provided there are no errors, you can then use the usual DFS commands as listed above. Use '*DFS'  if '*DISK' fails to recognise the format.

For a disk image, type *IMAGE <DOS filename>. The default sector ordering (type '*ORDER') is HCS, but you may want to change this - if the DFS drives were stored in the file Drive 0 followed by Drive 2 (for example), *ORDER HCS is correct. This is true for a single-sided file (just one drive). If, however, the file contains the first track of Drive 0 followed by the first track of Drive 2 followed by the second track... etc. then you need to alter the default setting using '*ORDER CHS'.

.inf files are handled by the appropriately tweaked '*' commands listed below.

Standard DFS Commands
---------------------
The following commands behave identically (or with minor amendments) to the DFS equivalent:

*DRIVE [<drive>]
*CAT [<drive>]
*INFO [<afsp>]
*ACCESS <afsp> [L]
*COMPACT <DFS drive>
*DELETE <fsp>
*DESTROY <afsp>
*DUMP <fsp>					(Use *DUMPW for wide screen 80-column display)
*LIST <fsp>
*OPT 1,<extended file info>
*OPT 4,<boot type>
*RENAME <fsp> <entsp>
*TITLE ["]<title>["]
*TYPE <fsp>
*WIPE <afsp>
*FORMAT [<drive>]
*VERIFY [<drive>]

<afsp> defaults to '*.*'. The default directory is always '$'. There is no *ENABLE - be careful!

These commands are all valid both on physical DFS floppy disks or disk images (*IMAGE).

DOSsed DFS Commands
-------------------
The following commands have been amended to the OmniDisk environment to allow for .inf archives and disk file images:

*DISK|*DISC|*D.
*HELP [<command>]
*CAT <DOS filespec>
*CAT <DOS directory>\
*INFO <DOS directory>\
*COPY <DFS drive> <DOS fsp> <DFS fsp>
*COPY <DOS afsp> <DFS drive> <DFS afsp>
*COPY <DOS fsp> <DFS drive> <DFS fsp>
*COPY <DFS drive> <DOS directory>\ <DFS afsp>
*COPY <DOS directory>\ <DFS drive> <DFS afsp>
*BACKUP <DFS drive>|* <DOS file> [<order>]
*BACKUP <DOS file> <DFS drive>|* [<order>]

e.g.	*HELP *CAT
	*CAT \images\dfs\			(All files *.inf scanned in given directory)
	*CAT \images\dfs\$C*			(All files $C*.inf scanned in given directory)
	*INFO \images\dfs\
	*COPY 0 \images\dfs\ *.*
	*COPY 0 \images\dfs\$DFSFile COMP]BB	(']' is illegal in DOS so the DOS filename is given explicitly)
	*COPY \images\dfs\$DFSFile 0 *.*	(File COMP]BB will be restored)
	*COPY \images\dfs\ 2 CHAL*		(All .inf files searched for DFS files $.CHAL*)
	*COPY \images\dfs\$C* 2 $.CHAL*		(All files matching $C*.inf searched for DFS files $.CHAL* and copied)
	*BACKUP 0 \images\dfs\Games1.img	(Drive backed-up to disk image Games1.img)
	*BACKUP \images\dfs\Games1.img 0	(Drive restored from disk image Games1.img)
	*BACKUP * \images\dfs\GameDisk.img	(Both sides of disk backed-up to disk image GameDisk.img)
	*BACKUP \images\dfs\GameDisk.img *	(Both sides of disk restored from disk image GameDisk.img)

Command DIR is also available to browse DOS filenames.

New DFS Commands
----------------
The following DFS-style commands are new to OmniDisk:

*DFS
*DUMPW <fsp>					(Wide-screen version of *DUMP)
*IMAGE <DOS image file>
ORDER|*ORDER [CHS|HCS]
*CREATE <DOS image file> [<tracks> [<sides> [<order>]]]
*VERBOSE [ON | OFF]				(For diagnosis only)

Some DDOS commands are also available for use with DFS disks/images. See DDOS.txt for more information.

Making or restoring a DFS drive/disk image
------------------------------------------
Use *BACKUP, e.g.

*BACKUP 0 c:\images\bbc0.img

A drive specification of '*' backs up both sides of the currently selected disk, e.g.

*BACKUP * c:\images\bbcdisk.img

The sector order can be changed by adding 'HCS' or 'CHS' to the command.

OmniDisk provides other methods (e.g. IMAGE ORDER, READ DISK TO <filename>) if other image formats are required.

Formatting
----------
For this to be successful:

- Make sure you use the correct floppy disk type - e.g. 3.5" HD disks won't work (for single/double-density formats) unless you cover up the extra hole.
- Make sure you adjust the RATE for a 5.25" floppy drive, as prompted.

The best way of getting the format to work is to SCAN or SAMPLE a genuine disk, and note the RATE and GSL settings. Then insert a formattable disk and try FORMAT TEST, which will supply a selection of GPLs to choose from. See the FAQ for more information.

Long commands
-------------
A lengthy command can be aborted by pressing Escape. The program will not stop, however, until it is 'safe' to do so - e.g. following a file move for a *COMPACT.

.inf Filenames
--------------
If OmniDisk needs to record a DFS file as a .inf, it uses the DOS filenames <dir><filename> and <dir><filename>.inf - e.g. $.!BOOT becomes $!BOOT and $!BOOT.inf. If the <dir> is not explicit, OmniDisk uses the current default (itself defaulted to '$'). For example:

*COPY 0 \images\dfs\ *.*

copies all files from DFS drive 0 to directory \images\dfs. A set of .inf archives will be created, named as described.

Some '*' commands (e.g. *COPY) allow the DOS filename to explicitly set - e.g.

*COPY 0 \images\dfs\MyBoot $.!BOOT

copies the DFS file :0.$.!BOOT to \images\dfs\MyBoot and \images\dfs\MyBoot.inf. The .inf file will still contain the DFS filename ($.!BOOT).

.inf File format
----------------
This format is attributed to Wouter Scholten.

OmniDisk records these using the 'C' code:

		sprintf(String, "%s %06lX %06lX %06lX%s\x0D\x0A",
			DFSSrcFile.Filename,
			DFSSrcFile.LoadAddr,
			DFSSrcFile.ExecAddr,
			DFSSrcFile.Len,
			DFSSrcFile.Locked ? " Locked" : "");

e.g.
$.ASSEM   FF0E00 FF801F 000569 Locked

This is in the vein of the standardised inf format described on 'The BBC lives!', although the directory letter has **not** been dropped in the equivalent DOS filename (which keeps DOS filenames as unique as the DFS filenames). The CR/LF at the end is pure conjecture.

There is some variation in .inf files seen out there on the Internet - e.g. CR-LF, CR, LF, LF-CR, or nothing at the end of the line, and the number of parameters varies. If you have problems with .inf files please tell me with what system. For reference, the above code generates a strict format of:

<9-character filename left-justified with spaces, including leading directory letter and '.'>
<space>
<6-digit hex load address, in upper case>
<space>
<6-digit hex exec address, in upper case>
<space>
<6-digit hex length, in upper case>
<optional " Locked" (with leading space) if locked>
<line terminator byte value 13 decimal - CR>
<line terminator byte value 10 decimal - LF>

40-track Disks
==============
A lot of problems arise from simulating 40-track disks using an 80-track drive - the heads are double-stepped but leave every (odd) track behind. This (in versions before v3.5) causes an ANALYSIS which looks something like this:

CYLINDERS:              Disk extends from physical cylinder 0 to 78
TRACKING:               Non-standard/40-track disk formatted in 80-track 
drive
HEADS:                  Normal
SECTORS:                Numbered 0 to 9
DATA TRANSFER RATE:     1
ENCODING:               FM
INTERLEAVE:             1:2
SECTOR SIZE:            1 (256 bytes/sector)
TRACK SIZE:             2.500kB (2560 bytes)
SCANNED DISK SIZE:      7kB (7680 bytes)
RECOGNISED FORMAT:      Unknown

In version 3.5 the analysis of the disk has been upgraded to ignore any ghost of a previous format. You will get a warning telling you this if a 40-track disk is used with *DISK or ANALYSE.

This means that while the 40-track format is readable, the 'ghosted' (or 'echoed') format is still readable between it. If you only want to recover the 40-track format from the disk, perform the following:

DFS40
RATE 2 (**ONLY** if using a 3.5" drive)
OPENOUT SIDE0.SSD
READ HEAD 0
CLOSE
OPENOUT SIDE1.SSD
READ HEAD 1
CLOSE
