MIDAS software installation

Installation of MIDAS application packages for Motorola LynxOS

Last updated on March 18 2005

The following instructions assume that you are familiar with Unix and are just an indication of the tasks required for the MIDAS installation. It is NOT expected that someone who has never used Unix before would be able to perform the software installation without additional assistance.

In particular you WILL require superuser (root) access to your Unix server in order to perform a complete initial installation of the software.

These instructions have been tested for Sun Solaris 2.5 => Solaris 9 and for RedHat Linux 7.3 => RedHat Linux 9.

The Motorola MVME24xx CPU card boots the LynxOS kernel (using the embedded Motorola program PPCBug) from a server using TFTP and then NFS mounts the LynxOS root filesystem from the same or a different server. The LynxOS kernel then takes over and mounts any other file systems required and runs a sequence of scripts which load the MIDAS Data Acquisition components such as the register servers and the read-out program.

The current release of Motorola LynxOS is 3.1.0. So, for example, the core distribution is in the directory /MIDAS/LynxOS_MCG_Release/3.1.0. For other releases replace 3.1.0 by the release ID, for example, 3.0.1.

The instructions and examples which follow use the file pathnames which are used at Daresbury. While it is possible to install the software at other locations (no code has inbuilt absolute pathnames which cannot be overridden) you will have to understand the installation in greater detail so that your installation is consistent.

  Install the core LynxOS distribution in the directory /MIDAS/LynxOS_MCG_Release/3.1.0
You must install the tar file as user=root in order that the correct file ownership and permissions for the LynxOS file system are preserved.
This is essentially the Motorola LynxOS release as received from Lynx for the PowerPC platform.

  Install the core MIDAS distribution for LynxOS in the directory /MIDAS/LynxOS_MCG/3.1.0
This contains MIDAS device drivers for LynxOS and MIDAS servers and common programs.

  Install any application packges required

