DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦bd04dd634⟧ TextFile

    Length: 8083 (0x1f93)
    Types: TextFile
    Notes: UNIX file
    Names: »cmc«

Derivation

└─⟦8c4f54e61⟧ Bits:30004068/disk2.imd Interactive TCP/IP v.1.2
└─⟦8c4f54e61⟧ UNIX Filesystem
    └─⟦this⟧ »hb/new/usr/admin/menu/packagemgmt/tcpipmgmt/hbtcpmgmt/cmc« 

TextFile

#help#  
#help#  Selecting this menu item will configure the
#help#  CMC-630 Ethernet Adapter into the system
#menu#  CMC-630 Ethernet Adapter

#ident	"@(#)cmc	1.2	90/01/31"

#  The following is an installation script for use with System V, Release 3
#  using either linkable or installable device drivers.
#  
#  This script does the following:
#    -- Finds the current major numbers and driver configuration parameters.
#    -- Asks the user if the major numbers need changing.
#    -- If yes, it prompts for new major numbers and modifies the driver
#       config files as appropriate.
#    -- Asks the user if the driver configuration parameters needs changing.
#    -- If the system requires any driver config parameters to be changed, it
#       modifies the space.c and config file.
#    -- Checks for conflicts on the interrupt vector set in the previous
#       steps; if one is found then a bunch of instructions on how to
#       proceed are written to the screen.
#    -- Adds the driver(s) to the kernel configuration files.
#    -- If necessary, changes netd.cf for the driver.
#    -- Removes any existing special files and create the special files
#       (devices) required by HBTCP.
#    -- Calls kconfig to build a kernel if the user wants to.

changed=no
CONFDIR=/etc/conf
CNFMODS=${CONFDIR}/pack.d
SDEVICEDIR=${CONFDIR}/sdevice.d
SDEVICE=${CONFDIR}/cf.d/sdevice
FULLNAME="Communication Machinery Corporation"
NAME=WD
DNAME=wd
TEMPF=/tmp/$DNAME.$$
TEMPSDEV=/tmp/sdev.$DNAME.$$
LOCNAME=`uname -n`

#   Set trap after variables defined
trap "rm -f ${T1:-/tmp/wd.*} $T2 ${TEMPF}; exit 3" 2 3 15
flags="-qq -k$$"

#  Stop right now if for some reason the file is not there.
if [ ! -f ${SDEVICEDIR}/$DNAME ]
then
	echo "Cannot find configuration file ${SDEVICEDIR}/$DNAME, aborting."
	exit 1
fi
cp ${SDEVICEDIR}/$DNAME ${TEMPSDEV}

#	Get configurable values
set `awk '/'$DNAME'/ { print $6, $7, $8, $9, $10 }' ${TEMPSDEV}`
irqvec=$1; iobase=$2; endiobase=$3; shbase=$4; endshbase=$5

cat << EOF


                          INTERACTVIE UNIX
                Host Based TCP/IP Software Installation
                   UNIX System V Release 3 Version

EOF

cat <<EOF 
        $FULLNAME Hardware Configuration

The CMC driver is currently configured with the following hardware settings.
NOTE: All hardware settings are in Hex value:

	Interrupt Request Line (IRQ)............. ${irqvec}
	Start I/O Address on I/O bus............. 0x${iobase}
	End I/O Address on I/O bus............... 0x${endiobase}
	Start Controller Shared Memory Address... 0x${shbase}
	End Controller Shared Memory Address..... 0x${endshbase}

EOF

#
#  Offer the user a chance to change the interrupt vector line
#
echo "Do you want to use the current IRQ value [ Yes ]? \c"
read ans
case "${ans:-Yes}" in
     [nN]*)
	  oirq=$irqvec; changed=yes;
	  while true
	       do echo "Please enter the IRQ value for the board [ $oirq ]: \c"
	       read irqvecx; irqvec=${irqvecx:-$oirq}
	       case "$irqvec" in
		    [3-7]) break ;;
		    *)
			 echo "\nOnly 3 through 7 are valid \c"
			 echo "interrupt levels for the $NAME board." ;;
	       esac
	  done
	  awk '/'$DNAME'/ { OFS="\t"; $6="'$irqvec'" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
	  irqlev=$irqvec 
	  mv ${TEMPF} ${TEMPSDEV}
	  echo " "
esac

echo "Do you want to use the current I/O Port address range [ Yes ]? \c"
read ans
case "${ans:-Yes}" in
     [nN]*)
	  oio=$iobase; changed=yes;
	  while true
	       do echo "Please enter the Start I/O address for the board [ $oio ]: \c"
	       read iobasex; iobase=${iobasex:-$oio}
	       case "$iobase" in
		    [0-9a-fA-F]*) break ;;
		    *) echo The I/O Base address must be specified in hexadecimal ;;
	       esac
	  done
	  awk '/'$DNAME'/ { OFS="\t"; $7="'$iobase'" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
	  mv ${TEMPF} ${TEMPSDEV}
	  oendio=$endiobase; changed=yes;
	  while true
	       do echo "Please enter the End I/O address for the board [ $oendio ]: \c"
	       read endiobasex; endiobase=${endiobasex:-$oendio}
	       case "$endiobase" in
		    [0-9a-fA-F]*) break ;;
		    *) echo The End I/O address must be specified in hexadecimal ;;
	       esac
	  done
	  awk '/'$DNAME'/ { OFS="\t"; $8="'$endiobase'" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
	  mv ${TEMPF} ${TEMPSDEV}
	  echo " "
