Assignment - Add Operating System Specific Code to an Operating System Independent (OSI) IOC Application ---------------------------------------------------------------- Add exampleApp synchronous device support for a stringin record that provides the name of the "shell" running the IOC executable using OSI routines (no ifdefs). For RTEMS, set to the value to "Cexp". For linux, set the value to the SHELL environment variable. For all other OSs, set the value to "Unknown" and set the record severity to invalid and an appropriate status. Create a database with a stringin record, using the device support. Refer to Chapter 20.1 and section 4.6.1 of the app dev guide for setting up os directories to contain OS-dependent source. For setting record severity and status, refer to section 11.6.1 of the app dev guide for using recGblSetSevr and $EPICS_BASE_RELEASE/include/alarm.h. See Chapter 6.6 of the app dev guide for setting up the device database definition file. See section 6.12.2 for setting up the record's DTYP and INP fields. Hints: (1) Refer to Chapter 20.1 and section 4.6.1 of the app dev guide for setting up os directories to contain OS-dependent source. For this example, create these directories: exampleApp/src/os/RTEMS exampleApp/src/os/Linux exampleApp/src/os/default (2) In each directory, add osdShell.c with a function (same name and prototype for all OSs) to return an appropriate string (or no string). Use getenv for Linux. Add osdShell.h to exampleApp/src with the prototype of the function. (3) In exampleApp/src, copy devXxxSoft.c to devStringin.c. Edit devStringin.c to change devXxxSoft to devStringin and xxx to stringin. (4) Edit devStringin.c - init_record does nothing in this assignment. (5) Edit devStringin.c - read_stringin calls the function in osdShell.c. Include osdShell.h for the prototype. It needs to reset udf and use recGblSetSevr to set an invalid severity and bad status for an error from the os function. See section 11.6.1 for more about recGblSetSevr. See $EPICS_BASE_RELEASE/include/alarm.h for available severities and statuses to use as recGblSetSevr arguments. (6) Create devStringin.dbd with the appropriate "device" line for the stringin record. For link type, either CONSTANT or INST_IO can be used - the stringin record INP field will be different depending on which is used. (7) Add devStringin.c, osdShell.c, and devStringin.dbd to exampleApp/src/Makefile. The build will automatically find the correct osdShell.c to compile - just add it as another SRC file. (8) Create exampleApp/Db/dbShell.db with a stringin record. Add it to the Makefile. (9) Do a "make" of exampleApp. (10) Change iocBoot/ioc*/st.cmd to add dbShell.db. (11) Restart the rtems and linux iocs. (12) camonitor the shell PV.