Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

OrderOperationPurpose
1iocBuild_1Checks the database definition, prepares the main thread, time support, watchdog, and callbacks
2dbCaLinkInitPrepares Channel Access database links
3initDrvSup, initRecSup, initDevSupInitializes driver, record, and device support
4prepareLinks, dbLockInitRecordsPrepares record links and database lock sets
5initDatabase, dbBkptInitInitializes records and database debugging
6finishDevSupCompletes device support initialization
7scanInit, asInit, dbProcessNotifyInitPrepares scanning, access security, and processing notifications
8initialProcessProcesses records whose PINI is YES
9dbInitServersInitializes registered database servers
10iocBuild_3Sets 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.