Modified version of MSDOS/UNIX format floppy tools

Lenny Tropiano lenny at icus.ICUS.COM
Mon Sep 10 06:57:22 AEST 1990


Jim Adams <adams at ucunix.uc.san.edu> developed the idea that you can
copy the boot, FAT, and root directory images of a formatted MSDOS floppy
to the raw floppy device (/dev/rfp020) to actually create a formatted
MSDOS floppy on the UNIXpc.  He posted a few tools, which I added some
options to, made it easier for installation, and fixed a small deficiency
with the original idea.

Here's the updated shar file.  Read the README, and then run the Install
script.

-- cut here -- -- cut here -- -- cut here -- -- cut here -- -- cut here --
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README Install FD10 FD29dos MD10 MD29dos format
#   mkfs360K.uue mkfs720K.uue
# Wrapped by lenny at icus on Sun Sep  9 16:53:45 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(1945 characters\)
sed "s/^X//" >README <<'END_OF_README'
X
XThis is an example of a general-purpose way to format MSDOS floppies on
Xthe UNIX-PC.  The sample shell script will format a UNIX-PC 400K floppy
Xor else a 360K MSDOS floppy if the '-d' flag is given.
X
XThe MSDOS format uses iv to format the disk and then copies the boot
Xtrack, FAT and root directory image from a blank MSDOS diskette.  This
Xfile (mkfs.dos) was created with Norton Utilities by copying the above
Xportions of a blank 360K MSDOS floppy to a regular file.  It could be
Xduplicated by using an assembler program an a PC that calls the DOS
Xservices to copy these parts of the disk to a file.
X
XBy using this approach, you can specify 80 cylinders in the iv description
Xfile and thus format 3-1/2" 720K diskettes or 5-1/4 720K (80 Trk, ala
X3B2) floppies.
X_________________________________________
XJim Adams        adams at ucunix.san.uc.edu
X
X
X===
X
XThis format tool has been modified.  The original scheme didn't include
Xa mkfs720k.dos, and if you formatted your 3.5" disk in 720K mode, the 
XFAT and boot tables would still say it's a 360K floppy, wasting 360K
Xof it.  Basically included here are two DOS FAT, boot, and root directory
Ximages.  The format tool has been modified to support:
X
X	-u	format UNIX floppy 400K (default)
X	-u400k	format UNIX floppy 400K (default)
X	-u800k	format UNIX floppy 800K (good for 3.5" or 5.25" 720K drives)
X	-d	format MSDOS floppy 360K
X	-d360k	format MSDOS floppy 360K
X	-d720k	format MSDOS floppy 720K (good for 3.5" or 5.25" 720K drives)
X
XIncluded here is an "Install" script to install the program and iv
Xdescription files into their proper directories.  Edit "Install" and change
Xthe IVLIB or BINPATH if needed.  
X
X(default is: IVLIB=/usr/lib/iv, BINPATH=/usr/lbin)
X
X===
X| Lenny Tropiano           ICUS Software Systems        lenny at icus.ICUS.COM |
X| {ames,pacbell,decuac,sbcs,hombre,rayssd}!icus!lenny   attmail!icus!lenny  |
X+------ ICUS Software Systems --  PO Box 1;  Islip Terrace, NY  11752 ------+
END_OF_README
if test 1945 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Install -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Install\"
else
echo shar: Extracting \"Install\" \(1150 characters\)
sed "s/^X//" >Install <<'END_OF_Install'
X#
X# Installation of the FLOPPY FORMAT tools
X#
X# Installation script written by:
X# Lenny Tropiano, ICUS Software Systems <lenny at icus.ICUS.COM>
X#
X# Idea for formatting floppies this way was developed by:
X# Jim Adams <adams at ucunix.uc.san.edu>
X#
XBINPATH=/usr/lbin
XIVLIB=/usr/lib/iv
X#
Xif [ ! -f mkfs360K.dos ]
Xthen
X	uudecode mkfs360K.uue
Xfi
Xif [ ! -f mkfs720K.dos ]
Xthen
X	uudecode mkfs720K.uue
Xfi
Xif [ ! -f mkfs360K.dos -o ! -f mkfs720K.dos ]
Xthen
X	echo "Installation failed, could not uudecode dos images"
X	exit 1
Xfi
X#
Xecho "Copying iv description files ..."
Xcp FD10 FD29dos MD10 MD29dos mkfs360K.dos mkfs720K.dos $IVLIB/
X
Xchown bin $IVLIB/FD10 $IVLIB/FD29dos $IVLIB/MD10 $IVLIB/MD29dos \
X	$IVLIB/mkfs360K.dos $IVLIB/mkfs720K.dos
Xchgrp bin $IVLIB/FD10 $IVLIB/FD29dos $IVLIB/MD10 $IVLIB/MD29dos \
X	$IVLIB/mkfs360K.dos $IVLIB/mkfs720K.dos
Xchmod 644 $IVLIB/FD10 $IVLIB/FD29dos $IVLIB/MD10 $IVLIB/MD29dos \
X	$IVLIB/mkfs360K.dos $IVLIB/mkfs720K.dos
X#
Xecho "Copying format tool ..."
X#
Xecho "IVLIB=$IVLIB" > /tmp/format$$
Xcat format >> /tmp/format$$
Xmv /tmp/format$$ $BINPATH/format
Xchown bin $BINPATH/format
Xchgrp bin $BINPATH/format
Xchmod 755 $BINPATH/format
END_OF_Install
if test 1150 -ne `wc -c <Install`; then
    echo shar: \"Install\" unpacked with wrong size!