esac

echo "Do you want to use the current Controller Shared Memory address range[ Yes ]? \c"
read ans
case "${ans:-Yes}" in
     [nN]*)
	  oio=$shbase; changed=yes;
	  while true
	       do echo "Please enter the Start Shared Memory address for the board [ $oio ]: \c"
	       read shbasex; shbase=${shbasex:-$oio}
	       case "$shbase" in
		    [0-9a-fA-F]*) break ;;
		    *) echo The Shared Memory Base address must be specified in hexadecimal ;;
	       esac
	  done
	  awk '/'$DNAME'/ { OFS="\t"; $9="'$shbase'" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
	  mv ${TEMPF} ${TEMPSDEV}
	  oio=$endshbase; changed=yes;
	  while true
	       do echo "Please enter the End Shared Memory address for the board [ $oio ]: \c"
	       read shbasex; endshbase=${shbasex:-$oio}
	       case "$endshbase" in
		    [0-9a-fA-F]*) break ;;
		    *) echo The End Shared Memory address must be specified in hexadecimal ;;
	       esac
	  done
	  awk '/'$DNAME'/ { OFS="\t"; $10="'$endshbase'" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
	  mv ${TEMPF} ${TEMPSDEV}
	  echo " "
esac

#
# check for conflicts in the interrupt vector
#
echo
echo "Checking for interrupt vector conflicts - Please wait..."
match=No > ${TEMPF}

cat ${SDEVICEDIR}/* | awk '{  if ( $1 != "'$DNAME'" && $2 != "N" && $6 == "'$irqvec'" ) {
		printf "matchdev=%s\n",$1
		print "match=y"
	}
} ' >> ${TEMPF}

chmod +x ${TEMPF}
. ${TEMPF}
rm -f ${TEMPF}

    case "${match:-No}" in
	[yY]*)
		cat <<EOF

There is a conflict with the device "$matchdev" on interrupt level
$irqvec.  Please resolve this conflict by changing the Interrupt
Request line of either the conflicting device or the $NAME board.

Change the IRQ value of "$DNAME" in ${SDEVICEDIR}/$DNAME file or make
modifications to the configuration file of each conflicting device
resident in ${SDEVICEDIR} directory named after the corresponding
device.  If you are changing the interrupt vector and request
line of the $NAME board then you will need to do the following:

     1    Abort this installation.
     2    Change the IRQ jumper on the $NAME board to the desired IRQ
	  level to reflect the desired IRQ level.
     3    Restart this installation script by executing sysadm, giving
	  the correct value for the interrupt level when asked by the
	  script.

This conflict must be resolved before the new kernel can be linked.
Please refer to the INTERACTIVE UNIX TCP/IP software and $NAME hardware
installation manual for more detailed instructions on changing the
interrupt vector, I/O address and etc..

Now interrupt this script (usually the DEL key) to abort the
installation...
EOF
	read junk ;;
    esac

# 	Set the driver to be configured
awk '/'$DNAME'/ { OFS="\t"; $2="Y" ; print $0 }' ${TEMPSDEV} > ${TEMPF}
mv ${TEMPF} ${TEMPSDEV}

#  
#   Set up the real sdevice file
#
mv ${TEMPSDEV} ${SDEVICEDIR}/$DNAME 
echo "\nNew ${SDEVICEDIR}/$DNAME file is:"
cat ${SDEVICEDIR}/$DNAME
echo ""

#
#  Add driver to kernel description file and kernel configuration file
#
if fgrep "$NAME Ethernet Driver" /etc/conf/kconfig.d/description >/dev/null 2>&1
then :
	echo $NAME Ethernet Driver already in description file.
	echo $NAME driver must be already installed.
else
	cat >> /etc/conf/kconfig.d/description <<!
wd      -    -     hbtcp    -             CMC 630 Ethernet Adapter
!
fi



#
#  change /etc/netd.cf to use DNAME
#  set the hostname in /etc/netd.cf
#
cp /usr/admin/menu/packagemgmt/tcpipmgmt/hbtcpmgmt/_netd.cf /etc/netd.cf
chmod  755 /etc/netd.cf
ed - /etc/netd.cf > /dev/null <<-EOF
	g/DEV/s//$DNAME/g
	g/local_site_name/s//$LOCNAME/
	w
	q
	EOF

if checkyn ${flags} -f "Do you wish to build a new kernel at this time?"
then
	sh runlevel
	echo ""
	echo "Building a kernel with $NAME driver configured..."
	/etc/kconfig -r /
fi
/bin/rm -f ${TEMPF} ${TEMPSDEV} $T1
exit 0