DYC - A Mapped RX03 Handler for TSX-plus V4c 24-Jan-91 Author: C G Wilson, 71 Galatea St, Charleville, Australia 4470. DYC provides an RX03 (double-sided RX02) handler capable of reading or writing RX01 and RX02 discs. It may be used under RT-11, but was primarily designed to run in high memory ("mapped") under TSX-plus, thus saving low memory space. This handler is designed for Sigma/Dilog RX03 controllers, with optional assembly for DEC, MTI, and DSD ones. It may need minor modification (notably to the extended addressing and formatting code) for other manufacturers' boards. Full 22-bit addressing is used where possible, removing the need for intermediate data buffers under TSX-plus. An SPFUN to allow formatting during normal system operation (without requiring access to the I/O page) is included. The handler may be run as a programme, providing the formatting options with no further programme being required. In version 4, support for the SMS flavour of RX03 format has been added (courtesy of discs from Billy Youdelman). DYC.TSX is designed for use as SY:DY.TSX, to replace the DEC or S & H DY.TSX on the system device. CHAPTER 1 Assembly Options: (See also later section on building the DYC handler for different systems and controllers.) In version 4, the DEC option of DY$DD (for double density only) has been removed. 1.1 Controller Types - Sigma/Dilog No prefix file is required for building this flavour of the controller - it is the default, setting the parameter C.DILOG to 1. This version assumes 22-bit addressing (sets DY$22B=1), 2-sided discs (sets SIDES$=2), and uses the Sigma/Dilog extension to DEC's formatting to allow both soft (writing the headers only) and hard (complete rewriting of sector and track information) formatting. 22 bit addressing is enabled by setting the bit in the command. An extra phase is added to all cycles requiring a memory access. In this cycle the high-order address is passed to the controller, as six bits right justified. The bits and are not used. 1.2 MTI Controller The prefix file MTI.MAC is used for building this version of the handler. It sets the parameter C.MTI=1. This version assumes 22-bit addressing (sets DY$22B=1), 2-sided discs (sets SIDES$=2), and uses the MTI formatting - same as Sigma/Dilog. 22 bit addressing is enabled by setting the bit in the command. An extra phase is added to all cycles requiring a memory access. In this cycle the high order four bits of the address are passed to the controller, right justified. Bits 16 and 17 still need to be set in the command word as per a DEC 18-bit controller. DYC - Mapped RX03 Handler for TSX-plus Page 1-2 Assembly Options: 1.3 DSD Controller The prefix file DSD.MAC is used for building this version of the handler. It sets the parameter C.DSD=1, and allows 2-sided discs (SIDES$=2). This controller is an 18-bit one rather than a 22-bit one, and uses a completely different formatting technique. It has the problem that the formatting on side 1 sets the HEAD byte to 1, and actually checks this on later disc I/O, whereas the Sigma/Dilog does not. This means that a disc formatted on a DSD system can be read and written on either, but a disc formatted on a Sigma/Dilog cannot have its second side read on a DSD system. 1.4 DEC Controller The prefix files DEC.MAC and DEC2.MAC are used for building the DEC versions of the handler. They both set the parameter C.DEC=1. DEC.MAC allows only single-sided discs (SIDES$=1), and DEC2.MAC allows double-sided discs (SIDES$=2). This controller is an 18-bit one, and is only capable of soft formatting of discs. The DEC2 option is suitable for the FLEX-02 controller. 1.5 16-bit Controller The prefix file TINY.MAC is used for building this version of the handler. It sets the parameter C.TINY=1, and allows only single-sided discs (SIDES$=1). This is a special version of DYC providing a TSX-non-mappable handler for a 16-bit controller. It uses a buffer in its own low memory space for transfers, copying the data to and from there into the user's address space. It is slow, and has very limited application! CHAPTER 2 Formatting An SPFUN (code 200) is provided to allow formatting, with the following parameters: In Buffer: First byte: If zero, format side zero If non-zero, format size one (on some controllers, this is ignored, and the disc is formatted on both sides if possible) Second byte: If zero, use single density If non-zero, use double density Block Number: If zero, use soft formatting (header rewrite) If non-zero, use hard formatting (if controller has this ability) Depending upon which controller is used, the machinations within the handler are different. Sigma/Dilog protocol (extension of DEC type): Command: 10 + <20 if unit 1> + <400 if double dens> + <1000 for side 1> Followed by (in data register) 111 for soft format, or 222 for hard format. DSD protocol: Command: 5 Followed by: 154 for single-density 155 for double density each twice into the data register. Both sides of a disc will be formatted if it is double sided. DEC protocol: Command: 10 + <20 if unit 1> + <400 if double dens> + <1000 for side 1> Followed by (in data register) 111 (soft format only). CHAPTER 3 Running DYC as a Programme If DYC is run as a programme, it provides formatting capabilities for relatively easy use, requiring no particular privileges under TSX-plus. [If however you have users who may not access ".TSX" files on the system device, make a copy of DYC.TSX called DY.SAV on SY: and run that.] This facility is best demonstrated by showing how to get the HELP text for this programme (note that there are minor differences depending upon which assembly parameters have been used in the construction of the DYC handler): .r dy.tsx */h DY Extended Handler, V4c, 24-Jan-91 Built for Sigma/Dilog DY controller. Commands are: /H (without any file) - Type this text The device specified should be a DY floppy drive, write-enabled. /H - hard format; /F - soft format; /D - double density; /S - both sides. /S:0 - side 0 only (default); /S:1 - side 1 only. /I - initialize directory when formatted (default 4 segments), or /I:n for n segments (1 to 31.) /T - tell size of disc (in blocks) /Z - equivalent to /F/D/S/I (/D and /S imply /F unless /H is specified. /B - tell whether normal RX03 or Billy Youdelman's SMS format /B:ON sets Billy's format; /B:OFF returns to normal RX03 * [The use of /B is described in the next chapter.] Examples: DYC - Mapped RX03 Handler for TSX-plus Page 3-2 Running DYC as a Programme .r dy.tsx *dy:/z/h Hard formats an RX03 floppy and initializes it. .r dy.tsx *dy1:/t Tells the size of the floppy in dy1:. .r dy.tsx *dy1:/d/i Soft formats an RX02 floppy in dy1: and initializes it. CHAPTER 4 Different DY Formats There are several formats available for 8" floppy discs, to be readable with the DYC handler. RX01: This is the single density original IBM format, with 128 bytes per sector, 26 sectors per track, using tracks 1 through 76. (Track 0 was reserved for an IBM directory, and has been uselessly wasted ever since!) The sector headers and the data are both written in single density. The number of blocks available with RX01 formatting is 494. RX02: This was DEC's modification to increase storage space. This format still uses 26 sectors per track, tracks 1 through 76, but each sector, while still having its header written in single density, writes its data in double density. This doubles the available space for data to 988 blocks. RX03: When double-sided discs and drives became available, DEC did not move up to them, though other manufacturers leaped for them. Unfortunately this has led to two different formats, as there was no standard! Mark I: With this format, the disc is utilized in such a manner that side zero is exactly the same as an RX02 floppy (blocks 0 through 987), then blocks 988 through 1971 are on the other side of the floppy in the same positions as the corresponding block (less 988) on side zero. This has the advantage that a single-sided controller can still read the first half of these discs. Mark II: [I only recently learned of the existence of this format via Billy Youdelman in the USA, who sent me some apparently unreadable discs! This format has been allowed for in version 4 of DYC] This format alternates heads on each track before moving to the next track: ie starts at track 1, head 0, then goes to track 1, head 1; then track 2, head 0, track 2 head 1 and so forth. It is interesting that the initial directory blocks in these two formats are in exactly the same position on the disc, so you cannot tell which format a disc was written in by examining the directory: you have to look at one of the files stored further along the disc. Version 4 of DYC supports both of these formats. When initially DYC - Mapped RX03 Handler for TSX-plus Page 4-2 Different DY Formats assembled and as distributed, it is set for the Mark I format, and must be altered if the Mark II format is to be used. This can be done in either of the following ways: .SET DY BILLY .SET DY NO BILLY These two commands set the handler to Mark II (Billy Youdelman's format) and Mark I (the original?) respectively. Should it be necessary to modify a handler when it is not a system handler (eg setting up a bootable disc), the handler may be run as a programme, and the /B switch used to perform the modification. /B alone tells you the current setting of the handler; /B:ON switches the handler to Mark II, /B:OFF reverts to Mark I. For example: .RUN DY:DY.SYS */B Currently SET DY NO BILLY (for normal RX03 format) is in effect. */B:ON */B Currently SET DY BILLY (for SMS format) is in effect. */B:OFF */B Currently SET DY NO BILLY (for normal RX03 format) is in effect. *^C ---------------------------------------------------------------------- WARNING: STICK TO ONE FORMAT ON YOUR OWN SYSTEM IF POSSIBLE! If you change to read a foreign disc, CHANGE BACK AGAIN. Due to the fact that the directory is in the same place on either RX03 format, you can UTTERLY CREAM YOUR DISCS if (by accident) you mix the formats! ---------------------------------------------------------------------- CHAPTER 5 TSMUNG - for modifying TSX plus With the advent of TSX-plus version 6, no matter what is specified in the TSGEN file (eg DEVDEF ,MAPH,HANBUF,DMA) TSX refuses to allow the DY or the DU handler to be mapped into high memory. This is fine to protect people trying to do this with DEC or S & H handlers, but is a nuisance when we have a legitimate handler capable of this performance. A programme TSMUNG is provided. This modifies the default values set up for the DU and/or DY devices. It is run, using the name of the TSX.SAV file to be modified appropriately. To modify the DY value, append /Y to the filename. (To modify the DU, append /U). [No switches implies /U only.] .Run TSMUNG *sy:tsx.sav/y Successful TSX modification . or .Run TSMUNG sy:tsx.sav/y Successful TSX modification . If it should be desired to run the DU handler mapped in addition to the DY handler (WARNING - again, make sure your handler is capable of being run mapped and is not the standard DEC or S & H handler), append a /U to the filename in addition to the /Y. For example: .Run TSMUNG du:tsx.sav/y/u Successful TSX modification . If TSMUNG cannot find the relevant string of device names in TSX, it will tell you so. If this is the case, you are probably trying to operate upon a version of TSX different from that for which TSMUNG was written (version 6.01 through 6.4). CHAPTER 6 Building the DYC Handlers The flavours of handler which may be built from DYC.MAC are: (1) Sigma/Dilog (default) (2) MTI (prefix file MTI.MAC) (3) DEC (ibid, DEC.MAC) (4) DSD (ibid, DSD.MAC) (5) special version for 16-bit controllers (TINY.MAC) and for each of these the handlers may be built for any of the flavours of RT-11, or TSX. Prefix files are provided as listed above for these, with the proviso that using no prefix file produces the Sigma/Dilog version of the handler. USE OF THE WRONG HANDLER FOR YOUR PARTICULAR CONTROLLER MAY CAUSE ERRORS OR SYSTEM CRASHES. If you are uncertain as to which controller you have on your system, pull it out and check; if you are uncertain which flavour of the handler you have copied to your system, run it as a programme and type "/H". It will type out the name of the controller it was built for. For example, to produce a handler for an MTI controller running under TSX-plus, use the following: .macro tsxcnd+mti+dyc/obj .link/nobit dyc/exe:dyc.tsx The handlers built in the DYC distribution are all built for the Sigma/Dilog controller. DYC.SYS is the RT-11 FB/SJ version, for vanilla-flavoured RT-11, DYCTIM.SYS is for RT-11 FB/SJ with device timeout support, and DYC.TSX is for TSX-plus. CHAPTER 7 Notes for TSX-plus 7.1 "Filler" Buffer Use of a mapped handler under TSX-plus places that handler up in the top of memory. For writing the "filler" sectors (sectors which would not otherwise be written on incomplete block writes) it is necessary that a DY handler be able to write a zero word from itself out to the disc. This causes a problem where the controller is only an 18-bit one, and the system has more than 256k of memory. To get around this, the location 500 is used as a "dummy" buffer. This will only cause trouble if your system has a device with a vector at 500. If this is the case, adjust this value upwards accordingly. 7.2 MIONBF and the DEC and DSD Versions Under TSX-plus, the DEC and DSD handlers will require MIONBF and MIOBSZ to be set non-zero (unless the system has only 256K of memory on it), as the corresponding devices can only work in the first 256K of memory . 7.3 EVNBUF - Handlers Require Even Buffer Addresses Under TSX-plus all these handlers should be set EVNBUF in the DEVDEF section of TSGEN.MAC, as otherwise it is possible to crash the system should a buffer at an odd address be passed to the handler. (This would be a pretty unlikely happening, but is mentioned for safety. I think, but have not proved, that this crashing is only possible using the special DY SPFUNs.) CHAPTER 8 Distribution DYC is usually distributed with DUCM, the internally-queueing DU handler from the same author. The files in the DYC distribution are: DYC.MAC Source DYC.RNO Documentation DYC.DOC DYC.SYS Native RT-11 handler DYCTIM.SYS Handler for RT with timeout support DYC.TSX TSX-plus handler DYC.COM Assembly command file (Sigma/Dilog) DYCTST.COM Full test-assembly command file MTI.MAC Command files for non-Dilog flavours of DYC - MTI DSD.MAC DSD DEC.MAC DEC, 1-sided discs DEC2.MAC DEC, 2-sided discs ANDROM.MAC Andromeda controller TINY.MAC 16-bit controller TSMUNG.MAC Programme to allow TSX DY to be mapped TSMUNG.SAV TIMIT.MAC RT-11/TSX prefix files ERLG.MAC MMGT.MAC TSXPRE.MAC - o O o -