Application of EPICS 3.14 on Linux Beijing EPICS Seminar Tuesday, 8/21 2002 J.Odagiri Contents   Application of Linux IOC  Hardware support is not matured yet  Still, Linux IOC.

Download Report

Transcript Application of EPICS 3.14 on Linux Beijing EPICS Seminar Tuesday, 8/21 2002 J.Odagiri Contents   Application of Linux IOC  Hardware support is not matured yet  Still, Linux IOC.

Application of EPICS 3.14
on Linux
Beijing EPICS Seminar
Tuesday, 8/21 2002
J.Odagiri
Contents


Application of Linux IOC

Hardware support is not matured yet

Still, Linux IOC is useful in some cases
Hard real-time support

Linux is not real-time OS

Linux on RTOS for EPICS
Application of Linux IOC

Linux IOC for

Purely soft records

Network devices

Alternative of PCAS

Graphics processing
Lots of Network Devices
Linux IOC with
EPICS 3.14
PLCs
AIO/DIO Controllers
Custom Embedded
Controllers
Network
Network Devices to be used
Type
Make
Server
Command
User
FA-M3
Yokogawa
TCP / UDP
PL
JAERI-KEK
MELSEC-Q
Mitsubishi
UDP
MC
RIKEN
CVM1 / CS1H
Omron
UDP
FINS
RIKEN / KEKB
WE7000
Yokogawa
UDP
WE7000
JAERI-KEK
DA100
Yokogawa
TCP
-
PF-AR
N-DIM
?
TCP
Original
RIKEN
EMB-LAN100
Nichicon
UDP
Original
JAERI-KEK
Never want many drivers
Record Support
FA-M3
MELSEC
CVM1
Device Support Library
Network IO Driver
…
Network I/O driver
Queue
Notify
Scan task
Seq task
CA task
I/O
task
Command
Response
Things to be considered

Some use TCP and others use UDP

Concurrent processing on the device side



Some of the latest PLCs operate with multi-tasking
OS
Device driven I/O

Event Notification

Local Scanning and Reporting
…
An Alternative of PCAS
Acc control Network
Utility Facility
Control System
Lab Network
Linux IOC with
EPICS 3.14
“Virtual Shared Memory”
Cannel Access
Run-time Database
Record Support
Device Support
Utility Facility
Control System
Mapped Data Table
TCP/IP Client
Data
Server
Some Comments


Time-stamps of the records do not show
the time the data were born
To avoid additional delay



TCP/IP Client calls post_event() just after it
refreshes the data table
TCP/IP Client must be implemented as a
member of the threads of the iocCore
The system is almost completed and
expected to be in operation in a month
Beam Profile Processing
Run-time DB on
VME IOC
Graphics Processing on
Windows PC
+
Portable CA
Network
“Multi-media” is for Linux
Linux IOC with
EPICS 3.14
(CompactPCI ?)
Graphics Card with
Linux driver
+
Graphics Packages
for Linux
+
Device Support
Contents


Application of Linux IOC

Hardware support is not matured yet

Still, Linux IOC is useful in some cases
Hard real-time support

Linux is not real-time OS

Linux on RTOS for EPICS
Latency in Linux Kernel
Non-preempt-able Kernel ( tens of ms )
Interrupt Disabling ( hundreds of ms )
Address Space Switching ( tens of ms )
Non-preemptive Kernel
Interrupt
Latency
Kernel
High Priority Process
Low Priority Process
Interrupt Disabling
unsigned long flags;
save_flags(flags);
cli();
/* critical section */
restore_flags(flags);
Address Space Switching
x86
CR3
User
Space
RT-task
RT-task
Kernel
Space
Each Process has
Kernel Space
mapping
Solutions


Preempt-able Kernel

Developed by MontaVista people

Linux 2.6 is to adopt this technology
RTLinux

Developed by V.Yodaiken et.al.

They hold the patent on their method
Preempt-able Kernel
Interrupt
Kernel
Latency
High Priority Process
Low Priority Process
Preempt-able Linux kernel

How can it be done?


Redefining SMP spin-lock to mutex for
multiple processes on a single processor
Suffers from the other two obstacles

Latency: less than some ms in most of the
cases
I’m listening to nice music

I may lose my mood if

the instruction register gets an instruction
from a part of the kernel never covered in
prior tests

the telephone starts ringing

my child starts crying
I’m taking off into the air

I may lose my life if

the instruction register gets an instruction
from a part of the kernel never covered in
prior tests

a private jet crosses my route

the engine starts crying
Architecture of RTLinux
Process
Process
task task
Linux scheduler
Real-time scheduler
Architecture of RTLinux
Linux task
task task
Real-time scheduler
Architecture of RTLinux
User Space
Process
Process
Kernel
Space
task task
Linux scheduler
Real-time scheduler
Architecture of RTAI
Process
Process
task task
Linux scheduler
Real-time scheduler
Hard real-time mode
Process
Process
task task
Linux scheduler
Real-time scheduler
Soft real-time mode
Process
Process
task task
Linux scheduler
Real-time scheduler
Can be a mixture of both
Process
Threads
task task
Linux scheduler
Real-time scheduler
Conclusions


Linux IOC is useful for

Network devices

An alternative of PCAS

Graphics processing in EPICS
You may be able to benefit from

Soft real-time support some time soon

Hard real-time support some unpredictable time
soon … or late