fi
chmod +x Install
# end of overwriting check
fi
if test -f FD10 -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"FD10\"
else
echo shar: Extracting \"FD10\" \(95 characters\)
sed "s/^X//" >FD10 <<'END_OF_FD10'
Xtype		FD
Xname		Floppy
Xcylinders	40
Xheads		2
Xsectors		10
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X1
X$
X$
END_OF_FD10
if test 95 -ne `wc -c <FD10`; then
    echo shar: \"FD10\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f FD29dos -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"FD29dos\"
else
echo shar: Extracting \"FD29dos\" \(241 characters\)
sed "s/^X//" >FD29dos <<'END_OF_FD29dos'
X#sccs   "@(#)iv/lib:FD29dos	1.0
X#	iv description file for 48 TPI MSDOS Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	40
Xheads		2
X# iv requires even number of sectors / track
Xsectors         10
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X$
X$
END_OF_FD29dos
if test 241 -ne `wc -c <FD29dos`; then
    echo shar: \"FD29dos\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f MD10 -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MD10\"
else
echo shar: Extracting \"MD10\" \(95 characters\)
sed "s/^X//" >MD10 <<'END_OF_MD10'
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
Xsectors		10
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X1
X$
X$
END_OF_MD10
if test 95 -ne `wc -c <MD10`; then
    echo shar: \"MD10\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f MD29dos -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"MD29dos\"
else
echo shar: Extracting \"MD29dos\" \(241 characters\)
sed "s/^X//" >MD29dos <<'END_OF_MD29dos'
X#sccs   "@(#)iv/lib:FD29dos	1.0
X#	iv description file for 48 TPI MSDOS Floppy file system disk.
Xtype		FD
Xname		Floppy
Xcylinders	80
Xheads		2
X# iv requires even number of sectors / track
Xsectors         10
Xsteprate	0
Xsingledensity
X$
X$
X$
X0
X$
X$
END_OF_MD29dos
if test 241 -ne `wc -c <MD29dos`; then
    echo shar: \"MD29dos\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f format -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"format\"
else
echo shar: Extracting \"format\" \(1060 characters\)
sed "s/^X//" >format <<'END_OF_format'
X#
X# Format floppies in either 400K and 800K UNIX format, or in 360K and 720K
X# MSDOS format
X#
X# Original script by Jim Adams <adams at ucunix.san.uc.edu>
X# Modified by Lenny Tropiano   <lenny at icus.ICUS.COM>
X#
Xif [ "$IVLIB" = "" ]
Xthen
X	echo "format tool not installed correctly."
X	exit 1
Xfi
Xecho "Formatting floppy ..."
XUSAGE="usage: $0 [-d | -d360k | -d720k]"
Xcase "$1" in 
X	'' | '-u' | '-u400k')
X		/etc/iv -iv /dev/rfp020 $IVLIB/FD10
X		echo 'Making 400K UNIX Filesystem /dev/rfp021'
X		/etc/mkfs /dev/fp021
X		/etc/dismount -f > /dev/null 2>&1
X		echo 'done';;
X	'-u800k')
X		/etc/iv -iv /dev/rfp020 $IVLIB/MD10
X		echo 'Making 800K UNIX Filesystem /dev/rfp021'
X		/etc/mkfs /dev/fp021
X		/etc/dismount -f > /dev/null 2>&1
X		echo 'done';;
X	'-d' | '-d360k')
X		/etc/iv -iv /dev/rfp020 $IVLIB/FD29dos
X		echo 'Making 360K MSDOS Filesystem'
X		cat $IVLIB/mkfs360K.dos >/dev/rfp020
X		echo 'done';;
X	'-d720k')
X		/etc/iv -iv /dev/rfp020 $IVLIB/MD29dos
X		echo 'Making 720K MSDOS Filesystem'
X		cat $IVLIB/mkfs720K.dos >/dev/rfp020
X		echo 'done';;
X	'-?'|'-h')
X		echo $USAGE;;
Xesac
END_OF_format
if test 1060 -ne `wc -c <format`; then
    echo shar: \"format\" unpacked with wrong size!