First you need to identify the Unix server which will act as the TFTP boot server and the file system (NFS) server for LynxOS.
Login to the system and become Super User.

  Enable the TFTP service (Sun Solaris)

  Edit the file /etc/inetd.conf and uncomment (remove any #) before tftp

  Create the directory /tftpboot

  cd /tftpboot    and    ln -s . tftpboot

  finally kill -HUP <PID of inetd>

The TFTPboot server which is supplied by Sun with Solaris 9 has been "enhanced". This means that in some cases the TFTPboot server fails to understand requests using the "unenhanced" command format. Sun are aware of the problem. Until a fix is provided you will have to use an alternative tftpboot server. [The version from Solaris 8 appears to be usable.]

  Enable the TFTP service (RedHat)
You may first require to install the TFTP service for your Linux release. This is not installed by default in current Linux releases. If in doubt check that you have the file /usr/sbin/in.tftpd.

  Edit the file /etc/xinetd.d/tftp and ensure that disable=no

  Create the directory /tftpboot

  cd /tftpboot    and    ln -s . tftpboot

  finally restart the xinetd service using /etc/rc.d/init.d/xinetd restart

These instructions assume that the name of your LynxOS system is ppc1. Replace this with your name.

  The Unix server needs to know the name and ethernet address of the LynxOS system. The ethernet address is printed on a label on the processor board - it will look like 08003e2ffb82

  Edit the file /etc/ethers and add (for each VME processor) a line like
8:0:3e:2f:fb:82 ppc1

  The Unix server needs to know the name and IP address of the LynxOS system. If the LynxOS system is being connected to a "private" network (i.e. your Unix server has 2 ethernet interfaces) then the LynxOS system can have an IP address like 10.0.0.1. If the LynxOS system is being connected to your site network then you will have to obtain an IP address from your network administration.

  Edit the file /etc/hosts and add (for each VME processor) a line like
10.0.0.1 ppc1

  Three files are required in the server /tftpboot for each LynxOS system. The file names have the format

<TARGET hexadecimal IP address>.xxxx
where the target IP address 10.0.0.1 gives 0A000001.xxxx and the IP address 193.62.115.205 would give C13E73CD.xxxx

  C13E73CD.fstab     Contains a line specifying the server and path of the root filesystem

  C13E73CD.hosts     Contains the /etc/hosts file to be used by LynxOS

  lynxos.netboot     Common to all targets - this is the LynxOS kernel

Note - The xxx.hosts file to be used by LynxOS must AT LEAST contain an entry for the LynxOS system itself and an entry for the UNIX server.

It is assumed that the LynxOS root file system has been installed on the Unix server in the directory /MIDAS/LynxOS_MCG_Release/3.1.0.

sample fstab file for tftpboot

# The root filesystem will be mounted at boot time to provide all
# standard LynxOS directories for the SCMP client.
#
myserver:/MIDAS/LynxOS_MCG_Release/3.1.0/ppc:/rootfs:rw     

sample hosts file for tftpboot

# Internet host table
#
127.0.0.1   localhost   
#
10.0.0.16   myserver loghost egmsg
##
10.0.0.1      ppc1  

The lynxos.netboot file will be found in the directory /MIDAS/LynxOS_MCG/3.1.0. This has been configured specifically to provide the system services required by MIDAS and so you must use kernels from here rather than from the original Lynx distribution. The source of all other example files will be found in the directory /MIDAS/LynxOS_MCG/3.1.0/startup.SAMPLES.

Sun Solaris
If TFTP had not previously been running in the Unix server it may be necessary to start rarpd.
The following command will do this /usr/sbin/in.rarpd -a

RedHat Linux
You may first require to install the RARP service for your Linux release. This is not installed by default in current Linux releases. If in doubt check that you have the file /usr/sbin/rarpd.
Then start the service using the command /usr/sbin/rarpd -ae or the command /etc/rc.d/init.d/rarpd start
Look up the significance of the -e option!
rarpd will normally only be started if the file /etc/ethers is present.
To make rarpd start automatically on boot you may need to add ln -s ../init.d/rarpd S16rarpd in the directories /etc/rc.d/rc5.d and /etc/rc.d/rc3.d

Sun Solaris
If NFS had not previously been running in the Unix server it will be necessary to start it.
The following command will do this /etc/init.d/nfs.server start

RedHat Linux
If NFS had not previously been running in the Unix server it will be necessary to start it.
The following command will do this service nfs start

  The Unix server must also SHARE the file systems accessed via NFS with LynxOS (Sun Solaris)

  edit the file /etc/dfs/dfstab

  for each LynxOS processor add share -F nfs -o rw=ppc1,root=ppc1 /MIDAS

  execute the command shareall

  The Unix server must also SHARE the file systems accessed via NFS with LynxOS (RedHat Linux)

  edit the file /etc/exports

  for each LynxOS processor add /MIDAS ppc1(rw,no_root_squash)

  execute the command exportfs -r -v

  Set-up the MVME24xx to run network boot by getting to the processor PPCBug prompt.

To do this you will need to connect a simple line-mode terminal to the DEBUG port of the MVME24xx. A standard RJ45 connector located on the front plate of the MVME24xx provides the interface to the asynchronous serial debug port.
The pin assignments for this connector are as follows:

1 DCD
2 RTS
3 GND
4 TXD
5 RXD
6 GND
7 CTS
8 DTR

Pin 1 is on the left when you view the RJ45 from the back (clip) side.

Assuming that the terminal has a standard 25 pin RS232 connector all that is required is to connect pin 4 (TXD) on the RJ45 to pin 2 on the DB25; pin 5 (RXD) on the RJ45 to pin 3 on the DB25 and pin 3 or 6 (GND) to pin 7 on the DB25.
NOTE: The DEBUG port and the ETHERNET port on the MVME24xx both use RJ45 connectors (dumb!!). Try not to connect the wrong way around!
NOTE: You only need the DEBUG port for setup and fault finding. At other times it may be best to disconnect the DEBUG RJ45 connector from the MVME24xx.

At the PPCBug prompt enter the command niot and edit the responses as in the sample following.

controller LUN 00
device LUN 00
Node Control Memory Address 01F9E000      (see note)
Client IP address 10.0.0.1
Server IP address 10.0.0.16
Subnet IP Address mask
Broadcase IP Address
Gateway IP Address
Boot file Name lynxos.netboot
Argument file Name
Boot file load address 4000
Boot file execution address 4020
.

The Node Control Memory Address should be 01F9E000 for MVME2431 modules with 32 Mbyte RAM and 0FF9E000 for MVME2434 modules with 256 Mbyte RAM.

  Start the MVME24xx Real Time Clock
If the processor is "new out of the box" you will have to start the real time clock. This is done by setting the date and time by using the set command. The format is set mmddyyhhmm.

  Enable network booting
Finally enable auto network booting on power-up and system reset. Use the env command and press the return key to step through the options (there are a lot!) until you come to

Network Auto Boot Enable (Y/N)
and enter Y and then . to finish.

You will be pleased to hear that LynxOS should now boot!!

After the initial kernel boot LynxOS mounts the root file system and executes the script (as seen by LynxOS) /rootfs/startup/generic which is the file (as seen by the Unix server) /MIDAS/LynxOS_MCG_Release/3.1.0/ppc/startup/generic. This mounts /MIDAS and executes the file /MIDAS/LynxOS_MCG/3.1.0/startup/generic (as seen by LynxOS).

If you have installed the software at a different location then pathnames in the script examples which follow may need to be changed. Note however that the scripts are executed by the LynxOS system and so the pathnames are as seen by LynxOS and NOT by the UNIX server. If you mount for LynxOS the MIDAS software as /MIDAS (see the fstab example file which follows) then no changes will be needed regards of the location on the UNIX server.

If /MIDAS is a symbolic link on your UNIX server then remember that you must export the file system to which the symbolic link points. This is normal NFS practice.

generic LynxOS start up script

#!/bin/sh
#
# startup script for a generic station  (file /rootfs/startup/generic == /MIDAS/LynxOS_MCG_Release/3.1.0/ppc/startup/generic)
#

#
mkdir /MIDAS
[ -f /rootfs/startup/fstab ] && cat /rootfs/startup/fstab > /etc/fstab
mount -a -t nfs
[ -x /MIDAS/LynxOS_MCG/3.1.0/startup/generic ] && /MIDAS/LynxOS_MCG/3.1.0/startup/generic

generic LynxOS fstab file

# The root filesystem will be mounted a boot time to provide all standard LynxOS directories for the client.
# The mount is specified in /tftpboot/lynxos.fstab
#
#   fstab for a generic station  (file /rootfs/startup/fstab == /MIDAS/LynxOS_MCG_Release/3.1.0/ppc/startup/fstab)
#
# mount /MIDAS to give access to our startup scripts
#
#    the following line assumes the MIDAS software is installed on the UNIX server as /MIDAS - it is seen by LynxOS as /MIDAS
myserver:/MIDAS:/MIDAS:rw
#    the following line assumes the MIDAS software is installed on the UNIX server as /usr/local/MIDAS - it is seen by LynxOS as /MIDAS
#myserver:/usr/local/MIDAS:/MIDAS:rw
#
# end of this fstab
#

From now on the startup scripts are supplied by the MIDAS Base LynxOS package. If you look in the directory /MIDAS/LynxOS_MCG/3.1.0 you will find a directory startup.SAMPLES which contains the startup scripts for a number of LynxOS systems. You can use these as a starting point for your specific startup directory. Copy (or rename) startup.SAMPLES as startup. Also copy startup.SAMPLES/config to /MIDAS/config.

generic MIDAS start up script (file /MIDAS/LynxOS_MCG/3.1.0/startup/generic)


#!/bin/sh
#
# startup script for a generic station
#

#
# Setup our name (as rc.network tried to do)
# and change hostname appropriately to coincide with /etc/hosts
#
my_name=`uname -n`
export release=`uname -r`
hostname "$my_name"
echo "Startup script version 3.1.0 for LynxOS release $release running on host `hostname`"
#
#    install any required device drivers
#
cd /MIDAS/LynxOS_MCG/$release/startup/setup
#
my_name=`hostname`
#
UM=`umask`
umask 0
[ -f ./insttab ] && dynaminst -v ./insttab
umask $UM
#
#
# Finally, mark this file as having been run, so the specific startup file,
# if it exists, knows. (It will be run from rc - like this file)
#
#
touch /.generic_has_been_run
#
[ -x /MIDAS/LynxOS_MCG/$release/startup/$my_name ] && /MIDAS/LynxOS_MCG/$release/startup/$my_name
#
#end of startup script
#

The shell variable $release is created which contains the LynxOS release (3.1.0) and can be used to make further scripts release independant.

The LynxOS device drivers are installed from the file /MIDAS/LynxOS_MCG/$release/startup/setup/insttab which can be found in startup.SAMPLES

standard installation file for LynxOS device drivers (file /MIDAS/LynxOS_MCG/3.1.0/startup/insttab)

# file: insttab
# 960311 MAWE
#
# installation file for logger driver
#
	C:/MIDAS/LynxOS_MCG/3.1.0/devices/loggerdrvr
                D:/MIDAS/LynxOS_MCG/3.1.0/devices/loggerinfo:: 
                        N:/dev/logger:0 
#
#end of installation file
#

standard installation file for LynxOS device drivers (file /MIDAS/LynxOS_MCG/3.1.0/startup/insttab-vmeint)

# file: insttab-vmeint
# 960311 MAWE
#
# installation file for VME interrupt driver
#
	C:/MIDAS/LynxOS_MCG/3.1.0/devices/vmeintdrvr
                D:/MIDAS/LynxOS_MCG/3.1.0/devices/vmeintinfo:: 
                        N:/dev/vmeint:0
#
#end of installation file
#

Finally an target specific script may be envoked which will load and start the required application. Obtain the startup script specific to your application. Again some examples will be found in startup.SAMPLES.

For example the following is used by the application which is used for data acquisition from the Silena 9418 ADC and CAEN VME ADCS/TDCS


#!/bin/bash
#
# startup script for station ???
#
echo starting `uname -n` ...
#
TMPPATH=$PATH
#
[ ! -f /.generic_has_been_run ] && /MIDAS/LynxOS_MCG/$release/startup/generic
#
# add target specific startup here
#
export PATH=/MIDAS/LynxOS_MCG/$release/bin:${PATH}
#
UM=`umask`
umask 0
#
#    install VME int driver
dynaminst -v /MIDAS/LynxOS_MCG/$release/startup/setup/insttab-vmeint
#
# start the message logger dispatcher
loggerd
#
#
vmeers 0 vme
source /MIDAS/config/VME/NetVarDefn.LynxOS
source /MIDAS/config/VME/NetVarRegDefn
#
# start spectrum server:
#
memsas
#
#    load main data acquisition program
#    define netints 
#
#      If writing to tape remove the comment character (#) at the start of the 
#      next command and insert the name or IP address of the tape server system
#
#netstring TS_Server "tape_server_name"
#
#    The buffer size here must match the buffer size declared in the MIDAS Tape Server configuration
#
netint Output_BufferSize 32
netint Xfer_Option 3
netint Format_Option 3
#
netint Xfer_Overlap 1
netint Xfer_Priority 1
#
cd /MIDAS/Data_Acq/bin/LynxOS_MCG/$release
./ExecV1
nice ./MIDASExecV1
#
umask $UM
#
echo ... `uname -n` startup complete
#

Several configuration files are used by the standard startup scripts. In most cases these are supplied in the various distributions and the versions there should be considered as the definitive source. In particular you should take files in the directory /MIDAS/Data_Acq/bin from the distribution.

/MIDAS/LynxOS_MCG/3.1.0/startup/camac_hytec.init which initialises a single CAMAC crate [crate (n) = 1] using the Serial Highway controller. This may have to be tailored for your installation.

ersdefine    Controller.CSR        xCAMAC
erswta        Controller.CSR -c1 -n30 -a0 -f1 -w16 -prw -l0 -b0 -zx -q1
erswrite    Controller.CSR 0x0000
erspause 12
ersread        Controller.CSR 
erswrite    Controller.CSR 0x0001
erspause 12
erswrite    Controller.CSR 0x0100
ersundef    Controller.CSR
ersdefine    SCC#1.set        xCAMAC
erswta        SCC#1.set -c1 -n30 -a0 -f19 -pwo -l0 -b0
ersdefine    SCC#1.clear        xCAMAC
erswta        SCC#1.clear -c1 -n30 -a0 -f23 -pwo -l0 -b0
ersdefine    SCC#1.status        xCAMAC
erswta        SCC#1.status -c1 -n30 -a0 -f1 -prw -l0 -b0 -zx -q1
CAMAC register server configuration files

/MIDAS/config/CAMAC/NetVarDefn.LynxOS
#!/bin/bash
netstring NetVar_CAMAC_ServerType "CAMAC"

#   variable to indicate that a software reset has been performed after reboot
netint NetVar_CAMAC_HasBeenConfigured 0

#   variable to indicate that a parameter restore has been performed after reboot
netint NetVar_CAMAC_HasBeenRestored 0
/MIDAS/config/CAMAC/NetVarRegDefn
ersdefine   NetVar_MyHostName       generic
erswta      NetVar_MyHostName       -n NetVar_MyHostName -t string
ersdefine   NetVar_ServerType   generic
erswta      NetVar_ServerType   -n NetVar_CAMAC_ServerType -t string
ersdefine   NetVar_ServerOS     generic
erswta      NetVar_ServerOS     -n NetVar_ServerOS -t string
ersdefine   NetVar_HasBeenConfigured        generic
erswta      NetVar_HasBeenConfigured        -n NetVar_CAMAC_HasBeenConfigured -t int
ersdefine   NetVar_HasBeenRestored        generic
erswta      NetVar_HasBeenRestored        -n NetVar_CAMAC_HasBeenRestored -t int
VME register server configuration files

/MIDAS/config/VME/NetVarDefn.LynxOS
#!/bin/bash
netstring NetVar_VME_ServerType "VME"

#   variable to indicate that a software reset has been performed after reboot
netint NetVar_VME_HasBeenConfigured 0

#   variable to indicate that a parameter restore has been performed after reboot
netint NetVar_VME_HasBeenRestored 0
/MIDAS/config/VME/NetVarRegDefn
ersdefine   NetVar_MyHostName       generic
erswta      NetVar_MyHostName       -n NetVar_MyHostName -t string
ersdefine   NetVar_ServerType   generic
erswta      NetVar_ServerType   -n NetVar_VME_ServerType -t string
ersdefine   NetVar_ServerOS     generic
erswta      NetVar_ServerOS     -n NetVar_ServerOS -t string
ersdefine   NetVar_HasBeenConfigured        generic
erswta      NetVar_HasBeenConfigured        -n NetVar_VME_HasBeenConfigured -t int
ersdefine   NetVar_HasBeenRestored        generic
erswta      NetVar_HasBeenRestored        -n NetVar_VME_HasBeenRestored -t int

 return to MIDAS download home page