- For a more comprehensive overview and detailed questions, please refer to the following page:
- FAQ for working with 32-bit and 64-bit linuxRT OS and EPICS
...
LinuxRT Initial Set-up of cpu and ioc Directory Structureboot directories:
- BOLD: refers to files that need to be modified or generated by IOC developer
- Italics: symbolic link
- LinuxRT_Diagram (old)
- Create the $IOC_DATA directory for your cpu and iocs as follows:
- cd $IOC_DATA
- mkdir cpu-<area>-<subsystem-prefix><2-digit#>
- mkdir sioc-<area>-<subsystem-prefix><2-digit#>
- cd sioc-<area>-<subsystem-prefix><2-digit#>
- mkdir autossave autosave-req iocInfor archive restore
- Create the $EPICS_IOCS cpu and ioc boot directories
- cd $EPICS_IOCS
- mkdir cpu-<area>-<subsystem-prefix><2-digit#>
- cd cpu-<area>-<subsystem-prefix><2-digit#>
- Setup relative symbolic links to the common startup script and EPICS version:.
- ln -s ../common/st.cmd.linuxRT.cpu startup.cmd
- ln -s ../common/bin/<epics base version> epicsSpecificRelease
- Generate a kernel-modules.cmd file
- for examples click here.
- mkdir sioc-<area>-<subsystem-prefix><2-digit#>
- cd sioc-<area>-<subsystem-prefix><2-digit#>
- cp ../template/st.cmd.linuxRT startup.cmd
- edit startup.cmd and replace <ioc> with your ioc name.
- cp ../template/screenrc and replace <ioc> with your ioc name.
- edit screenrc and replace <ioc> with your ioc name.
- Please note that if the location of your IOC Application st.cmd file is non-standard then change EPICS_IOC_APP path in startup.cmd
- Setup a relative symbolic link to the TOP of the IOC Application release
- ln -s ../../iocTop/<app>/<version> iocSpecificRelease
Edit - Add cpu and IOC to $EPICS_IOCS/
screeniocs – please note this - screeniocs
- Please note that the $EPICS file is a symbolic link, so cd to the appropriate directory and edit this file
.- add line for
...
# Alias Terminal Server Port No. screen is run Comments (must start with #)
#------- ------------- ------- -------------- -----------------------------------------------
- cpu
format: cpu-<area>-<subsystem-prefix><2-digit #> <ts> <ts port #t> <screen host> [ # comment] - add line for each ioc
format: sioc-<area>-<subsystem prefix><2-digit #> cpu-<area>-<subsystem-prefix><2-digit #> <account> [ # comment] - The "comment" field in screeeniocsis optional and must be precede but "#".
To reboot linuxRT ioc from a Linux client type the following:: "viocRestart -v <ioc>" RT IOC Applications:
- Create script <app>
- ex) Hostname
Generate cpu-##-## directory- Make a symbolic link named “startup.cmd” that points to “../skel/startup_cpu.cmd”
- Create a “kernel-modules.cmd” file that is specific for your cpu
Make a symbolic link for each vioc(s) hosted on the cpu (ln -s ../vioc-xx##-xx## vioc-xx##-xx##)
Create a vioc-##-## directory for each vioc running on this machine- Create a “screenrc” file that is name-specific for each vioc
- Make a symbolic link named “startup.cmd” that points to “../skel/startup_vioc.cmd”
Make a symbolic link called “iocSpecificRelease” that follows the CRAM convention for pointing to an Epics application
How to CRAM your Epics Application:
Update $IOC/All/Dev screeniocs
Update information pertaining to which vioc’s are running on a cpu and currently the application each vioc is running
- Commit screeniocs back into CVS
RT IOC Applications:Create a - /iocBoot/<ioc>/rtPriortiesSetup.cmd
file - to set real-time priorities for threads
- Load rtPriortiesSetup.cmd
file - from <app>/iocBoot/<ioc>/st.cmd
LinuxRT Upgrade IOC Application release:
How to commit screeniocs back into CVS:
...
From the command line, start a linuxRT Epics Application manually (must run on a linuxRT machine)-to start your linuxRT EPICS Application manually from Linux command line:
- ssh laci@cpu-b34-fb01
- cd to to the epics application directory structure and run the st.cmd for a linuxRT application<app>/iocBoot/<ioc>
- ./st.cmd (cmd – first line of st.cmd must have !# for this to execute epics application binary ex: !# ../../bin/linuxRT_glibc-x86_64/fastFeedback)<exe>
How-to boot -up in the foreground versus backgrounda linuxRT ioc from the <cpu>:
The following scripts are located under the directory $IOC/common and should be in PATH
- In the foreground w/screens
- linuxRT_viocConsole.sh vioc-b34-fb01sh <ioc>
- In the background w/screens
- linuxRT_startup_vioc.sh vioc-b34-fb01<ioc>
- In the foreground without screens
- linuxRT_startupConsole.sh
vioc-b34-fb01
Development Mode:
How-to use If you're going to be frequently changing what viocs start automatically and don't want to keep changing the screeniocs file, you can define $LOCAL_IOCS in your kernel-modules.cmd file to override what's in screeniocs. Examples:
export LOCAL_IOCS=( vioc-abc-123 vioc-456-def vioc-789-ghi )
or to start nothing
export LOCAL_IOCS=( )
Don't do this with stable production systems. It's there to give you flexibility during development without changing screeniocs all the time.
If using the screen program:
- ctrl a d : detach from the screen session
- ctrl a { a [ : scroll up through the start-up messages.
- View all vioc's on host host cpu:
- logged in as laci or flaci for FACET iocs
- screen -
ls - Attach to vioc: screen -r <vioc_name><ioc>
- Attaching to a linuxRT screen session multiple times with "laci" concurrently: (Note: from FACET use flaci)
screen -x <vioc_name><ioc>
Note: The "screen" program supports multi-display mode. When you attach an existing screen session, you can use "-x". It allows an user to attach to "a not detached screen session." The -r option allows a user to attach to a "detached screen session".
...
If you're going to be frequently changing what viocs start automatically and don't want to keep changing the screeniocs file, you can define $LOCAL_IOCS in your kernel-modules.cmd file to override what's in screeniocs.
...
Common Linux Commands Used
...
Additional References:
...