[net.micro] Summary V2: CPM disks on 11/780

david (03/21/83)

I posted the following article to net.followup several weeks ago with
an announcement in net.micro; since then I've received several requests
from people who receive net.micro but not net.followup (mostly ARPA),
so I am posting it again, this time to net.micro and net.unix-wizards.
I have also made some minor updates to the summary, mostly additional
comments I've received since the first posting.  

I received at least one request for info leading to a similar program for
VAX/VMS from
	Dr.  Joel M. Schnur
	Code 6504 Naval Research Laboratory Washington, D.C.  20375
	or Schnur at ISIE
If anyone knows of such a program, I'm sure he'd appreciate hearing about
it.

I am now interested in reading ISIS (Intel MDS), Versados
and UCSD Pascal format floppies as well.  If anyone knows of something
like that or has an interest, please let me know.  Once again, thanks
to everyone who responded to my request.

	David Brown
	Varian Instruments
	2700 Mitchell Dr.
	Walnut Creek, Ca. 94598
	(415) 939-2400
	...!decvax!sytek!zehntel!varian!david
	...!{ucbvax,decvax}!tektronix!zehntel!varian!david
	...!fortune!varian!david
	...!ucbvax!menlo70!sytek!zehntel!varian!david

--------------

Thanks to everyone who responded to my request for a program to read
and write CP/M floppy disks on the console floppy drive built into
every VAX 11/780.  I learned about 3 available programs that run
under 4.1BSD UNIX:

cpmff:
	author: ...!decvax!microsoft!ubc-vision!mprvaxa!cornish
		(Allan Cornish, Microtel Pacific Research)
	This was posted to net.sources (article ID mprvaxa.143) soon after
	my request (2/6/83).

cpm:
	author: ucbvax!helge (Helge Skrivervik)
	This is available from the author and will probably be on
	the 4.2BSD distribution. He is working on improvements (see note).

