The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-19 13:41 Noel Chiappa
  2017-11-19 14:55 ` Clem cole
  2017-11-19 14:55 ` Will Senn
  0 siblings, 2 replies; 47+ messages in thread
From: Noel Chiappa @ 2017-11-19 13:41 UTC (permalink / raw)


    > From: Will Senn

    > I don't quite no how to investigate this other than to pore through the
    > pdp11/40 instruction manual.

One of these:

  https://www.ebay.com/itm/Digital-pdp-Programming-Card-8-Pages/142565890514

is useful; it has a list of all the opcodes in numerical order; something none
of the CPU manuals have, to my recollection. Usually there are a flock of
these "pdp11 Programming Cards" on eBait, but I only see this one at the
moment.

If you do any amount of work with PDP-11 binary, you'll soon find yourself
recognizing the common instructions. E.g. MOV is 01msmr (octal), where 'm' is
a mode specifier, and s and r are source and destination register
numbers. (That's why PDP-11 people are big on octal; the instructions are easy
to read in octal.) More here:

  http://gunkies.org/wiki/PDP-11_architecture#Operands

So 0127xx is a move of an immediate operand.


    >> You don't need to mount it on DECTape drive - it's just blocks. Mount
    >> it as an RK05 image, or a magtape, or whatever.

    > I thought disk (RK05) and tape (magtape) blocks were different...

Well, you need to differentiate between DECtape and magtape - very different
beasts.

DECtape on a PDP-11 _only_ supports 256 word (i.e. 512 byte) blocks, the same
as most disks. (Floppies are an exception when it comes to disks - sort
of. The hardware supports 128/256 byte sectors, but the usual driver - not in
V6 or V7 - invisibly makes them look like 512-byte blocks.)

Magtapes are complicated, and I don't remember all the details of how Unix
handles them, but the _hardware_ is prepared to write very long 'blocks', and
there are also separate 'file marks' which the hardware can write, and notice.

But a magtape written in 512-byte blocks, with no file marks, can be treated
like a disk; that's what the V6 distribution tapes look like:

  http://gunkies.org/wiki/Installing_UNIX_Sixth_Edition#Installation_tape_contents

and IIRC 'tp' format magtape tapes are written the same way, hardware-wise (so
they look just like DECtapes).

     Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-20 19:42 Noel Chiappa
  0 siblings, 0 replies; 47+ messages in thread
From: Noel Chiappa @ 2017-11-20 19:42 UTC (permalink / raw)


    > From: Will Senn

    > I'm off to refreshing my pdp-11 assembly language skills...

A couple of things that might help:

- assemble mboot.s and 'od' the result, so when you see something that matches
  in the dump of the 0th block, you can look back at the assembler source, to see
  what the source looks like

- read the boot block into a PDP-11 debugger ('db' or 'cdb' on V6, 'adb' on
  V7; I _think_ 'adb' was available on V7, if not, there are some BSD's that
  have it) and use that to disassmble the code

	Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-20 17:00 Noel Chiappa
  0 siblings, 0 replies; 47+ messages in thread
From: Noel Chiappa @ 2017-11-20 17:00 UTC (permalink / raw)


    > From: Will Senn

    > I don't see this file in the tuhs source code index

OK, here it is:

  http://ana-3.lcs.mit.edu/~jnc/tech/unix/s2/stp.h
  http://ana-3.lcs.mit.edu/~jnc/tech/unix/s2/stp1.c
  http://ana-3.lcs.mit.edu/~jnc/tech/unix/s2/stp2.c
  http://ana-3.lcs.mit.edu/~jnc/tech/unix/s2/stp3.c

