DOI QR코드

DOI QR Code

Fixed Time Synchronous IPC in Zephyr Kernel

Zephyr 커널에서 고정 시간 동기식 IPC 구현

  • Received : 2017.03.14
  • Accepted : 2017.05.30
  • Published : 2017.08.31

Abstract

Linux Foundation has announced a real-time kernel, called Zephyr, for IoT applications recently. Zephyr kernel provides synchronous and asynchronous IPC for data communication between threads. Synchronous IPC is useful for programming multi-threads that need to be executed synchronously, since the sender thread is blocked until the data is delivered to the receiver thread and the completion of data transfer can be known to two threads. In general, 'IPC execution time' is defined as the time duration between the sender thread sends data and the receiver thread receives the data sent. Especially, it is important that 'IPC execution time' in the synchronous IPC should be fixed in real-time kernel like Zephyr. However, we have found that the execution time of the synchronous IPC in Zephyr kernel increases in proportion to the number of threads executing in the kernel. In this paper, we propose a method to implement a fixed time synchronous IPC in Zephyr kernel using Direct Thread Switching(DTS) technique. Using the technique, the receiver thread executes directly after the sender thread sends a data during the remaining time slice of the sender thread and we can archive a fixed IPC execution time even when the number of threads executing in the kernel increases. In this paper, we implemented synchronous IPC using DTS in the Zephyr kernel and found the IPC execution time of the IPC is always 389 cycle that is relatively small and fixed.

Keywords

References

  1. E. Baccelli, O. Hahm, M. Wahlisch, M. Gunes, T. C. Schmidt, "RIOT: One OS to Rule Them All in the IoT," INRIA Research Report No. RR-8176, 2012.
  2. P. A. Laplante, S. J. Ovaska, Real-Time Systems Design and Analysis: Tools for the Practitioner, 4th Edition, John Wiley & Sons, Inc. 2012.
  3. Zephyr Project Documentation, 2016. https://www.zephyrproject.org/doc/1.6.0
  4. E. Kim, D. Shin, "IPC Implementation and Analysis Using Direct Thread Switching on Operating System Kernel," Proceedings of the Conference of Institute of Korean Engineering of Korea, Vol. 1, No. 1, pp. 398-401, 2015 (in Korean).
  5. D. Shin, S. Son, E. Kim, "An Implementation of IPC Using Direct Thread Switching," International Journal Of Engineering And Computer Science, Vol. 5, No, 1, pp. 15454-15457, 2016.
  6. A. Silberchatz, P. B. Galvin, G. Gagne, Operating System Concepts, Chapter 3 Processes, 9th Edition, John Wiley & Soons, Inc., 2012.
  7. W. Stallings, Operating Systems Internals and Design Principles, Chapter 5 Concurrency: Mutual Exclusion and Synchronization, 8th Edition, Pearson Education, Inc., 2014.
  8. T. Jaeger, J. E. Tidswell, A. Gefflaut, Y. Park, K. Elphinstone, J. Liedtke, "Synchronous IPC Over Transparent Monitors," Proceedings of the 9th ACM SIGOPS European Workshop, pp. 189-194, 2000.
  9. J. Liedtke, "On Micro-kernel Construction," Proceedings of the 15th ACM Symposium on Operating Systems Principles, Vol. 29, No. 5, pp. 237-250, 1995.
  10. J. Lidetke, "Improving IPC by Kernel Design," Proceeding of the 14th ACM Symposium on Operating Systems Principles, Vol. 27, No. 5, pp. 175-188, 1993.
  11. K. Elphinstone, G. Heiser, "From L3 to seL4: What Have We Learnt in 20 Years of L4 Microkernel?," Proceeding of the 24th ACM Symposium on Operating Systems Principles, pp. 133-150, 2013.
  12. A. Lyons, G. Heiser, "It's Time: OS Mechanisms for Enforcing Asymmetric Temporal Integrity," ArXiv:1606.00111, 2016.
  13. J. Jung, E. Kim, J. Lim, D. Shin, "Efficient Synchronous IPC in Zephyr Nanokernel," The Conference of Institute of Korean Engineering of Korea 2016, Vol. 1, No.1, pp. 442-445, 2016 (in Korean).
  14. ARM, ARM Cortex-M4 Processor Technical Reference Manual, Revision: r0p1, ARM 100166_0001_00_en, 2015.
  15. J. Yiu, The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors, 3rd Edition, Elsevier Inc., 2014.
  16. NXP, FRDM-K64F Freedom Module User's Guide Rev 1, FRDMK64FUG, 2016.
  17. E. Kim, J. Jung, J. Kim, D. Shin, "Improving Fiber Scheduling in Zephyr Kernel," The Conference of Institute of Korean Engineering of Korea, Vol. 1, No.1, pp. 438-441, 2016 (in Korean).
  18. ARM Limited, ARMv7-M Architecture Reference Manual, ARM DDI 0403E.b, Part C Debug Architecture, 2014.