Subject: standalone TS-11 driver is broken (#190)
Index:	pdpstand/ts.c 2.11BSD

Description:
	The standalone TS driver has a fatal flaw in it which causes
	'boot' to hang.

Repeat-By:
	Create a bootable TS tape using a TK-25.  Boot the tape and at
	the ':' prompt enter "ts(0,1)" to load the standalone 'mkfs'
	program.

Fix:
	This is one of those "how did it ever work" bugs.  The problem is
	that for record (or file) 'space forward' commands the TS command
	packet requires a "repeat count" rather than the low order of a
	buffer address.

	An optimization was made to use the 'space forward file' rather
	than the much slower 'space forward record' command.  This makes
	seeking to the specified files (mkfs, restor, the root dump) much
	faster.

	Save the patch below to a file (/tmp/foo) and then:

		cd /sys/pdpstand
		patch -p0 < /tmp/foo
		make
		install -s boot /boot

===========================cut here
*** /sys/pdpstand/ts.c.old	Wed Apr 24 20:32:32 1991
--- /sys/pdpstand/ts.c	Fri Jul 15 23:52:29 1994
***************
*** 3,9 ****
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)ts.c	2.0 (2.11BSD) 4/20/91
   */
  
  /*
--- 3,9 ----
   * All rights reserved.  The Berkeley software License Agreement
   * specifies the terms and conditions for redistribution.
   *
!  *	@(#)ts.c	2.1 (2.11BSD) 7/15/94
   */
  
  /*
***************
*** 74,81 ****
  	tsstrategy(io, TS_REW);
  	skip = io->i_boff;
  	while (skip--) {
! 		io->i_cc = 1;
! 		while (tsstrategy(io, TS_SFORW))
  			continue;
  	}
  	return(0);
--- 74,81 ----
  	tsstrategy(io, TS_REW);
  	skip = io->i_boff;
  	while (skip--) {
! 		io->i_cc = 0;
! 		while (tsstrategy(io, TS_SFORWF))
  			continue;
  	}
  	return(0);
***************
*** 99,104 ****
--- 99,106 ----
  	combuf[ctlr]->c_loba = (u_short) io->i_ma;
  	combuf[ctlr]->c_hiba = segflag;
  	combuf[ctlr]->c_size = io->i_cc;
+ 	if (func == TS_SFORW || func == TS_SFORWF)
+ 		combuf[ctlr]->c_repcnt = 1;
  	if (func == READ)
  		combuf[ctlr]->c_cmd = TS_ACK|TS_RCOM;
  	else if (func == WRITE)
