EPICS Base initialization reference
EPICS Base 7.0.10 implements iocInit() as iocBuild() || iocRun().
A failed build prevents the run phase. These names describe runtime
initialization, not compilation with make.
Build phase sequence
The source executes these major operations in order:
| Order | Operation | Purpose |
|---|---|---|
| 1 | iocBuild_1 | Checks the database definition, prepares the main thread, time support, watchdog, and callbacks |
| 2 | dbCaLinkInit | Prepares Channel Access database links |
| 3 | initDrvSup, initRecSup, initDevSup | Initializes driver, record, and device support |
| 4 | prepareLinks, dbLockInitRecords | Prepares record links and database lock sets |
| 5 | initDatabase, dbBkptInit | Initializes records and database debugging |
| 6 | finishDevSup | Completes device support initialization |
| 7 | scanInit, asInit, dbProcessNotifyInit | Prepares scanning, access security, and processing notifications |
| 8 | initialProcess | Processes records whose PINI is YES |
| 9 | dbInitServers | Initializes registered database servers |
| 10 | iocBuild_3 | Sets the built state and announces initHookAfterIocBuilt |
Callbacks and driver resources can exist during this phase. The
statement that no threads start before iocRun() is incorrect.
initDatabase performs the record initialization passes; it runs after
lock-set initialization. finishDevSup is a distinct routine, not a
second invocation of initDevSup.
Run phase sequence
iocRun() announces initHookAtIocRun, calls scanRun and dbCaRun,
and announces initHookAfterDatabaseRunning. It then calls
dbRunServers for a normal IOC build.
The first run announces initHookAtEnd, prints the initialization
completion message, sets the running state, and announces
initHookAfterIocRunning. Records with PINI=RUN or PINI=RUNNING
process at their corresponding run hooks; they are distinct from the
PINI=YES processing in the build phase.
The authoritative sequence is in
Base 7.0.10 iocInit.c,
functions iocBuild, iocBuild_2, iocRun, and initialProcess.