DOI QR코드

DOI QR Code

Separation of Kernel Space and User Space in Zephyr Kernel

Zephyr 커널에서 커널 공간과 사용자 공간의 분리 구현

  • Received : 2018.02.02
  • Accepted : 2018.06.29
  • Published : 2018.08.31

Abstract

The operating system for IoT should have a small memory footprint and provide low power state, real-time, multitasking, various network protocols, and security. Although the Zephyr kernel, an operating system for IoT, released by the Linux Foundation in February 2016, has these features but errors generated by the user code can generate fatal problems in the system because the Zephyr kernel adopts a single-space method that both the user code and kernel code execute in the same space. In this research, we propose a space separation method, which separates kernel space and user space, to solve this problem. The space separation that we propose consists of three modifications in Zephyr kernel. The first is the code separation that kernel code and user code execute in each space while using different stacks. The second is the kernel space protection that generates an exception by using the MPU (Memory Protection Unit) when the user code accesses the kernel space. The third is the SVC based system call that executes the system call using the SVC instruction that generates the exception. In this research, we implemented the space separation in Zephyr v1.8.0 and evaluated safety through abnormal execution of the user code. As the result, the kernel was not crashed by the errors generated by the user code and was normally executed.

Keywords

References

  1. O. Hahm, E. Bacceli, H. Petersen, N. Tsiftes, “Operating Systems for Low End Devices in the Internet of Things: a Survey,” IEEE Internet of Things Journal, Vol. 3, No. 5, pp. 720-734, 2016. https://doi.org/10.1109/JIOT.2015.2505901
  2. T.V. Chien, H.N Chan, T.N Huu, "A Comparative Study on Operating System for Wireless Sensor Networks," Proceedings of IEEE Conference Publications, pp. 73-78, 2011.
  3. Zephyr Project Documentation, Available on https://docs.zephyrproject.org/1.11.0/, 2018
  4. H. Kim, H. Cha, "Towards a Resilient Operating System for Wireless Sensor Networks," Proceedings of the 2006 USENIX Annual Technical Conference, pp. 103-108, 2006.
  5. K. Kim, I. Lee, "An Implementation of Mondriaan Memory Protection," Proceedings of the KISS 2006 Fall Conference, Vol. 33, No. 2, pp. 276-280, 2006 (in Korean).
  6. E. Kim, J. Lim, B. Ko, D. Shin, "Separation of Kernel Space and User Space in Zephyr Kernel," Proceedings of the Conference of Institute of Embedded Engineering of Korea 2017, Vol. 1, No. 1, pp. 353-356, 2017 (in Korean).
  7. ARM, ARMv7-M Architecture Reference Manual, ARM DDI 0403E.b, 2014.
  8. ARM, ARM Cortex-M4 Processor Technical Reference Manual, Revision: r0p1, ARM 100166_0001_00_en, 2015.
  9. J. Yiu, The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors, 3rd Edition, Elsevier Inc., 2014.
  10. NXP, FRDM-K64F Freedom Module User's Guide Rev 1, FRDMK64FUG, 2016.
  11. NXP, K64 Sub-Family Reference Manual, Rev 2, 2014.
  12. NXP, Kinetis K64F Sub-Family Data Sheet, Rev. 6, 2015.
  13. ARM, Procedure Call Standard for the ARM Architecture, ARM IHI0042F, 2015.