fi
chmod +x format
# end of overwriting check
fi
if test -f mkfs360K.uue -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mkfs360K.uue\"
else
echo shar: Extracting \"mkfs360K.uue\" \(8495 characters\)
sed "s/^X//" >mkfs360K.uue <<'END_OF_mkfs360K.uue'
Xbegin 666 mkfs360K.dos
XMZS2024)-(" S+C,  @(!  )P - "_0( "0 "                        
XM   2      $ ^C/ CM"\ 'P6![MX #;%-QY6%E._*WRY"P#\K": /0!T R:*
XM!:J*Q.+Q!A^)1P+'!RM\^\T3<F>@$'R8]R86? ,&''P#!@Y\HS]\HS=\N"  
XM]R81?(L>"WP#PTCW\P$&-WR[  6A/WSHGP"X 0+HLP!R&8O[N0L OM9]\Z9U
XM#8U_(+[A?;D+ /.F=!B^=WWH:@ RY,T67A^/!(]$ LT9OL!]Z^NA' 4STO<V
XM"WS^P*(\?*$W?*,]?+L !Z$W?.A) *$8?"H&.WQ . 8\?',#H#Q\4.A. %AR
XMQB@&/'QT# $&-WSW)@M\ ]CKT(HN%7R*%OU]BQX]?.H  '  K K ="*T#KL'
XM ,T0Z_(STO<V&'S^PH at 6.WPSTO<V&GR(%BI\HSE\P[0"BQ8Y?+$&TN8*-CM\
XMB\J&Z8H6_7V*-BI\S1/##0I.;VXM4WES=&5M(&1I<VL@;W(@9&ES:R!E<G)O
XM<@T*4F5P;&%C92!A;F0@<W1R:6ME(&%N>2!K97D@=VAE;B!R96%D>0T*  T*
XM1&ES:R!";V]T(&9A:6QU<F4-"@!)0DU"24\@($-/34E"341/4R @0T]-    
XM                    5:K]__\                                 
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM        _?__                                                
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                     #,V,$L@
XM1DQ/4%!9*              F>"D5                                
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
X8                                
X 
Xend
END_OF_mkfs360K.uue
if test 8495 -ne `wc -c <mkfs360K.uue`; then
    echo shar: \"mkfs360K.uue\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f mkfs720K.uue -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"mkfs720K.uue\"
else
echo shar: Extracting \"mkfs720K.uue\" \(9909 characters\)
sed "s/^X//" >mkfs720K.uue <<'END_OF_mkfs720K.uue'
Xbegin 666 mkfs720K.dos
XMZS2024)-(" S+C,  @(!  )P * %^0, "0 "                        
XM   2      $ ^C/ CM"\ 'P6![MX #;%-QY6%E._*WRY"P#\K": /0!T R:*
XM!:J*Q.+Q!A^)1P+'!RM\^\T3<F>@$'R8]R86? ,&''P#!@Y\HS]\HS=\N"  
XM]R81?(L>"WP#PTCW\P$&-WR[  6A/WSHGP"X 0+HLP!R&8O[N0L OM9]\Z9U
XM#8U_(+[A?;D+ /.F=!B^=WWH:@ RY,T67A^/!(]$ LT9OL!]Z^NA' 4STO<V
XM"WS^P*(\?*$W?*,]?+L !Z$W?.A) *$8?"H&.WQ . 8\?',#H#Q\4.A. %AR
XMQB@&/'QT# $&-WSW)@M\ ]CKT(HN%7R*%OU]BQX]?.H  '  K K ="*T#KL'
XM ,T0Z_(STO<V&'S^PH at 6.WPSTO<V&GR(%BI\HSE\P[0"BQ8Y?+$&TN8*-CM\
XMB\J&Z8H6_7V*-BI\S1/##0I.;VXM4WES=&5M(&1I<VL@;W(@9&ES:R!E<G)O
XM<@T*4F5P;&%C92!A;F0@<W1R:6ME(&%N>2!K97D@=VAE;B!R96%D>0T*  T*
XM1&ES:R!";V]T(&9A:6QU<F4-"@!)0DU"24\@($-/34E"341/4R @0T]-    
XM                    5:KY__\                                 
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                              #Y__\                         
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                       W,C!+($9,3U!062@     
XM        57<I%0                                              
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
XM                                                            
X-                    
X 
Xend
END_OF_mkfs720K.uue
if test 9909 -ne `wc -c <mkfs720K.uue`; then
    echo shar: \"mkfs720K.uue\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
-- 
| Lenny Tropiano           ICUS Software Systems        lenny at icus.ICUS.COM |
| {ames,pacbell,decuac,sbcs,hombre,rayssd}!icus!lenny   attmail!icus!lenny  |
+------ ICUS Software Systems --  PO Box 1;  Islip Terrace, NY  11752 ------+



More information about the Comp.sys.att mailing list