That MIT PWB1+ tape has so many treasures on it! (We've already seen all the
early networking software.) I really must getting around to curating it, and
making the whole works available.

	Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-20 16:01 Noel Chiappa
  2017-11-20 17:37 ` Will Senn
  0 siblings, 1 reply; 47+ messages in thread
From: Noel Chiappa @ 2017-11-20 16:01 UTC (permalink / raw)


    > The 0th block does seem to contain some PDP-11 binary - a bootstrap of
    > some sort. I'll look in more detail in a bit.

OK, I had a quick look, and it seems to be a modified version of mboot.s:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/mdec/mboot.s

I had a look through the rest of the likely files in 'mdec', and I didn't find
a better match. I'm too lazy busy to do a complete dis-assembly, and work out
exactly how it's different, though..


A few observations:

  000:    000407 000606 000000 000000 000000 000000 000000 000001 

An a.out header, with the 0407 'magic' here performing its original intended
function - to branch past the header.

  314:	105737 177560 002375

Some console I/O stuff - this two instruction loop waits for the input
ready bit to be set.

  326:	042700 177600 020027 000101 103405 020027 000132 101002

More character processing - the first instruction clears the high bits of R0,
and the next two sets of two instructions compare the contents with two
characters (0101 and 0132), and branch.

  444:    000207 005000 021027 000407 001004 016020 
  460:    000020 020006 103774 012746 137000 005007

This seems like the code that checks to see if the thing is an a.out file
(note the 'cmp *r0, $0407'), but the code is different from that code in
mboot.s; in that, the instruction before the 'clr r0' (at 0446 here) is a
'jsr', whereas in this it's an 'rts pc'. And the code after the 'cmp r0, sp'
and branch is different too. I love the '05007' - not very often you see
_that_ instruction!

  502:    012700 177350 012701 177342 012711 000003 105711 

Clearly the code at 'taper:' (TC11 version).

	Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-19 20:46 Steve Simon
  0 siblings, 0 replies; 47+ messages in thread
From: Steve Simon @ 2017-11-19 20:46 UTC (permalink / raw)


It can be hard to visualise what is on a tape when you have no idea
what is on there.

Attached is a simple tool I wrote "back then", shamlessly copying an
idea by Paul Scorer at Leeds Poly (My video systems lecturer).

It is called tm (tape mark).

-Steve
-------------- next part --------------
/* tm.c - read tape marks */
#include <stdio.h>
#include <signal.h>

int halt = 0;
void intr();


int main(int argc, char *argv[])
{
	int fd;
	static char buf[BUFSIZ * 128];
	int got = 0, data = 0, mark = 0, was = -1;
	char *dev = "/dev/tape";

	if (argc > 1)
		dev = argv[1];

	if ((fd = open(dev, 0)) == -1){
		perror(dev);
		return(-1);
	}

	signal(SIGINT, intr);

	do {
		got = read(fd, buf, sizeof(buf));
		got = (halt)? -1: got;		/* check for restarted system call */
		mark = (was == 0)? mark +1: 0;
		data = (was >  0)? data +1: 0;

		if (got != was && was > 0){
			printf("%-6d X %-6d\n", data, was);
			mark = 0;
		}

		if (got != was && was == 0){
			printf("tm     X %-6d\n", mark);
			data = 0;
		}

		was = got;
	} while(got != -1);
	close(fd);

	if (halt){
		puts("Interupted");
	}
	else{
		fflush(stdout);
		perror("EOF");
	}

	return(0);
}

void intr()
{
	halt = 1;
}


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-19 18:45 Noel Chiappa
  0 siblings, 0 replies; 47+ messages in thread
From: Noel Chiappa @ 2017-11-19 18:45 UTC (permalink / raw)


    > From: Arthur Krewat

    > For anyone reading old tapes, I implore you to attempt to read data past
    > the soft EOT ;)

The guy who read my tape does in fact do that; you'll notice my program has an
option for looking for data after the soft EOT.

       Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-19 17:49 Noel Chiappa
  2017-11-19 18:35 ` Arthur Krewat
  0 siblings, 1 reply; 47+ messages in thread
From: Noel Chiappa @ 2017-11-19 17:49 UTC (permalink / raw)


    > From: Will Senn

    > I think I understand- the bytes that we have on hand are not device
    > faithful representations, but rather are failthful representations of
    > what is presented to the OS. That is, back in the day, a tape would be
    > stored in various formats as would disks, but unix would show these
    > devices as streams of bytes, and those are the streams of bytes are what
    > have been preserved.

Yes and no.

To start with, one needs to differentiate three different levels; i) what's
actually on the medium; ii) what the device controller presented to the CPU;
and iii) what the OS (Unix in this case) presented to the users.

With the exception of magtapes (which had some semantics available through
Unix for larger records, and file marks, the details of which escape me - but
try looking at the man page for 'dd' in V6 for a flavour of it), you're correct
about what Unix presented to the users.


As to what is preserved; for disks and DECtapes, I think you are broadly
correct. For magtapes, it depends.

