PUTR V1.28 FILE TRANSFER PROGRAM Copyright (C) 1995-1998 by John Wilson All rights reserved Release date: 11-Jun-1998 PUTR is a copyrighted but freely distributable utility for transferring files between various file systems and various media. It is named after PUTR.SAV (Peripheral Utility Transfer Routines), the utility which performs the same function under the DEC TSS/8.24 operating system for the PDP-8. The only file systems currently fully supported are OS/(27)8, RT-11, and PC-DOS; read-only access to RSTS/E disks is also available. Support for COS-310 text files is planned (and existed in an ancient version that was never released) but not yet re-implemented (COS-310 binary files are accessed the same way as with OS/8). Support for the TSS/8 PUTR and COPY DECtape formats may be added later, so that PUTR can live up to its name. All file systems other than PC-DOS must be logically mounted and assigned a logical device name before use. This is done with the MOUNT command. PUTR is mainly intended to work on logical devices contained in disk image files (normally a block-by-block copy of the foreign disk), but it also supports raw SCSI disks (through an ASPI driver), DEC TU58 tape drives (plugged into a COM port), RX50 (including a double sided variant) and RX33 floppy disks or RX01/02/03 26-sector workalike disks mounted on a 1.2 MB drive, and RX24, RX23, and RX26 720 KB/1.44 MB/2.88 MB disks on an appropriate 3.5" drive (even though none of these was supported by standard DEC controllers on machines using these file systems). PUTR can format any of these types of floppy disks. Note that most PC floppy controllers don't work correctly in single density mode (some made by SMC, WD, Goldstar, Intel (but not the 82078), and National Semiconductor are known to work). On a controller with a working single density mode, the RX01 format is exactly compatible with genuine RX01 disks (i.e. IBM 3740 format) mounted in an 8" drive connected in place of a 1.2 MB one (using an adapter cable). The "RX02" format is actually IBM System 34 format, since DEC's 8" DD disks use a strange combination of SD headers and DD data fields that can't be done with a PC FDC. The 26-sector 5.25" disk formats are compatible with those used by the Ersatz-11 PDP-11 emulator, a demo version of which is available from FTP.DBIT.COM in the /pub/e11 directory. When PUTR is run, it looks for an indirect command file named "PUTR.INI", first in the current directory, then in the directory where the executable is located (for PC-DOS 3.0 and later only). If found, this file is opened as an indirect command file before the first command prompt. This is a convenient place to put SET commands, and MOUNT commands for the disk image file(s) that you usually use. FILENAMES [ldevu:][dir][filename] As much as possible, the filename syntax is intended to look similar to that of the host operating system for the volume on which the file is located. The ldevu: parameter is the logical device and unit number where the file is located. The device name is one or two letters with an optional unit number in the range 0-255. Logical devices are mounted using the MOUNT command, or they may be PC-DOS drives (which are all implicitly mounted under the native file system (i.e. PC-DOS)). The device name syntax is intended to mimic that of the DEC PDP-11 OSes for convenience only, at the moment no significance is attached to the device name (different units of the same device name have nothing to do with each other, and for example DL0: need not be an RL01/02 image). This may change. If the ldevu: parameter is omitted, the current logged-in logical device is assumed (you log into a device by typing the device name and a colon at the prompt, just like in PC-DOS). The dir parameter is the directory in which the file is located (by default, the current working directory on that logical device). With PC-DOS drives this is the usual sequence of directory names separated by \ (or / if that isn't your SWITCHAR). RT-11 drives use the same syntax as PC-DOS, to refer to nested logical disk files (LD:); the default extension is ".DSK". "." and ".." are fake directory names and have the same meanings as under PC-DOS. Note that PUTR doesn't assume that it can tell the difference between a directory and an ordinary file (because under RT-11 there is no difference), so all pathname elements must end in \ (except the final one in a CD command). So if you want to list the parent directory, type "DIR ..\" instead of "DIR ..". RSTS drives use directory names of the form [proj,prog], with the project and programmer numbers in decimal. The one-character logical names !, #, $, %, and & also work. The filename syntax depends on the file structure of the drive; under all supported file structures it is of the form "filename.ext", where the length of the filename and extension have fixed limits for each OS. Note that the parsing and wildcard matching routines make no assumptions about filename syntax (except for adding default "*"s depending on whether they see a "." anywhere in the filespec), so it is possible to fool them. For example, typing "DIR ????????A.*" on a PC-DOS disk will not give an error message, but it's impossible for anything to match this spec. The wildcard parser is smarter than the one in PC-DOS -- '*' and '?' really work the way they should (in PC-DOS a '*' is equivalent to filling out the rest of the field with '?'s instead of really matching 0 or more characters, and in PC-DOS '?' will match a blank, which IMHO it shouldn't). COMMANDS @ filename[.CMD] Redirects input so that commands come from the specified indirect command file (with default extension ".CMD"). Indirect files chain rather than nesting, if an "@" command appears inside an indirect file the file is closed and new input comes from the specified file. At end of file input reverts to the keyboard. BOOT ldevu: On RT-11 volumes only, makes a volume bootable. The volume must contain the needed .SYS files (monitor, system device handler, TT: device handler), there are prompts that let you choose which monitor to boot and which device handler the bootstrap should be for. At each prompt you may enter a blank line to display a list of all .SYS files on the volume, or a filename (default extension ".SYS") to use. The action performed is exactly equivalent to COPY/BOOT under RT-11. CD ldevu:dir Changes the current working directory on the specified drive (default is the current logged-in drive). If no directory is given the current working directory is displayed. CLS Clears the screen. COPY[/BINARY][/OVERRIDE] ldevu:inspec ldevu:outspec Copies the specified file(s), converting between file systems if necessary. Files are assumed to be ASCII (NULs are squeezed out, two 12-bit words are unpacked to three 8-bit characters, etc.) unless the /BINARY switch is given; this default may be changed with the SET COPY command. If an output file has the same name as an existing file in the same directory, then the existing file is deleted, unless it is protected; the /OVERRIDE switch overrides this protection. Not all file systems support protection. In a binary copy between 12- and 16-bit media, the 12-bit words are considered to be right-justified in 16-bit words (PDP-11 byte order); the remaining four bits are ignored on input and written as 0 on output. COPY/DEVICE[/FILES][/BINARY] ldevu:[inspec] ldevu:[outspec] Does an image copy from one device to another, or between a device and a file. By default the copy is done in logical block order, which is to say the 512-byte blocks are copied in order starting at block 0. If you're copying a floppy disk (or an image of one) then /BINARY means to copy in physical sector order, starting with cylinder 0 head 0 sector 1, and proceeding in sequential sector order, copying both surfaces of each cylinder (if double sided) before proceeding to the next cylinder. This copies all sectors of the disk, even those not used by the DEC interleave schemes (on RX01, RX02, and RX03 disks, DEC leaves out track 0), and the resulting image files are more likely to be in the right order if they aren't really DEC disks. This use of /BINARY is not affected by the SET COPY command. DELETE[/NOQUERY][/OVERRIDE] ldevu:filespec Deletes the specified file(s), prompting before each unless /NOQUERY is specified. If a file is protected, it is not deleted unless the /OVERRIDE switch is given. DIRECTORY ldevu:wildcard [/FULL] Displays a directory of the indicated file(s). /FULL gives the starting block numbers of files as well on OS/8 or RT-11 volumes. DISMOUNT ldevu: [/UNLOAD] Undoes the effect of a MOUNT command (q.v.). Closes any image file associated with the logical device, or releases the COM port or floppy drive or SCSI device, and deletes the logical name definition. /UNLOAD ejects the disk on SCSI drives that support this. EXIT Returns to PC-DOS. FORMAT d: /devtype /ostype Formats the disk in PC-DOS floppy drive d: to the type specified by /devtype (/RX01, /RX02, /RX03, /RX23, /RX24, /RX26, /RX33, /RX50, /RX52 -- default depends on drive type and is /RX50 for 1.2 MB drives or if the drive type is unknown). The /ostype switch is optional and tells PUTR to write a blank directory structure for the specified OS. It may also affect the interleave and skew used for formating, if appropriate for that OS. Note that for RX50 format, double density disks (e.g. PC 360 KB disks) should be used rather than the PC high density 1.2 MB disks. Opinion is divided as to whether the hub rings should be peeled off before use -- as they age they may slide slightly out of place so that the disk doesn't center properly, but then again they're there to protect the disk and without them it's more likely to get damaged. In any case the 1.2 MB disks don't erase/rewrite properly in double density mode (RX50s are double density disks), even if they appear to format OK (which might happen if they were bulk erased first) they can't be trusted as RX50s. FORMAT dev:filename /devtype /ostype Creates an image file of the specified device type. The file is initialized to zeros and an empty bad sector file is written if appropriate (you will be prompted for a pack serial number for device types that have them). If no device type is given then PUTR assumes nothing and just prompts for the file size and creates a zeroed file of that size. As above, if /ostype is specified then a blank directory is written. INITIALIZE vol /devtype /ostype Writes a blank directory on the specified volume or image file (only /OS8 and /RT11 are allowed as /ostype switches at this time). Prompts for any needed information. "vol" is a file, floppy drive, SCSI device, or COM port name the same as in FORMAT and MOUNT. For initializing RT-11 volumes, there is a "/SEGMENTS:n" switch which sets the number of directory segments (default depends on size of volume as with RT-11 DUP.SAV). MOUNT ldevu: image /devtype /ostype Mounts a disk image on a logical device name for later use. "ldevu:" is a logical device name (1 or 2 letters) and optional unit number. The device name is arbitrary, but I may change things so that the device name dictates the emulation (i.e. "DL1:" must be an RL01 or RL02) since that will make it possible to have useful defaults for /devtype in case file size alone isn't enough to tell. "image" is the location of the disk image. Possibilities are as follows: [d:][path\]filename[.DSK] (name of a DOS file) The specified file contains a raw image of the disk. This is known as an "image file" or "container file", and is commonly obtained by downloading a disk from a live machine over a serial or network connection, although PUTR can also create them itself (see FORMAT). d: (name of a PC floppy drive) The raw floppy disk is used to hold the volume. This should not be confused with an image file on a DOS diskette, the disk uses the foreign file system and in most cases will interchange with the foreign machine. In a MOUNT command, if the "ldevu:" logical device name is omitted, the floppy name will be used. For example you may "MOUNT B: /RT11 /RX50" and then "DIR B:". SCSIht_l: (SCSI disk) This form allows a raw SCSI disk to be mounted using a foreign file system. The "SCSIht_l:" device name specifies a SCSI disk (accessed through an ASPI manager) at host adapter "h" (A=0, B=1, etc.), target "t", and LUN "l", where h, t, and l (as well as the underscore character) are all optional (the defaults are "SCSIA0_0:"). On most systems there will be only one SCSI host adapter, and most disks have only one logical unit, so in most cases the device name may be something like "SCSI5:", which specifies SCSI target #5. COMn:bbbbb/DRIVE:u (TU58 tape drive) This specifies an actual DEC TU58 drive connected to COM port "n", at baud rate "bbbbb" (default is 38400), unit u (0 or 1, default is 0). The /devtype switch specifies the device type of the image; the defaults are auto-sensed except for TU58 drives where obviously the default is always /TU58. With image files the default device type depends on the file size, and is the largest defined device less than or equal to the file in length. With floppies various reads are attempted to detect the disk type. Possible switches are as follows: /RX01 = RX01 disk, 5.25" RX01 workalike /RX02 = 5.25" RX02 workalike /RX03 = DS 5.25" RX02 workalike NOTE: for image files of the above devices, the file size is used to determine which disk type it is and whether the file is a block-by-block image (as obtained by a "COPY/DEVICE/FILES DY0: FLOPPY.IMG" command under RT-11, for example) which has had interleave and skew applied to it by the PDP-11 device driver that read it, or a sector-by-sector image (as might be obtained by any simple program that reads the sectors off sequentially and puts them in order into a file). Block-by-block image files of 8" disks are slightly smaller because the interleave/skew scheme skips track 0. /RX23 = 1.44 MB 3.5" disk /RX24 = 720 KB 3.5" disk /RX26 = 2.88 MB 3.5" disk /RX33 = 1.2 MB 5.25" disk /RX50 = 400 KB 5.25" disk NOTE: RX50 image files are the same size whether they have interleave or not, so PUTR tries it both ways while trying to guess the OS type. /RX52 = DS RX50, 800 KB 5.25" disk (my own name) The following switches are also supported: /RA60, /RA70, /RA71, /RA72, /RA73, /RA80, /RA81, /RA82, /RA90, /RA92, /RK02, /RK05, /RK06, /RK07, /RL01, /RL02, /RS03, /RS04, /TU56, /TU58. These switches set the device type to the indicated DEC drive model. Since there is no way to connect most of these devices directly to a PC (unlike floppies), the effect of these switches is to specify the exact size of the volume, and for the FORMAT command, there is special handling of RL01/02 and RK06/07 drives for building a blank bad sector track and deducting the correct amount from the RT-11 volume size to allow for replacement blocks. The /ostype switch specifies the file structure on the device; it must be /RSTSE, /RT11, /OS8, or /FOREIGN. If none is specified then PUTR examines the home block (or performs a directory consistency check for OS/8 volumes) to guess the disk format. If the volume appears to have no known directory, or appears to be valid for more than one file structure, then a message is displayed and the volume is not mounted. Mounting a disk with /FOREIGN would be pointless (since no directory operations are allowed) except that it makes it usable with the COPY/DEVICE command so it can be used to transfer an image of the disk to or from a file. There are a few miscellaneous switches. /INTERLEAVE and /NOINTERLEAVE tell whether an image file is interleaved (i.e. a block-by-block copy of a floppy disk so the data are in block order, not sector order) or non-interleaved (i.e. a sector-by-sector copy so the data are in sector order). The default is to guess based on the image file size (or prompt in the case of FORMAT, which takes the same switches). /PARTITION:n specifies the RT-11 DU: partition number (default is 0). /RONLY and /RW tell whether the device should be mounted for read-only or read/write access. The default is read/write. All of the above switches may be given in any order. QUIT Returns to PC-DOS. SET COPY {ASCII | BINARY} Sets the default transfer mode for the COPY command (initially ASCII). Intended mainly for use in the PUTR.INI command file. SET DISMOUNT {NOUNLOAD | UNLOAD} Sets the default unload action of DISMOUNTs, both explicit, and implied by QUITting, or reMOUNTing the pseudo-device as something else. Default is NOUNLOAD. Intended for use in PUTR.INI with drive models where the disk shouldn't be left in the drive when it's powered off. SET FDC {COMPATICARD | GENERIC} Tells PUTR whether your floppy disk controller is a Micro Solutions CompatiCard IV, or just a generic PC floppy controller. If it is a CompatiCard, PUTR maintains the TG43 signal (for 8" drives) by writing to port 3F0h; normal FDCs have no writable port at that address and don't do anything when it gets written so the default is COMPATICARD to cover everything, but if your FDC does strange things when that port is written you should SET FDC GENERIC. SET MORE {OFF | ON} Turns **MORE** processing on or off; the default is on. As above, intended mainly for use in PUTR.INI. SHOW ldevu: Shows the medium and file system types for the specified logical device. TYPE ldevu:wildcard Types the specified file(s) on the terminal, printing the filename(s) first. WIPEOUT ldevu:dir Writes zeros over all < UNUSED > areas so that disk image files will compress smaller with GZIP (etc.) and/or transfer faster with Kermit (etc.). Supported only for OS/8 and RT-11. Note: "Ersatz" and "E11" are trademarks of Digby's Bitpile, Inc. All other trademarks are used for identification purposes only and are the property of their respective owners. John Wilson Digby's Bitpile, Inc. DBA D Bit 11 Bank Street Troy, NY 12180 USA +1 (518) 271-6824 +1 (518) 272-3853 fax www.dbit.com