3.5" drive on the UNIXpc - Sources

Darren Friedlein darren at bacchus
Sat Jul 2 15:08:47 AEST 1988


#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive.  Save this into a file, edit it
# and delete all lines above this comment.  Then give this
# file to sh by executing the command "sh file".  The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rw-r--r--  1 bin     bin         191 Jul  2 00:56 MD10Lnl
# -rw-r--r--  1 bin     bin         219 Jul  2 00:56 MD10Lsl
# -rw-r--r--  1 bin     bin         226 Jul  2 00:56 MD10Lvl
# -rw-r--r--  1 bin     bin         188 Jul  2 00:56 MDLnl
# -rw-r--r--  1 bin     bin         216 Jul  2 00:56 MDLsl
# -rw-r--r--  1 bin     bin         224 Jul  2 00:56 MDLvl
# -rwxr-xr-x  1 bin     bin        2034 Jul  2 00:56 fffc
#
echo 'x - MD10Lnl'
if test -f MD10Lnl; then echo 'shar: not overwriting MD10Lnl'; else
sed 's/^X//' << '________This_Is_The_END________' > MD10Lnl
X#sccs	"@(#)iv/lib:MD10Lnl	1.1"
X#	iv description file for 135 TPI Micro Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		10
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X1
X$
X$
________This_Is_The_END________
if test `wc -l < MD10Lnl` -ne 16; then
	echo 'shar: MD10Lnl was damaged during transit (should have been 16 bytes)'
fi
fi		; : end of overwriting check
echo 'x - MD10Lsl'
if test -f MD10Lsl; then echo 'shar: not overwriting MD10Lsl'; else
sed 's/^X//' << '________This_Is_The_END________' > MD10Lsl
X#sccs	"@(#)iv/lib:MD10Lsl	1.1"
X#	iv description file for 138 TPI Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		10
Xsteprate	0
Xsingledensity
X$
Xloader		/usr/lib/iv/s4load.silent
X$
X$
X0
X7
X$
X$
________This_Is_The_END________
if test `wc -l < MD10Lsl` -ne 17; then
	echo 'shar: MD10Lsl was damaged during transit (should have been 17 bytes)'
fi
fi		; : end of overwriting check
echo 'x - MD10Lvl'
if test -f MD10Lvl; then echo 'shar: not overwriting MD10Lvl'; else
sed 's/^X//' << '________This_Is_The_END________' > MD10Lvl
X#sccs	"@(#)iv/lib:MD10Lvl	1.1"
X#	iv description file for 138 TPI Micro Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		10
Xsteprate	0
Xsingledensity
X$
Xloader		/usr/lib/iv/s4load.verbose
X$
X$
X0
X7
X$
X$
________This_Is_The_END________
if test `wc -l < MD10Lvl` -ne 17; then
	echo 'shar: MD10Lvl was damaged during transit (should have been 17 bytes)'
fi
fi		; : end of overwriting check
echo 'x - MDLnl'
if test -f MDLnl; then echo 'shar: not overwriting MDLnl'; else
sed 's/^X//' << '________This_Is_The_END________' > MDLnl
X#sccs	"@(#)iv/lib:MDLnl	1.1"
X#	iv description file for 135 TPI Micro Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		9
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X1
X$
X$
________This_Is_The_END________
if test `wc -l < MDLnl` -ne 16; then
	echo 'shar: MDLnl was damaged during transit (should have been 16 bytes)'
fi
fi		; : end of overwriting check
echo 'x - MDLsl'
if test -f MDLsl; then echo 'shar: not overwriting MDLsl'; else
sed 's/^X//' << '________This_Is_The_END________' > MDLsl
X#sccs	"@(#)iv/lib:MDLsl	1.1"
X#	iv description file for 138 TPI Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		9
Xsteprate	0
Xsingledensity
X$
Xloader		/usr/lib/iv/s4load.silent
X$
X$
X0
X7
X$
X$
________This_Is_The_END________
if test `wc -l < MDLsl` -ne 17; then
	echo 'shar: MDLsl was damaged during transit (should have been 17 bytes)'