E.g. SIMH apparently can consume files which _represent_ magtape contents (i,
above), and which include 'in band' (i.e. part of the byte stream in the file)
meta-data for things like file marks, etc. At least one of the people who
reads old media for a living, when asked to read an old tape, gives you back
one of these files with meta-data in it. Here:

  http://ana-3.lcs.mit.edu/~jnc/tech/pdp11/tools/rdsmt.c

is a program which reads one of those files and convert the contents to a file
containing just the data bytes. (I had a tape with a 'dd' save of a
file-system on it, and wanted just the file-system image, on which I deployed
a tool I wrote to grok 4.2 filesystems.)


Also, for disks, it should be remembered that i) and ii) were usually quite
different, as what was actually on the disk included thing like preambles,
headers, CRCs, etc, none of which the CPU usually could even see. (See here:

  http://gunkies.org/wiki/RX0x_floppy_drive#Low-level_format

for an example. Each physical drive type would have its own specific low-level
hardware format.) So what's preserved is just an image of what the CPU saw,
which is, for disks and DECtapes, generally the same as what was presented to
the user - i.e. a pile of bytes.

     Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-18 19:23 Noel Chiappa
  2017-11-18 21:32 ` Will Senn
  0 siblings, 1 reply; 47+ messages in thread
From: Noel Chiappa @ 2017-11-18 19:23 UTC (permalink / raw)


    > From: Clem Cole

    > stp is from the Harvard distribution.

The MIT PWB1 system I have has the source; the header says:

      M. Ferentz
      Brooklyn College of CUNY
      September 1976

If it can't be found on TUHS, I can upload it.

No man page, though. :-(

   Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-18 18:34 Noel Chiappa
  2017-11-18 18:37 ` Ronald Natalie
  2017-11-18 21:07 ` Will Senn
  0 siblings, 2 replies; 47+ messages in thread
From: Noel Chiappa @ 2017-11-18 18:34 UTC (permalink / raw)


     > From: Will Senn

    > So, I came across this tape:
    > ...
    > I was curious what was on it

'od' is your friend!

If you look here:

  http://mercury.lcs.mit.edu/~jnc/tech/V6Unix.html#dumpf

there's a thing which is basically 'od' and 'dd' rolled in together, which
allows you to dump any block you want in a variety of formats (ASCII, 16-bit
words in octal [very useful for PDP-11 binary], etc). I wrote it under CygWin,
for Windows, but it only uses the StdIO library, and similar programs (e.g. my
usassembler) written that way work fine under Losenux.

Try downloading it and compiling it - if it doesn't work, please let me know;
it'd be worth fixing it so it does work on Linux.


    > after some fiddling, I figured out that I could get a boot prompt (is
    > that actually from the tape?)

The 0th block does seem to contain some PDP-11 binary - a bootstrap of some
sort. I'll look in more detail in a bit.

    > I was thinking this was a sixth edition install tape of some sort, but
    > if it is, I'm not able to figure it out.

From what I can see, it's probably a tp-format tape: the 1st block contains
some filenames which I can see in an ASCII dump of it:

  speakez/sbrk.s
  dcheck.c
  df.c
  intel/as80.c
  intel/optab.8080


    > v7 and look at its content using tm or tp, but then I realized that I
    > didn't have a device set up for TU56

You don't need to mount it on DECTape drive - it's just blocks. Mount it as
an RK05 image, or a magtape, or whatever.


    > When you received an unmarked tape back in the day, how did you go about
    > figuring out what was on it?

Generally there would have been some prior communication, and the person
sending it would have told you what it was (e.g. '800 bpi tar', or whatever).

    > What advice would you give a future archivist to help them quickly
    > classify bit copies of tapes :).

Like I said: "'od' is your friend!"!! :-)

     Noel


^ permalink raw reply	[flat|nested] 47+ messages in thread
* [TUHS] Determining what was on a tape back in the day
@ 2017-11-18 16:39 Will Senn
  2017-11-18 18:57 ` Clem Cole
  0 siblings, 1 reply; 47+ messages in thread
From: Will Senn @ 2017-11-18 16:39 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]

So, I came across this tape:

http://bitsavers.trailing-edge.com/bits/DEC/pdp11/dectape/TU_DECtapes/unix6.dta

I was curious what was on it,  so I read the description at:

http://bitsavers.trailing-edge.com/bits/DEC/pdp11/dectape/TU_DECtapes.txt