cpmutl7:
	author: Aaron Wohl (wohl@cmuc)
	This is the original program that I had seen mention of on the net
	but I didn't know how to obtain it. The comments in the source
	say it is available on the Arpanet from:
  		unix host vlsi@cmuc
    		pathname /usr/avw/cpmutl/cpmutlVERSION-NUMBER.c
    		vlsi is on the arpanet running TCP-IP
  		a copy is also kept on mit-mc cpm;ar43:cpmutl VERSION-NUMBERc
  		and on [cmuc]ps:<wohl.bar>cpmutl.c.VERSION-NUMBER
		(for people that can't figure out how to use ITS)
	I received copies from duke!ucf-cs!goldfarb and reece@NADC (Thanks).

The following are my comments on the different programs:

cpmff: Syntax similar to tar and arff commands
       Can create a new floppy or floppy image from scratch
       Cannot add or delete individual files from floppy
       When moving files from unix to CP/M, the user is responsible for
          adding CR to end of line (CP/M wants both CR and LF).
	  (I have written a shell script called cpmtrans to do this:
	  I've added it to the end of this note).
       When transferring files from CP/M to UNIX, sometimes garbage
	  is found after a ^Z at end of file.

cpm:   Can add and delete individual files from floppy
       Cannot create a new floppy from scratch
       Automatically handles appending or deleting of CR at end of line
       Handles EOF of CP/M files correctly
       The interactive mode is very nice: the commands (dir, ren, era,
	  type,etc.) and their responses are similar to CP/M.
       Has help command.

Both cpmff and cpm have manual pages. cpm does not handle CP/M user numbers,
 and I don't think cpmff does either, but I haven't checked.
Both had problems reading CP/M files whose names had a slash in them.

cpmutl7:
	No manual page: the only documentation is in its help command.
	more flexibility with wild card filenames.
	Supports CP/M user numbers.
	Can create a new CP/M directory.

In addition, there is another program called cpm on the 1981 Usenix
distribution tape (rosemount/src/cpm); this runs on a PDP11 under V7 UNIX
(I believe), using a modified RX11 driver (sys/dev/rx.c) that handles
CP/M interleaving.

-------------------------------------------

The following are various comments I received from authors and others
(my comments are in braces):


Date: Sat Feb  5 17:43:18 1983
Subject: cpm on unix
we have taken the cpmutility that we got over the net & made it more
interactive, it seems to work but we are still in process ( no doc yet...)
if you want a copy let me know.
              scott bradner
              harvard university
              ...decvax!genradb!wjh12!sob
[I believe this refers to cpmutl7 - DRB]

>From decvax!microsof!fluke!corey Tue Feb  8 01:51:51 1983 remote from sytek
Date: Mon Feb  7 22:55:08 1983
Subject: cpm floppies

Hi.  One of our guys picked up your news request and forwarded it to me.
I mailed away for the program you mentioned.  The version I got had
bugs.  Substantial bugs.  It didn't successfully figure out when a disk
was full so it wrote forever, AND it didn't write a directory such that
CPM could read it.  I suspect that if you knew what you were doing, both
of these would be pretty simple to fix, cause the code looked pretty
structured judging from the number of procedures and their names.

I got mine from the author: ucbvax!helge

I suspect he has been so innundated with requests that he has regretted
his original publication, but I may be wrong.

			--Corey--
[The manual page says that if the floppy file becomes full, the file
is closed and the command aborted, and data is not corrupted. I haven't
tried it; perhaps this is a later addition - DRB]

>From decvax!cithep!citsrl!mark Mon Feb  7 22:26:45 1983 remote from sytek
Date: Mon Feb  7 09:34 PST 1983
Yes, we have used the program Bridge under unix 7+ system.  The program
does read and write cpm to unix floppies.  Program is a little slow if
you use your system alot.  Now that they have fixed the program to work
with word star it appears to work with most cpm programs.  Why do you 
want to run cpm on your vax ?

	For more information: ...!decvax!cithep!citsrl!mark

Mark
..........

>From decvax!microsof!ubc-vision!mprvaxa!cornish Mon Feb  7 22:26:35 1983 remote from sytek
Date: Mon Feb  7 10:35:58 1983
Subject: reading cpm disks on vax 11/780

I have written a program to read single density, single sided cpm floppies,
utilizing the vax 11/780 console floppy disk drive.  We have used it
successfully to read distribution disks of cpm software, and to write
disks for distributing software.  It works much like the ar command,
but is quite slow, due to requirement to do 128 byte i/o to the floppy,
and the communication that is required between the vax and the console lsi11.
If you feel there is sufficient interest, I can release it to net.sources.
Otherwise, I can mail it to you.

It can be used with the console floppy directly, or with a image file.
The image file can be manipulated using the flcopy(1) command.
Thus, you can flcopy the floppy into a file, then use cpmff on the file.
You can use cpmff to create a floppy image file, then flcopy the file to floppy.
You can use cpmff to directly manipulate the console floppy (if permitted).

	Allan Cornish
	Microtel Pacific Research
	8999 Nelson Way
	Burnaby, B.C. V5A 4B5
	Canada
	(604) 294-1471
	...!decvax!microsoft!ubc-vision!mprvaxa!cornish


>From decvax!duke!mcnc!msdc!gmha!paul Fri Feb 11 10:48:56 1983 remote from sytek
Date-Sent: Thu Feb 10 10:30:15 1983
Subject: CPM disks on 11/780

I have not used any such product but I'm told the Touchstone Software, Inc.
may have exactly what you want and more.

Uh... sorry I can't find their address but their office is in Seal Beach, Ca.
(around Los Angeles). Hope this helps.

	Paul Manno
	Medical Systems Development Corp
	(...decvax!duke!mcnc!msdc!paul)

[DRB: Touchstone is selling a CP/M-under-UNIX simulator, similar to the
Bridge, but much cheaper.  When I talked to them last month, they had
just released their first version for the Zilog system; they have not
done one for the PDP11 or the VAX yet, but will soon. When they do a
VAX version, we'll know if they can read from the floppy drive.
Their address is:
	Touchstone Software Corp.
	909 Electric Avenue Suite 308
	Seal Beach, Ca. 90740
	(213) 594-9266
]


Date: 18 Feb 83 09:55:58 PST (Fri)
From: ucbvax!UCBARPA:helge (Helge Skrivervik)
Subject: unix-cpm.......source

Here's the source, good luck ! Some enhancements may be made in the near
future: initialization of cpm disk files and a copy command for binary
files. If or when this is ready I will post a message to net.sources and
net.info-cpm (whenever that group becomes available again). I plan
to use this program as a base for an equivalent UCSD/unix file transfer
utility in the near future (next three months I hope), but if you get to
know of an existing program that does this, please let me know. I do not
know of any such utility for ISIS (I'm working on one for VERSAdos).
You are welcome to use my letters in summaries or whatever, but don't
redistribute the source, tell those interested where they can get it.

helge

--------------

The following are new responses that have arrived since I posted the first
version of the summary:


>From zehntel!sytek!menlo70!hao!seismo!harpo!eagle!karn Thu Mar 10 21:14:15 1983
Subject: Re: Summary: reading CP/M floppies on 11/780
Newsgroups: net.followup

One comment regarding reading floppies using the console drive on a VAX-11/780:

On the BTL versions of Unix, e.g., System III and V, the floppy driver
is slightly different - it skips the first track and applies the DEC RT-11
sector skew function to the remainder of the disk.  In addition, the
special file for the floppy is usually called /dev/conflp instead of
/dev/floppy.  It is a fairly simple matter to add another minor device
to the console driver to provide raw disk access a la BSD.

Phil
---------------

>From teklabs!reed!omsi Sun Mar  6 00:00:46 1983 remote from tektronix
To: teklabs!tektronix!zehntel!varian!david
Date: Sat Mar  5 21:22:35 1983

Pleeze!! Send info on reading CP/M floppies on the VAX.  We've tried cpmutl.c
(mostly on an 11/70) and it seems to almost work, but appears flakey.  We've
just started playing with it and had to futz with the interleaving, but it
doesn't always seem to see all files in the directory (?)  Thanx,

Bob Ankeney (!teklabs!reed!omsi)
[DRB:
Hi Bob:
I don't know much about doing it on a PDP11/70; the flp.c driver on the
VAX is very much different than the rx.c driver on the UNIBUS.
Have you looked at the rosemount submission on the 1981 Usenix distribution
tape (rosemount/src/cpm/* and rosemount/sys/dev/rx.c)?  They did the
interleaving in the rx driver.  All of the programs I describe below
do interleaving in the program, and leave the driver untouched; however,
at least one (cpmff) gets involved with the RT-11 style interleaving
used by the VAX command flcopy (which is usually used with boot floppies);
it checks if the file is a special file (you are reading directly from
/dev/floppy) or not (you are reading from a floppy image transferred
using flcopy).  Another (cpm) assumes you have used cp /dev/floppy xxxx
to create a floppy image in your directory, so it doesn't distinguish
between /dev/floppy and an image.  I haven't checked what cpmutl7 does.
]

----------
Date: Fri Mar 11 09:14:04 1983
From: seismo!harpo!decvax!genradbolton!linus!sch
Subject: Cp/m floppies

Some comments:
	A) I have used cpmutl sucessfully, it's fairly easy to use, but
syntax is more like Cp/m than Unix.  No bugs detected.
	B) Console floppy is slow because I/O from console to vax is
over internal 9600 baud serial line (honestly).  The 128 byte size
restriction is really immatterial.
	C) We have an rx01 hooked up to our vax, but the driver
sucks, it perodicly gets hung and the job can't be killed.  If someone
has a better driver PLEASE LET ME KNOW.  We can't release the floppies
to our users cause if we did they would have themselves hung up all the time.

-------------
DRB:
PS: here's the cpmtrans shell script. The sed line contains a CR (^M)
after the ampersand which may get eaten by uucp or rnews somewhere:

: shell script to translate NL (LF) to CR LF.
: This is needed when moving files from UNIX to CPM floppies
:  via the cpmff utility.
: usage:  cpmtrans file [file] ...
: The original file will be renamed file.u
: The new file will have the original name.
for i
do
 echo $i
 mv $i $i.u
 sed -e 's/.*$/&
/' $i.u > $i
done