fi
fi		; : end of overwriting check
echo 'x - MDLvl'
if test -f MDLvl; then echo 'shar: not overwriting MDLvl'; else
sed 's/^X//' << '________This_Is_The_END________' > MDLvl
X#sccs	"@(#)iv/lib:MD9Lvl	1.1"
X#	iv description file for 138 TPI Micro Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		9
Xsteprate	0
Xsingledensity
X$
Xloader		/usr/lib/iv/s4load.verbose
X$
X$
X0
X7
X$
X$
________This_Is_The_END________
if test `wc -l < MDLvl` -ne 17; then
	echo 'shar: MDLvl was damaged during transit (should have been 17 bytes)'
fi
fi		; : end of overwriting check
echo 'x - fffc'
if test -f fffc; then echo 'shar: not overwriting fffc'; else
sed 's/^X//' << '________This_Is_The_END________' > fffc
X#=======================================================
X#       new floppy copy for both 360 and 400 KB disks
X#       S.Coffin  AT&T  5/13/87
X
XTFILE=/tmp/SS$$
Xtrap "/bin/rm -f $TFILE; exit 1" 0 1 2 3 15
X
X# copy the file in first
Xecho "Flexible Floppy Formatter and Copy...."
Xecho "Insert source disk and hit RETURN....\c"
Xread DUMMY
XSIZE=`dd if=/dev/rfp020 of=$TFILE ibs=5120 obs=5120 cbs=5120 2>&1 | sed 's/records [io][nu]t*//g'`
X
X# its an error if the input and output block count are not the same
Xset $SIZE
Xif [ $1 != $2 ] ; then
X        echo "Bad copy on input!  Goodbye...."
X        /bin/rm -f $TFILE
X        exit 1
Xfi
X
X# determine disk size from dd block count
XSIZE=`echo $1 | sed 's/+.*$//'`
Xcase $SIZE in
X160)    echo "800 KB disk required..." ;;
X144)    echo "720 KB disk required..." ;;
X80)     echo "400 KB disk required..." ;;
X72)     echo "360 KB disk required..." ;;
Xesac
X
X# let the user decide whether to format a disk for the copy
Xecho "Format the disk [yn] ? \c"
Xread ANSWER
Xecho "Change drive cables if necessary."
Xif [ $ANSWER = "y" ] ; then
X        echo "Insert unformatted output disk and hit return....\c"
X        read DUMMY
X        case $SIZE in
X        160)    echo "Formatting for 800 KB"
X                iv -i /dev/rfp020 /usr/lib/iv/MD10Lnl ;;
X        144)    echo "Formatting for 720 KB"
X                iv -i /dev/rfp020 /usr/lib/iv/MDLnl ;;
X        80)     echo "Formatting for 400 KB"
X                iv -i /dev/rfp020 /usr/lib/iv/FD10nl ;;
X        72)     echo "Formatting for 360 KB"
X                iv -i /dev/rfp020 /usr/lib/iv/FDnl ;;
X        esac
Xelse
X        echo "Insert formatted output disk and hit return....\c"
X        read DUMMY
Xfi
X
X
X# now write the data back out....
XSIZE=`dd of=/dev/rfp020 if=$TFILE ibs=5120 obs=5120 cbs=5120 2>&1 | sed 's/records [io][nu]t*//g'`
X
X# and a last test for correctness
Xset $SIZE
Xif [ $2 != $2 ] ; then
X        echo "Bad copy to output floppy!  Goodbye..."
X        /bin/rm -f $TFILE
X        exit 1
Xelse
X        echo "Done...."
Xfi
X
X/bin/rm -f $TFILE
Xexit 0
________This_Is_The_END________
if test `wc -l < fffc` -ne 68; then
	echo 'shar: fffc was damaged during transit (should have been 68 bytes)'
fi
fi		; : end of overwriting check
exit 0



More information about the Unix-pc.sources mailing list