Notes on Opus EDOS Greg Cook, 13/Mar/2006 Opus EDOS is a double density disc filing system by Alan Williams, which is compatible with DDOS. EDOS is written for Opus' WD2791 expansion board, which is fitted in place of the Intel 8271 controller chip in IC78. This document refers to the original EDOS, dated 1984. Versions patched by EDOSPAT (see below) have some bugs fixed and contain enhancements. EDOS offers: - Acorn DFS: 200 KB SD, 31 files per side, 0.5 KB catalogue - Opus DDOS: 360 KB DD, 248 files per side, 4.5 KB catalogue - EDOS SD-4: 200 KB SD, 124 files per side, 2.5 KB catalogue - EDOS DD-X: 360 KB DD, 31 files per side, 0.5 KB catalogue - Plus 10 unique formats: SD-1 to SD-3, DD-1 to DD-7 - Double stepping in software; use 40 track discs in 80 track drives - Reduced memory usage (OSHWM = &1700) - Decoded disc error messages - Tube support - Built-in disc tools - *ENABLE or prompt confirmation - Clean ASCII dialogue suitable for use over serial links. To make full use of EDOS, the Opus Challenger manual is recommended reading. The Challenger extensions apply, not the DDOS ones. Operation is as documented in the manual, except as follows: - *CONFIG, and the Challenger hardware features, are unavailable. - The *VOLGEN command is renamed, and track allocations are given on the command line: *CATGEN[ ]{ } E.g. *CATGEN 2 A30 B30 F10 - OSGBPB supports calls with A=4 (read data using internal pointer). A=3 should be documented as 'Set the file pointer to P, then as for A=4.' The carry flag is undefined on exit. Errors are signalled by BRK instructions or, if A<5 or A>7, by L being non-zero. - The correct form of the 8271 Read ID command is as follows: OSWORD A=&7F XY+0 Drive XY+1..4 Address of block to contain ID bytes XY+5 3 = Number of parameters XY+6 &5B = Command XY+7 Track number XY+8 0 = Not used by EDOS XY+9 1 (or unofficially, number of ID fields required) XY+10 Result - The 8271 Format command is supported, entry conditions as follows: OSWORD A=&7F XY+0 Drive XY+1..4 Address (I) of CHRN values XY+5 5 = Number of parameters XY+6 &63 = Command XY+7 Track number XY+8 &12 = Gap3 length (&FF/&4E part only) XY+9 &2A b7..5 = Sector size (see Read ID documentation) b4..0 = Number of sectors on track XY+10 0 = Gap5 length (not used on mini-floppy discs) XY+11 &12 = Gap1 length (&FF/&4E part only) I+0 0 = Logical track number for first sector (C) I+1 0 = Logical head number for first sector (H) I+2 0 = Logical record number for first sector (R) I+3 1 = Length of first sector (N) (see Read ID documentation) I+4 0 = Logical track number for second sector (C) I+5 0 = Logical head number for second sector (H) I+6 1 = Logical record number for second sector (R) I+7 1 = Length of second sector (N) ... + The above parameters will format track 0 of an Acorn DFS disc. A catalogue must then be written to this track, please see chapter 9, Disc formats, and the Write Sector documentation. + EDOS' implementation of this command does not support sector sizes other than 256 bytes. + Gap3 is a sequence of bytes written between sectors. It will need adjusting for different formats. Opus DDOS discs should be formatted with Gap3 = &1B. + If 16 or more sectors are to be written (XY+9 b4 = 1) then EDOS will format the track in double density. Otherwise it will format in single density. Opus DDOS discs have 18 sectors per track. + Gap1 is a sequence of bytes written between the index pulse and the first sector. It will need adjusting for different formats. Opus DDOS discs should be formatted with Gap1 = &24. + When formatting DFS or DDOS discs the logical track number (C) should match the physical track number going from 0 to 39 or 0 to 79. The logical head number (H) should be 0 even if the volume is on the upper surface of the disc. The logical record number (R) should run from 0 to 9 or 0 to 17 within each track. + When formatting in double density, EDOS, for reasons of space-saving, discards the H values in the ID block and writes the C values as both logical track number and logical head number. - The volume size field in each catalogue is 11 bits long (offset &0106 has the form %00bb0nnn.) If and only if the volume is 256 KB or larger, the length and start address fields of each file take an extra bit (offset &10E+8n will have the form %ellldsss.) - Offset &04 of the disc catalogue contains the actual number of tracks, not the number of tracks - 1. This is confirmed in Opus DDOS 3.45 and Opus EDOS 0.4, which write values &20 and &00 respectively in the version byte, at offset &00 of the disc catalogue. - Eight pages of absolute memory and one page of private memory are claimed, so PAGE=&1700 on booting. - EDOS cannot serve as a disc driver for other filing systems such as HADFS, as it expects to be the active filing system when OSWORD &7F is called. Some information not included in the manual: - *DISC I (capital i) invokes the disc filing system if necessary, and immediately boots from the disc in the current drive. - The *FORMAT command accepts parameters for drive, tracks, density and optional outstep. Outstep (also known as track skew) adjusts where sector 0 of each track is located relative to sector 0 of the previous track, for reduced latency while reading long files. All tracks are written with 1:1 interleave. Syntax: *FORMAT [ O] where = S | D = 40 | 80 | 40-80 = 0..9 (single density) | 0..17 (double density) 40-80 will format a 40 track disc in an 80 track drive. It must not be used with 40 track drives. *OPT 8 will need to be set correctly to verify the newly formatted disc. - *OPT 1 enables monitoring of system calls as well as files. Usage: *OPT 1 , where is the sum of the desired values: 1 Display *INFO of files being opened for writing, and of $.!BOOT on booting. 2 Monitor paged ROM calls. 4 Monitor internal OSFSC calls and calls to OSARGS, OSBGET, OSBPUT, OSFILE, OSFIND and OSGBPB. 8 Monitor OSWORD &7F calls. 128 Pause for 1.3 seconds after each monitoring message. - *OPT 5 displays the current *OPT settings plus a summary of their meanings. - *OPT 7 sets the number of volumes in the catalogue track of a multi-volume disc. + If =0, EDOS treats it as =8. + If =1, EDOS will cease to recognise Acorn DFS discs and instead read and write SD-1 and DD-1. However *FORMAT will fail with "Volume .. unavailable". *CATGEN with any volume argument will force the single volume to occupy the whole disc. These two formats are redundant to Acorn DFS and DD-X, respectively. + If equals 2, 3 or 4, then EDOS will cease to recognise Acorn DFS discs. Instead, single density discs will be accessed and formatted in multiple volumes. These are the 'EDOS single density formats' (SD-2, SD-3 and SD-4), which are incompatible with other filing systems. Of these three, =4 results in the recommended format. To read these discs, the value of must be the same as when the disc was formatted. + Values of between 2 and 7 inclusive, when in double density, each produce an incompatible variant of the DDOS format (DD-2 to DD-7). To read these discs, the value of must be the same as when the disc was formatted. + being 5 or more causes single density discs to be accessed in Acorn DFS format. + If =8, EDOS will read and write double density discs in Opus DDOS format. + For values of between 9 and 127 inclusive, attempts to access double density discs will fail with a seek error. + If is 128 or greater, then double density discs will be accessed and formatted in a single volume, in the style of Acorn DFS. There will be no catalogue track. This is the 'EDOS double density format' (DD-X) which is incompatible with other filing systems. NB: DDOS discs will be corrupted with this setting. - On entry to OSGBPB 5..7 (get disc attributes) it is recommended to set XY+5=&00000001, XY+9=&00000000. - Watford DDFS Manual, p.95. - If the address field of an OSWORD &7F command is unused, the recommended default is XY+1=&FFFFFFFF. - The Micro User, February 1986, p.123. - FDC command values should lie in the range &40 to &7F. - Acorn User, July 1986, p.179. - EDOS supports a subset of the 8271 command set: &53 Read data &4B Write data &69 Seek &5F Verify data &57 Read data and deleted data &4F Write deleted data &5B Read ID &63 Format track &6C Read drive status &7A Write special registers &7D Read special registers Unlike DDOS, it offers three undocumented pseudo-commands to access the functions of the 1770 chip: &64 Write track &65 Read track &76 Force interrupt DDOS supports this 8271 command which EDOS ignores: &75 Initialise - When reading or writing foreign disc formats, EDOS will not automatically detect the density, nor respond to any public method to select the density. However, the *CAT command will toggle the density flag for the current drive if no Acorn DFS or DDOS catalogue is found. Remember that there are two density flags per double-sided disc. - Disc tracks start on the outside and work inwards. Side 0 is on the bottom of the floppy disc. - Many of the routines employ an elegant 'microcode' whereby an action byte is shifted right at several decision points, as an encoding of which code segments to execute or skip. - *HELP HELP displays an extra message. EDOSPAT changes this to *HELP EDOS and displays its version number and the target floppy disc controller. Example output >*HELP OPUS EDOS 0.4 DFS UTILS OS 1.20 >*HELP DFS OPUS EDOS 0.4 ACCESS afsp L BACKUP src drv dest drv CATGEN drv vol specs COMPACT vol COPY src vol dest vol afsp DELETE fsp DESTROY afsp DIR dir DRIVE drv ENABLE FCOPY old fsp new entry name FORMAT drv S D 40 80 40-80 Oo INFO afsp LIB dir LOCK afsp RENAME old fsp new entry name SCOPY src vol dest vol afsp TITLE title UNLOCK afsp VERIFY drv VOL vol WIPE afsp OS 1.20 >*HELP UTILS OPUS EDOS 0.4 BUILD fsp DISC I DISK I DUMP fsp LIST fsp TYPE fsp OS 1.20 >*OPT 5 *opt 1 monitor = 0 *opt 6 density = 0 *opt 7 volumes = 0 *opt 8 tracks = 0 *opt 9 saverom = 0 >*CAT Seek error on drive 0.0.16 >*CAT Seek error on drive 0.0.0 >*CAT 2 Defs :0A.$.!boot Lib :0A.$ Drive 2 80 tracks Density 1 Not DT 2.24R (29) 770free/800 EXEC !BOOT 423TEST AUTODSK L A.DTXASM L >*INFO :2.*.* $.!BOOT 0000 0000 0037 02 $.AUTODSK L 31900 38023 02CC 04 A.DTXASM L 31B00 38023 14B0 15 $.423TEST 31700 38023 028B 97 >REM Inserted a DDOS formatted disc >*CATGEN Drive 0 Volume Tracks Sectors K bytes Cat 1 18 4.5 A 46 828 207 B 33 594 148.5 > Checksums of the EDOS 0.4 ROM 1245836096 16384 edos04 2ac7dbe50d87301c7ce79e7630cf6202 *edos04 $.EDOS04 FFFF8000 FFFF8000 4000 CRC=5523 EDOSPAT A patch program is available for Opus EDOS, offering the following bug fixes and improvements: - Provides apparent compatibility with Xfer 5.1 and ADE plus 1.0d. - EDOS can be reassembled to run on the Acorn 1770, Opus 1770 or Opus 2791 floppy disc controllers. - On attempting to read past end-of-file, OSGBPB will return with C=1 and the number of bytes still to be read, in XY+5..8. C will be cleared otherwise. - OSWORD calls &7D (get catalogue version number of current volume) and &7E (get size of current volume) have been implemented. - The NMI service routines have been reassembled to ignore INTRQ requests. - Clearing bit 7 of the MOS option byte (with *FX 255,0,127 or similar) diverts disc operations to a set of hooks, that can later be attached to an Acorn 1770 controller emulator. Making link 1 on the keyboard will select such an emulator on power up. If link 1 is used for another purpose, the code can be reassembled to use link 2, or one of the *OPT settings. References Opus Challenger Manual http://www.nvg.org/bbc/doc/OpusDDOS.zip WE DFS Manual http://www.nvg.org/bbc/doc/WatfordDFS-Manual.zip Author Greg Cook debounce@yahoo.co.uk http://homepages.tesco.net/~rainstorm/ -END-