1 / 22

PORTING EPICS TO L4-LINUX BASED SYSTEM

PORTING EPICS TO L4-LINUX BASED SYSTEM. J. Odagiri, N. Yamamoto and T.Katoh High Energy Research Organization, KEK, 1-1 Oho, Tsukuba, Ibaraki, Japan. Abstract.

Download Presentation

PORTING EPICS TO L4-LINUX BASED SYSTEM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PORTING EPICS TO L4-LINUX BASED SYSTEM J. Odagiri, N. Yamamoto and T.Katoh High Energy Research Organization, KEK, 1-1 Oho, Tsukuba, Ibaraki, Japan

  2. Abstract Experimental Physics and Industrial Control System (EPICS) is now widely used for many accelerator control systems. While the current and the former versions of EPICS have required VxWorks [2] to run core software on Input/Output Controllers (IOCs), the next version (R3.14) is to be portable to many other platforms. Considering the recent trend toward Linux, it is an attractive candidate for the port. However, the Linux kernel cannot ensure real-time responsiveness because it does not preempt the execution from a process that is running in the kernel. As an alternative, we adopted L4-Linux, a port of Linux onto a real-time micro-kernel (L4), as the platform. The system allows any EPICS thread to benefit from either the real-time scheduling by L4 or the many functions of Linux. The adaptations on L4-Linux required for the port, the interface libraries between the IOC software and L4-Linux, and a library to support the VMEbus are described. A preliminary result of measurement on interrupt latency is also presented.

  3. Backgrounds • EPICS is going to be portable to multiple operating systems [1, 3]. • Linux is going to be de-fact standard in PC-UNIX world. • If we can run all software components of EPICS under Linux on a single PC, it would be cost-effective.

  4. EPICS on a Single PC MEDM Emacs iocCore X

  5. Linux Is Not Real-time OS • Disk I/O causes 20 - 30 ms of latency [4], possibly latency can be around 100 ms or more [7] • Cause [7]: • Non-preemptive kernel • Scheduling algorithm • Interrupt Disabling

  6. Non-preemptive Kernel Interrupt Latency Kernel High Prio Low Prio

  7. Preemptive Kernel Interrupt Kernel High Prio Low Prio

  8. Can’t We Use RT-Linux? • RT-Linux ensures hard real-time responsiveness, but… • Real-time tasks run in the Linux kernel address space communicating with non-real-time processes through FIFOs or shared memory [6]. • iocCore requires all of the threads to work together in a single user address space sharing global symbols [1, 3].

  9. Structure of iocCore Network Channel Access Run-time Database Device Access Layer I/O Buses (VME/PCI/ISA)

  10. What Is L4-Linux? • Developed at Dresden Institute of Technology in corporation with IBM Watson Research Center [7] • A port of Linux onto a preemptive real-time micro-kernel (L4 or Fiasco [8]) as a server task • L4 provides: threads, address spaces, and IPC • A user process of Linux is also a task of L4 • A user process calls the Linux server for a service through an IPC call

  11. EPICS under L4-Linux Linux Server X MEDM iocCore L4 real-time micro-kernel

  12. Linux System Call Interrupt Interrupt Linux Kernel L4 Kernel ( IPC ) Linux Server Process Process Standard Linux L4-Linux

  13. RT-thread Preempts Process Interrupt L4 Kernel RT- thread Linux Server Process

  14. RT-thread Preempts Linux Interrupt L4 Kernel RT- thread Linux Server Process

  15. RT-thread Calls Linux Interrupt L4 Kernel RT- thread Linux Server Process

  16. What if RT-thread calls Preempted Linux? Interrupt L4 Kernel Latency RT- thread Linux Server Process

  17. Thread under L4-Linux • A L4 task can have up to 128 threads in its own address space. • But, the clone system call of Linux creates another new L4 task. • Still, a cloned and its creator can share a single virtual address space. • They do not share the page tables, but have their own with same contents.

  18. OS-interface libraries • Thread • Provides threads created through “clone” • Semaphores • Provides binary semaphores and mutual exclusion semaphores on L4 IPC • Interrupt • User processes of L4-Linux are allowed to enable/disable interrupts by using cli ( )/sti () • Time • Not yet implemented

  19. VMEbus Support • Some of the counter parts of the VxWorks functions were implemented. • vmeInit ( ) • vmeBusToLocalAddr ( ) • vmeLocalToBusAddr ( ) • vmeIntConnect ( ) • vmeIntEnable ( ) • vmeIntDisable ( )

  20. Interrupt Latency To confirm the validity of the scheme, interrupt latency was measured on a VME CPU board, which has a Celeron 300MHz processor. A process that causes heavy I/O load on an IDE disk was used as a background [4]. With this background running, a thread got the CPU clock-count and issued a command to a VME module, which caused the interrupt. Triggered by the interrupt, an interrupt handler (another thread connected to the interrupt) got the CPU clock-count again and cleared the interrupt. Iterating the above steps, the latency, the difference of the two clock-count values, was measured.

  21. CONCLUSIONS As a platform for the PC-based EPICS, L4-Linux was adopted and modified to launch real-time threads. The essential functions of both OS-interface libraries and a library to support VMEbus were implemented.   By using the libraries, interrupt latency was measured on a PC compliant VME CPU board. The latency in the worst case was less than one millisecond. It indicates that the real-time threads preempted the execution from the Linux server. The dominant factor of the latency should be the critical sections executed by the Linux server with disabling interrupts.

  22. REFERENCES [1] http://www.aps.anl.gov/epics/ [2] http://www.windriver.com/ [3] M. Kraimer et.al., “EPICS: Porting iocCore to Multiple Operating Systems,” ICALEPCS’99, Trieste, Italy, Oct. 1999. [4] http://www-online.kek.jp/~nakayosi/ [5] http://www.mvista.com/realtime/ [6] http://www.rtlinux.org/ [7] http://os.inf.tu-dresden.de/L4/LinuxOnL4/ [8] http://os.inf.tu-dresden.de/fiasco/ [9] http://www.vmic.com/ [10] http://lisa2.physik.uni-bonn.de/~hannappe/

More Related