From: Charlie_Gibbs@mindlink.bc.ca (Charlie Gibbs)
Newsgroups: alt.folklore.computers
Subject: Re: IBM vs. world terminology (was: What does dd stand for?)
Date: 28 Jul 92 23:40:58 GMT
Organization: MIND LINK! - British Columbia, Canada
Distribution: world

In article <jimf.712349554@centerline.com> jimf@centerline.com
(Jim Frost) writes:

>The DASD devices had tracks that could be formatted to (for all
>practical purposes) any size sector up to the physical capacity of the
>track.  Most of the time you set the sector size to the size of the
>record for convenience.

     As with tape, you'd usually go for some multiple of record size;
if your records were small you'd lose more space to inter-record
gaps.  If you chose a good blocking factor you'd nicely fill up
the entire track; a bit too big and you'd wind up with nearly a
full block's worth of unusable space at the end of each track.
I wrote a program that would calculate optimum blocking factors
for a given record size.

>                                             Anyway until you wrote
>something on that track I don't think it was formatted at all,

     Actually you had to format new packs to get a valid record zero
written on each track.  R0 didn't hold any user data, but was a
"track descriptor" record; among other things it indicated that the
track was good, or pointed to the alternate track if not.

>                                                               but
>once you wrote one record the DASD device would write the entire track
>(it may have only done part of the track, it's kind of hard to tell
>from the software vantage point).

     Our manuals stated that a "write count, key, and data" command
erased the remainder of the track.  Write data (or key and data)
would update the data (and possibly key) portions in place, leaving
the remainder of the track undisturbed.  You wanted to be sure you
told it to write back the same number of bytes as were already there.

     Channel programing was a rich field for hackers; I once cribbed a
CCW (channel command word) chain that would look in the VOL1 (volume
header) label for the location of the VTOC, use the address field it
just read for a seek to the VTOC, then issue a multi-track "search
key equal" command to search the entire VTOC for a given file's
format 1 label and read it in if it found it.  My low-level programs
could thus get a file open for reading with a single I/O instruction.
It was fast.  :-)

     Another nifty channel program hack was a fast disk copier.  The
standard copy utility issued by Univac took an hour to copy an 8414
disk (their copy of an IBM 2314, about 29 megabytes).  Since you had
no way of knowing how long the records were on a given track (or even
if they were all the same length) you had to do a bit of analysis.  I
got my hands on a program that issued 100 "read count" commands.  The
count field preceded the actual record data and indicated how many
bytes of key and data information the record contained.  With this
information the program would build a CCW chain tailored exactly to
the current track, and read it in a single revolution of the disk
regardless of its format.  Then, by changing all the read commands
to writes, it would write the track to the destination drive in one
revolution.  Even better, because the "multi-track" bit was set in
that original "read count" chain, once you hit the end of a track
the controller would automatically switch to the next head and
continue reading; you'd have gotten track format information for
most of the cylinder in one shot so you could just build CCW chains
and read and write several tracks before going back for more format
information.  With a bit of polishing I got the program to where it
would do that hour-long copy in 8 minutes - great for backups.

     Finally, of course, there's the nasty little channel program
that seeks to cylinder 0, seeks to cylinder 202 (the highest available
on those drives), then loops back to the beginning.  The disk drive
tries to walk out of the room, and halting the processor won't stop
it.  :-)

Charlie_Gibbs@mindlink.bc.ca
"I'm cursed with hair from HELL!"  -- Night Court

Newsgroups: alt.folklore.computers