# Presentation: 177032

## VxWorks 6.0 and EPICS“a first look”

**VxWorks 6.0 and EPICS****“a first look”**

**Ernest L. Williams Jr.**
**27 April 2005**
**EPICS Collaboration Meeting @ SLAC**

## Outline

**What is vxWorks 6.0?**
**Maybe we will begin using the tools?**
**Integration into the EPICS R3.14 build system.**
**Running with EPICS, cool!!**
**Issues/Concerns**
**References**

## What is vxWorks 6.0?

**An expensive new toy!!**

## What is VxWorks 6.0?

**Kernel execution environment compatible with 5.5**
**Real-time Process environment for user-mode code**
**MMU-based memory protection**
**Error detection and reporting facility**
**Better POSIX compilance, esp. in RTPs**
**dosFS improvements**
**Transaction-based Reliable File System**
**ROMFS Filesystem**
**New and enhanced IPC facilities**
**Shared library support**
**Object ownership and resource reclaimation**
**Kernel (target) shell enhancements**
**New processor/device support**
**Improved OS configuration and build facilities**

***New Features***

## What is VxWorks 6.0 (Cont’d)

| Architectures | Intel, MIPS and PowerPC
 |
| --- | --- |
| Architecture
Families |  Pentium ,2,3,4
 MIPS 5Kx, tx49xx, bcm125x
 Freescale PowerPC 60x, PowerPC 7xx, PowerPC 74xx,   PowerPC 82xx, PowerPC 52xx, PowerPC 85xx
 IBM PowerPC 405, PowerPC 44x |
| Hosts |  Windows 2000 professional
 Windows XP
 Solaris 2.8, 2.9
 Red Hat Enterprise Workstation 3.0
--- Fedora Core 3 works great as well (but not supported)
--- Red Hat Enterprise Workstation 4.0 will be supported in future releases |

***Supported Hardware/Host***

***Not good where is the 68K****** ******support --- Did WRS “pull a Redhat?”***

## What is VxWorks 6.0 (Cont’d)

**Real-time Processes (RTPs) are containers for user-mode applications.**
**Each RTP has own copies of code, data, stacks, heap and resources.**
**RTPs are not scheduled – tasks within RTPs are.**
**RTPs are launched from a fully-linked relocatable executable loaded from a file system (a la UNIX).**

***Real-time Processes***

## What is VxWorks 6.0 (Cont’d)

**Object Management (private and public scope)**
**ISR Objects**
**Optimized mutex semaphore for processes**
**Task preemption prevention in processes (taskRtpLock/Unlock)**
**Priority-inheritance enhancement**
**Configurable kernel work queue size**

***Kernel Enhancements***

## What is VxWorks 6.0 (Cont’d)

**Non-executable stack pages (certain CPUs.)**
**Stack overrun and underrun detection.**
**NULL pointer dereference detection (certain CPUs.)**
**Text segment write protection**
**Heap and partition manager instrumentation (run-time checking)**
**Kernel heap allocator improvements (best-fit vs. first-fit)**
**User-space heap and partition allocators**

***Memory Management***

## What is VxWorks 6.0 (Cont’d)

**New error detection and reporting facility**
**Persistent error logs**
**Configurable behaviors on a task, process, and system level**
**Exception handlers instrumented to log information**

***Error Detection and Reporting***

## What is VxWorks 6.0 (Cont’d)

**Improved dosFs file system**
**Safest-order writes of metadata and user data to minimize chances of corruption**
**Optional cache write-through**
**Support for O_SYNC flag on open() operations**
**FIOSYNC ioctl fully flushes block device caches**
**Support for Unicode file names**
**Enhanced CHKDSK (FAT recovery, performance, etc.)**
**TRFS lightweight journaling filesystem**
**ROMFS read-only filesystem**

***File System***

## What is VxWorks 6.0 (Cont’d)

**C interpreter enhancements for process information**
**Handles long long, short, float, signed, unsigned types**
**Path completion (if filesystem supports it)**
**New UNIX shell like interpreter**
**Allows custom interpreters**
**Multiple shell support**
**Secure access (user id/password protection)**
**Fault management support (ED&R)**
**VI or EMACS style command line editting**
**C++ symbol handling enhancements**

***Kernel (Target) Shell***

## New Tools “WindRiver Work Bench”

