From meh Fri Aug 15 10:31:05 1986
To: mcatee rob
Subject: multi-chip ROM burner
Status: R

Rob and Steve,

I have written a new shell script which works just like "mkpdc" 
except if the file is greater than 64Kbyte, it will split the file
into more than one ROM.  The program will only burn new ROMs if
necessary and will prompt you to replace the ROMs when necessary.
The file is called "mkpdc.x" after you have checked it out, you may
want to replace "mkpdc" with "mkpdc.x".

Here comes the source, enjoy!

Mark

----
srmcp -b /dev/srm:/USERS/TO/$1.bin $1.a
cat $1.a | byteswitch | byteswitch xx > $1.b

# Initialized the zero compare value
read w < /usr/contrib/bin/zero.file

# dd takes along time, tell the user
echo "Splitting the bits... May take awhile"

# Split the file into three files of 64k bytes or less
dd if=$1.b of=$1.1 ibs=1 obs=1 count=64k 2> /dev/null
# get the byte counts of the file
cat $1.1 | wc -c > $1.5
# read the byte counts into a variable
read x < $1.5

# Split out the second file skipping the first 64K bytes
dd if=$1.b of=$1.2 ibs=1 obs=1 skip=64k count=64k 2> /dev/null
# get the byte counts of the file
cat $1.2 | wc -c > $1.6
# read the byte counts
read y < $1.6

# create the third file now so if it is not created one will exist.
touch $1.3
# skip the last split if not needed.  This will save time.
if test $y != $w
then
 	# Split out the third file
	dd if=$1.b of=$1.3 ibs=1 obs=1 skip=128k count=64k 2> /dev/null
fi
# get the byte counts of the file
cat $1.3 | wc -c > $1.7
# read the byte counts
read z < $1.7


# Burn the first ROM
if test $x != $w
then
	echo "burned first ROM"
 	mkprom $1.1 AM27512
fi

# Burn the second ROM
if test $y != $w
then
 	echo "Replace the first PROM with the second PROM, Type <cntl D>"
 	cat > /dev/null
 	mkprom $1.2 AM27512
fi

# Burn the third ROM
if test $z != $w 
then
	echo "Replace the second PROM with the third PROM, Type <cntl D>"
	cat > /dev/null
 	mkprom $1.3 AM27512
fi

# Remove all files
rm $1.[1-9]
rm $1.a
rm $1.b