UNIX1       PURDUE UNIX TAPES
UNIX2
UNIX4
UNIX6
HARBA1      HARVARD BASIC TAPE 1
HARBA2      HARVARD BASIC TAPE 2
MEGTEK      MEGATEK UNIX DRIVER
RAMTEK      RAMTEK UNIX DRIVER

Cool, sounds interesting, so I downloaded the unix6.dta file and fired 
up simh - after some fiddling, I figured out that I could get a boot 
prompt (is that actually from the tape?) if I:

set cpu 11/40
set en tc
att tc0 unix6.dta
boot tc0
=

At that point, I was stuck - the usual tmrk, htrk, and the logical 
corollary tcrk didn't do anything except return me to the boot prompt.

I was thinking this was a sixth edition install tape of some sort, but 
if it is, I'm not able to figure it out. I thought I would load the tape 
into v7 and look at its content using tm or tp, but then I realized that 
I didn't have a device set up for TU56 and even if I did, I didn't know 
how to do a dir on a tape - yeah, I know, I will go read the manual(s) 
in chagrin.

In the meantime, my question for y'all is similar to my other recent 
questions, and it goes like this:

When you received an unmarked tape back in the day, how did you go about 
figuring out what was on it? What was your process (open the box, know 
by looking at it that it was an x rather than a y, load it into the tape 
reader and read some bytes off it and know that it was a z, use unix to 
read the tape using tm, tp, tar, dd, cpio or what, and so on)? What 
advice would you give a future archivist to help them quickly classify 
bit copies of tapes :).

Thanks,

Will





-- 
GPG Fingerprint: 68F4 B3BD 1730 555A 4462  7D45 3EAA 5B6D A982 BAAF



^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2017-11-21  0:01 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19 13:41 [TUHS] Determining what was on a tape back in the day Noel Chiappa
2017-11-19 14:55 ` Clem cole
2017-11-19 21:00   ` William Corcoran
2017-11-19 21:19     ` Ron Natalie
2017-11-19 22:00       ` Dave Horsfall
2017-11-19 22:38         ` Lyndon Nerenberg
2017-11-19 22:40         ` Ronald Natalie
2017-11-19 23:41           ` Dave Horsfall
2017-11-20  1:02             ` Ronald Natalie
2017-11-20  1:18               ` Dave Horsfall
2017-11-20 18:12                 ` Random832
2017-11-20 23:22                   ` Dave Horsfall
2017-11-20 23:35                     ` William Pechter
2017-11-21  0:01                     ` Ron Natalie
2017-11-20 19:02   ` Paul Winalski
2017-11-19 14:55 ` Will Senn
  -- strict thread matches above, loose matches on Subject: below --
2017-11-20 19:42 Noel Chiappa
2017-11-20 17:00 Noel Chiappa
2017-11-20 16:01 Noel Chiappa
2017-11-20 17:37 ` Will Senn
2017-11-19 20:46 Steve Simon
2017-11-19 18:45 Noel Chiappa
2017-11-19 17:49 Noel Chiappa
2017-11-19 18:35 ` Arthur Krewat
2017-11-18 19:23 Noel Chiappa
2017-11-18 21:32 ` Will Senn
2017-11-18 21:49   ` Warren Toomey
2017-11-18 18:34 Noel Chiappa
2017-11-18 18:37 ` Ronald Natalie
2017-11-18 18:40   ` Ronald Natalie
2017-11-18 21:51   ` Dave Horsfall
2017-11-18 21:07 ` Will Senn
2017-11-18 22:53   ` Clem Cole
2017-11-19  1:47     ` Will Senn
2017-11-18 16:39 Will Senn
2017-11-18 18:57 ` Clem Cole
2017-11-18 20:03   ` Don Hopkins
2017-11-18 22:37     ` Dave Horsfall
2017-11-18 23:16       ` Don Hopkins
2017-11-18 23:35         ` Arthur Krewat
2017-11-19  0:35           ` Steve Nickolas
2017-11-19  0:42             ` Don Hopkins
2017-11-19  1:04               ` Clem cole
2017-11-19 16:20                 ` Arthur Krewat
2017-11-20  2:33         ` Lawrence Stewart
2017-11-18 21:26   ` Will Senn
2017-11-18 22:39     ` Clem Cole

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).