**Development environment revolves around ECLIPSE.**
**A smart move by WindRiver**
**We still like using the commandline but maybe we will begin to use some of the builtin tools that come bundled with “Workbench”**
**Source Code Analyzer**
**Debugger**
**System Viewer**
**Scope Tools**
**Sergei and Tom use ECLIPSE; so it must be good!**

## EPICS Integration

**BSP migration and flashing the IOC**
**Simply re-compile the mv2100 BSP against vxWorks 6.0**
**If you want native support, then follow the BSP migration documenation.**
**The mv5100 BSP has native support for vxWorks 6.0**
**The idea of the project facility is not too bad when done via command line.**
**Use WRS workbench CLI to add components recommended by Andrew Johnson.**
_**[http://www.aps.anl.gov/epics/base/T20xConfig.html](http://www.aps.anl.gov/epics/base/T20xConfig.html)**_
**vxprj component add INCLUDE_POSIX_TIMERS **
**The GUI folks can use the workbench IDE to do this as well.**

***Prepare vxWorks for EPICS***

## EPICS Integration

**We begin by adding/modifying the EPICS build environment to support building vxWorks 6.0 targets.**
**Supported cross targets at the SNS**
**MVM2101 (vxWorks-mv2100_v6)**
**MVME5110 (vxWorks-mv5100_v6)**
**Changes to $(EPICS_BASE)/configure/CONFIG_SITE**
**Add our two new cross targets**
**Changes to $(EPICS_BASE)/configure/os**
**Add ---- ****CONFIG_SITE.linux-x86.vxWorks-mv2100_v6**
**Add ---- ****CONFIG.Common.vxWorks-mv2100_v6**
**Add ---- ****CONFIG_SITE.linux-x86.vxWorks-mv5100_v6**
**Add ---- ****CONFIG.Common.vxWorks-mv5100_v6**
**Add ---- ****CONFIG.Common.vxWorksCommon_v6**

***Let’s build some vxWorks 6.0 targets***

## EPICS Integration

**CONFIG_SITE.linux-x86.vxWorks-mv2100_v6**
- VX_DIR_YES = /ade/vxWorks/6.0
**CONFIG.Common.vxWorks-mv2100_v6**
- include $(CONFIG)/os/CONFIG.Common.vxWorksCommon_v6
- # Vx GNU cross compiler suffix
- CMPLR_SUFFIX = ppc
- ARCH_CLASS = ppc
- # Architecture specific build flags
- ARCH_DEP_CPPFLAGS = -DCPU=PPC603
- ARCH_DEP_CFLAGS = -mcpu=603 -mstrict-align -mlongcall** **

***Here’s what we do for the mv2100:***

## EPICS Integration

**CONFIG.Common.vxWorksCommon_v6:**
- #--------------------------------------------------
- # vxWorks directory definitions
- # Tornado directory definitions
- GNU_TARGET_INCLUDE_DIR = $(VX_DIR)/vxworks-6.0/target/h
- GNU_TARGET_INCLUDE_DIR += $(VX_DIR)/vxworks-6.0/target/h/wrn/coreip
- GNU_DIR = $(VX_DIR)/gnu/3.3.2-vxworks60/x86-linux2** **

***Wow WRS has moved the headers around on us, hmmm.***

## Running with EPICS R3.14.7

**EPICS is running in kernel space**
**Checkout the DEMO**
**Next Step --- How can EPICS use RTPs?**

## Issues/Concerns

**WRS supplied patches to get around issues with the new “target shell” environment.**
**WRS did a great job to supply patches**
**Compiler problems introduced for C++ drivers**
**Not too bad but thrashes our developers a bit**
**Licensing Model can be a pain.**
**Need to do some real performance testing**

## Issues/Concerns

**Disadvantages**
**Much too expensive**
**WRS is incompetent on deployment of their own licensing schemes**
**“****Subscription” versus “Perpetual”**
**Tries to use FlexLM (maybe WRS should ask the MathWorks how to do this, hmmm?)**
**Unique User **
**Node-Locked**
**Floating**

**Advantages**
**WRS is still the current leader in the Real-Time OS space.**
**Many vendors will give or sell vxWorks drivers.  Most will just give away the driver in source/binary form.**
**Technical Support is really much better.  Really they are!!**
**Network Stack is improved**

## References

**Talk by WindRiver Systems (March 2005)**
_**[http://www.aps.anl.gov/epics](http://www.aps.anl.gov/epics)**_