New driver model

This commit is contained in:
zimoch
2015-11-06 15:14:18 +00:00
parent 99d76b30fe
commit 72f852876a
4 changed files with 82 additions and 46 deletions

View File

@@ -11,36 +11,51 @@
# do the NFS mounts
< ../../startup/network
# find a better way later to know current require version
REQUIRE_VERSION="2.1.7"
STRINGBUFFER=malloc(256)
sprintf STRINGBUFFER, "IOC=%s", IOC
putenv STRINGBUFFER
# set the prompt
sprintf (STRINGBUFFER, "%s (startup.script aborted) > ", IOC)
shellPromptSet (STRINGBUFFER)
sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC
shellPromptSet STRINGBUFFER
BOOTPC=&sysBootHost
# setup logging on boot PC
sprintf STRINGBUFFER, "EPICS_IOC_LOG_INET=%s", BOOTPC
putenv STRINGBUFFER
putenv "EPICS_IOC_LOG_PORT=6500"
# create some path variables
HOME=malloc(80)
sprintf (HOME, "/ioc/%s", IOC)
sprintf HOME, "/ioc/%s", IOC
cd HOME
CFG=malloc(80)
sprintf (CFG, "%s/cfg", HOME)
sprintf CFG, "%s/cfg", HOME
STREAM_PROTOCOL_DIR=malloc(80)
sprintf (STREAM_PROTOCOL_DIR, "%s/cfg", HOME)
sprintf STREAM_PROTOCOL_DIR, "%s/cfg", HOME
LIB=malloc(80)
sprintf (LIB, "%s/iocBoot/%s/%s", INSTBASE, EPICS, ARCH)
sprintf LIB, "%s/iocBoot/%s/%s", INSTBASE, EPICS, ARCH
EPICS_MODULES = "/work/iocBoot/modules"
DBD=malloc(80)
sprintf (DBD, "dbd:%s/iocBoot/%s/dbd", INSTBASE, EPICS)
sprintf DBD, "dbd:%s/iocBoot/%s/dbd", INSTBASE, EPICS
sprintf (STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin:snl:%s", LIB)
putenv (STRINGBUFFER)
sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin:snl:%s:%s", EPICS_MODULES, LIB
putenv STRINGBUFFER
TEMPLATES=malloc(80)
sprintf (TEMPLATES, ".:%s/iocBoot/templates", INSTBASE)
sprintf TEMPLATES, ".:%s/iocBoot/templates", INSTBASE
# time server (must be set before any drivers are configured)
putenv("EPICS_TS_NTP_INET=129.129.190.1")
putenv "EPICS_TS_NTP_INET=129.129.190.1"
# Release memory above 32 MB
# Code loaded after this must be compiled with -mlongcall
@@ -49,9 +64,48 @@ putenv("EPICS_TS_NTP_INET=129.129.190.1")
#EXTENDED_MEMORY=0
EXTENDED_MEMORY=sysPhysMemTop()-sysMemTop()
#Load EPICS version dependent script
sprintf (STRINGBUFFER, "%s/iocBoot/startup/EPICS_%s", INSTBASE, EPICS)
cd STRINGBUFFER
< startup.script_epicsdependent
# load EPICS system core (different names for 3.13 and 3.14)
sprintf STRINGBUFFER, "%s/iocCore%s", LIB, strncmp(EPICS,"R3.13",5) ? "Library.munch" : ""
ld 0, 0, STRINGBUFFER
# TIMEZONE must be set after iocCoreLibrary.munch and before iocInit
# 2016:
putenv "TIMEZONE=MET::-60:032702:103003"
putenv "EPICS_TS_MIN_WEST=-60"
# try for user-defined menus scan and convert
dbLoadDatabase "dbd/scan.dbd"
dbLoadDatabase "dbd/convert.dbd"
dbLoadDatabase "dbd/slsConvert.dbd"
taskDelay sysClkRateGet()
# load "require"
sprintf STRINGBUFFER, "require_VERSION=%s", getenv("require_VERSION") ? getenv("require_VERSION") : REQUIRE_VERSION
putenv STRINGBUFFER
sprintf STRINGBUFFER, "require_DIR=%s/require/%s/%s/", EPICS_MODULES, getenv("require_VERSION"), EPICS
putenv STRINGBUFFER
sprintf STRINGBUFFER, "%s/lib/%s/requireLib.munch", getenv("require_DIR"), ARCH
ld 0, 0, STRINGBUFFER
#load standard drivers (allow user to specify version in environment variable)
require "base", getenv("base_VERSION")
registerModule "require", getenv("require_VERSION"), getenv("require_DIR")
require "utilities", getenv("utilities_VERSION")
require "misc", getenv("misc_VERSION")
require "seq", getenv("seq_VERSION")
require "iocmon", getenv("iocmon_VERSION")
AUTOSRHOST=BOOTPC
# run EPICS only on 1st network port
putenv "EPICS_CA_AUTO_ADDR_LIST=NO"
putenv bootInfo("EPICS_CA_ADDR_LIST=%B")
putenv bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e")
putenv "EPICS_CAS_AUTO_BEACON_ADDR_LIST=NO"
putenv bootInfo("EPICS_CAS_BEACON_ADDR_LIST=%B")
# insert boot infos into database
bootNotify INSTBASE, "sls/bin/iocBootNotify.sh"
# end of startup.script_common

View File

@@ -1,4 +0,0 @@
# $Source: /cvs/A/CS/startup/startup.script_iocmon,v $
require "iocmon"
sprintf (STRINGBUFFER, "IOC=%s,CRATE=%s", IOC, IOC)
dbLoadDatabase ("iocmon.template", TEMPLATES, STRINGBUFFER)

View File

@@ -1,35 +1,9 @@
# $Source: /cvs/A/CS/startup/startup.script_part2,v $
# 2nd part of common startup
# setup logging on boot PC
putenv(bootInfo("EPICS_IOC_LOG_INET=%h"))
putenv("EPICS_IOC_LOG_PORT=6500")
# run EPICS only on 1st network port
putenv("EPICS_CA_AUTO_ADDR_LIST=NO")
putenv(bootInfo("EPICS_CA_ADDR_LIST=%B"))
putenv(bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e"))
putenv("EPICS_CAS_AUTO_BEACON_ADDR_LIST=NO")
putenv(bootInfo("EPICS_CAS_BEACON_ADDR_LIST=%B"))
#Enable memory >32MB on IOC that have it. (Is a NOOP on all others)
memAddToPool (sysMemTop(),EXTENDED_MEMORY)
# setup clock
# TIMEZONE must be set after iocCoreLibrary.munch and before iocInit
# 2015:
putenv("TIMEZONE=MET::-60:032902:102503")
memAddToPool sysMemTop(), EXTENDED_MEMORY
iocInit
# initialize records
sprintf (STRINGBUFFER, "%s/sls/bin/loadAllSettings.sh", INSTBASE)
rsh (bootHost(), STRINGBUFFER, IOC, "default")
# insert record list into database
sprintf (STRINGBUFFER, "/home/ioc/%s.dbl", IOC)
listRecords (STRINGBUFFER, "RTYP DESC")
sprintf (STRINGBUFFER, "%s/sls/bin/dbl2odb.sh", INSTBASE)
rsh (bootHost(), STRINGBUFFER, IOC, bootInfo("%B"), getenv("EPICS_CA_SERVER_PORT"), "&")
# end of startup.script_part2

View File

@@ -1,4 +1,16 @@
# $Source: /cvs/A/CS/startup/startup.script_part3,v $
# insert record list into database
sprintf STRINGBUFFER, "/home/ioc/%s.dbl", IOC
listRecords STRINGBUFFER, "RTYP DESC"
sprintf STRINGBUFFER, "%s/sls/bin/dbl2odb.sh", INSTBASE
rsh BOOTPC, "dbl2odb.sh", IOC, bootInfo("%B"), getenv("EPICS_CA_SERVER_PORT")
# insert library list into database
sprintf (STRINGBUFFER, "/home/ioc/%s.libs", IOC)
libversionShow (0, STRINGBUFFER)
rsh (BOOTPC, "upload_libinfo.sh", "-r -i", IOC, "-l", STRINGBUFFER)
# set the prompt
sprintf (STRINGBUFFER, "%s > ", IOC)
shellPromptSet (STRINGBUFFER)