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