Notes on Opus EDOS Greg Cook, 30/Jun/2005 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: - Compatibility with Opus DDOS and Acorn DFS - Double-stepping in software; use 40 track discs in 80 track drives - New formats: multiple volume single density, single volume double density - 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, not the DDOS ones apply. Operation is as documented, 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 number of ID fields required) XY+10 Result - 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. - No private memory is 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. This has nothing do do with the lack of private workspace, as EDOS is not given the opportunity to save its variables. 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 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 disc just formatted. - *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 for files being opened for writing. 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 lies between 1 and 4 inclusive, then EDOS will cease to recognise Acorn DFS discs. Instead, single density discs will be accessed and formatted in multiple volumes. This is the 'EDOS single density format' which is incompatible with Acorn DFS, Watford DFS and Opus DDOS. + Values of between 1 and 7 inclusive, when in double density, each produce a variant of the DDOS format. To read these discs, the value of must be the same as when the disc was formatted. + 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' 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=1, XY+9=0. - 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 uses this to display 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 (read catalogue version number of current volume) and &7E (read free space in 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. 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-