4.6 IOC startup sequence
A compiled IOC combines its executable, linked support libraries, and runtime configuration. The startup file joins these parts in an order that lets records find their device support.
Files and runtime responsibilities
| Component | Provides |
|---|---|
bin/linux-x86_64/jeonglee_Demo | IOC program linked to the selected support |
dbd/jeonglee_Demo.dbd | Record types, devices, drivers, and registrars |
db/ | Record instances, templates, substitutions, and protocols |
iocsh/ | Installed reusable configuration fragments |
iocBoot/ | Startup commands and generated envPaths |
configure/RELEASE selects build dependencies. The generated envPaths
sets their runtime paths and the application’s TOP.
The startup in lesson 4.5 follows this order:
- Read
envPathsand define paths and macros. - Load the application DBD and call its support registration function.
- Configure the asyn port and its newline terminators.
- Load database records with their prefix and port macros.
- Call
iocInit()once. - Run diagnostics such as
dbl.
A DBD defines available types and support; it does not instantiate PVs.
dbLoadRecords creates record instances, and iocInit() initializes
those records and starts database scanning and servers. The IOC becomes
ready for clients when it prints iocRun: All initialization complete.
Drivers can create resources or connect to devices during configuration. Do not interpret the pre-initialization phase as a guarantee that no threads or device communication exist.
Initialization and diagnostics
iocInit() runs iocBuild() followed by iocRun() when the build
phase succeeds. The first phase prepares records and scanning; the
second enables database scanning and registered servers. The
initialization reference lists the Base sequence.
dbl lists loaded records even before initialization. Its output alone
does not prove that record processing or network access works. Client
reads and changing simulator values provide that evidence.
To inspect linked libraries, run this from the application root:
ldd bin/linux-x86_64/jeonglee_Demo
With the Chapter 3 support enabled, the list includes libasyn,
libstream, libcalc, libpvxs, and EPICS Base libraries. Every
required library must resolve to a file; not found indicates a missing
runtime dependency. Paths and memory addresses vary between hosts.