Skip to main content

A Formal Modeling Approach for Portable Low-Level OS Functionality

  • Conference paper
  • First Online:
Software Engineering and Formal Methods (SEFM 2020)

Abstract

The increasing dependability requirements and hardware diversity of the Internet of Things (IoT) pose a challenge to developers. New approaches for software development that guarantee correct implementations will become indispensable. Specially for Real Time Operating Systems (RTOSs), automatic porting for all current and future devices will also be required. As part of our framework for embedded RTOS portability, based on formal methods and code generation, we present our approach to formally model low-level operating-system functionality using Event-B . We show the part of our RTOS model where the switch into the kernel and back to a task happens, and prove that the model is correct according to the specification. Hardware details are only introduced in late refinements, which allows us to reuse most of the RTOS model and proofs for several target platforms. As a proof of concept, we refine the generic model to two different architectures and prove safety and liveness properties of the models.

This work is partially supported by the TU Graz LEAD project “Dependable Internet of Things in Adverse Environments”.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Model artifact at https://figshare.com/s/0f262342284eada236f5. The relationship between refinements and levels can be found in the README file. Model elements are referenced as .

References

  1. Abrial, J.R.: Modeling in Event-B: System and Software Engineering, 1st edn. Cambridge University Press, New York (2010)

    Book  Google Scholar 

  2. Alkhammash, E.H., Butler, M.J., Cristea, C.: Modeling guidelines of FreeRTOS in Event-B. In: International Conference on Communication, Management and Information Technology, pp. 453–462. CRC Press (2017)

    Google Scholar 

  3. Baumann, C., Schwarz, O., Dam, M.: Compositional verification of security properties for embedded execution platforms. In: Kühne, U., Danger, J.L., Guilley, S. (eds.) 6th International Workshop on Security Proofs for Embedded Systems, PROOFS 2017. EPiC Series in Computing, vol. 49, pp. 1–16. EasyChair (2017). https://doi.org/10.29007/h4rv. https://easychair.org/publications/paper/wkpS

  4. Boano, C.A., Römer, K., Bloem, R., Witrisal, K., Baunach, M., Horn, M.: Dependability for the Internet of Things–from dependable networking in harsh environments to a holistic view on dependability. e & i Elektrotechnik und Informationstechnik 133(7), 304–309 (2016). https://doi.org/10.1007/s00502-016-0436-4

  5. Borghorst, H., Bieling, K., Spinkczyk, O.: Towards versatile models for contemporary hardware platforms. In: 12th Annual Workshop on Operating Systems Platforms for Embedded Real-Time Applications, OSPERT 2016, pp. 7–9, July 2016

    Google Scholar 

  6. Brandenburg, B.B.: The case of an opinionated, theory-oriented real-time operating system. In: NGOSCPS 2019, April 2019

    Google Scholar 

  7. Cheng, S., Woodcock, J., D’Souza, D.: Using formal reasoning on a model of tasks for FreeRTOS. Formal Aspects Comput. 27(1), 167–192 (2014). https://doi.org/10.1007/s00165-014-0308-9

    Article  MathSciNet  MATH  Google Scholar 

  8. Craig, I.D.: Formal Refinement for Operating System Kernels. Springer, London (2007). https://doi.org/10.1007/978-1-84628-967-5

    Book  MATH  Google Scholar 

  9. Craig, I.D.: Formal Models of Operating System Kernels, 1st edn. Springer, London (2010). https://doi.org/10.1007/978-1-84628-718-3

    Book  Google Scholar 

  10. Dalvandi, M., Butler, M., Rezazadeh, A., Salehi Fathabadi, A.: Verifiable code generation from scheduled Event-B models. In: Butler, M., Raschke, A., Hoang, T.S., Reichl, K. (eds.) ABZ 2018. LNCS, vol. 10817, pp. 234–248. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-91271-4_16

    Chapter  Google Scholar 

  11. Danmin, C., Yue, S., Zhiguo, C.: A formal specification in B of an operating system. Open Cybern. Syst. J. 9(1) (2015)

    Google Scholar 

  12. Dhote, S., Charjan, P., Phansekar, A., Hegde, A., Joshi, S., Joshi, J.: Using FPGA-SoC interface for low cost IoT based image processing. In: 2016 International Conference on Advances in Computing, Communications and Informatics (ICACCI), pp. 1963–1968, September 2016. https://doi.org/10.1109/ICACCI.2016.7732339

  13. Event-B: Event-B and the Rodin Platform. www.event-b.org

  14. Fathabadi, A.S., et al.: A model-based framework for software portability and verification in embedded power management systems. J. Syst. Archit. 82, 12–23 (2018). https://doi.org/10.1016/j.sysarc.2017.12.001. http://www.sciencedirect.com/science/article/pii/S1383762117305234

  15. Frühwirth, T., Krammer, L., Kastner, W.: Dependability demands and state of the art in the internet of things. In: 2015 IEEE 20th Conference on Emerging Technologies Factory Automation (ETFA), pp. 1–4, September 2015. https://doi.org/10.1109/ETFA.2015.7301592

  16. General Dynamics C4 Systems: The seL4 microkernel (2016). https://sel4.systems/. Accessed 05 Feb 2020

  17. Gomes, R.M., Baunach, M., Malenko, M., Ribeiro, L.B., Mauroner, F.: A co-designed RTOS and MCU concept for dynamically composed embedded systems. In: OSPERT 2017 (2017)

    Google Scholar 

  18. Gomes, T., Pinto, S., Gomes, T., Tavares, A., Cabral, J.: Towards an FPGA-based edge device for the Internet of Things. In: 2015 IEEE 20th Conference on Emerging Technologies Factory Automation (ETFA), pp. 1–4, September 2015. https://doi.org/10.1109/ETFA.2015.7301601

  19. Goranko, V., Galton, A.: Temporal logic. In: Zalta, E.N. (ed.) The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, Stanford University, winter 2015 edn. (2015). https://plato.stanford.edu/archives/win2015/entries/logic-temporal/

  20. Hahm, O., Baccelli, E., Petersen, H., Tsiftes, N.: Operating systems for low-end devices in the Internet of Things: a survey. IEEE Internet Things J. 3(5), 720–734 (2016). https://doi.org/10.1109/JIOT.2015.2505901

    Article  Google Scholar 

  21. Hu, J., Lu, E., Holland, D.A., Kawaguchi, M., Chong, S., Seltzer, M.I.: Trials and tribulations in synthesizing operating systems. In: Proceedings of the 10th Workshop on Programming Languages and Operating Systems, PLOS 2019, pp. 67–73. Association for Computing Machinery, New York (2019). https://doi.org/10.1145/3365137.3365401

  22. Texas Instruments: MSP430 ultra-low-power sensing and measurement MCUs (2019). http://www.ti.com/microcontrollers/msp430-ultra-low-power-mcus/overview/overview.html

  23. Jastram, M., Butler, P.M.: Rodin User’s Handbook: Covers Rodin vol. 2.8, USA (2014)

    Google Scholar 

  24. Klein, G., et al.: Comprehensive formal verification of an OS microkernel. ACM Trans. Comput. Syst. 32(1) (2014). https://doi.org/10.1145/2560537

  25. Lamport, L.: Proving the correctness of multiprocess programs. IEEE Trans. Softw. Eng. SE-3(2), 125–143 (1977). https://doi.org/10.1109/TSE.1977.229904

  26. Leuschel, M., Butler, M.: ProB: an automated analysis toolset for the B method. Int. J. Softw. Tools Technol. Transf. 10(2), 185–203 (2008). https://doi.org/10.1007/s10009-007-0063-9

  27. Manna, Z., Pnueli, A.: The Temporal Logic of Reactive and Concurrent Systems: Specification. Springer, New York (2012). https://doi.org/10.1007/978-1-4612-0931-7

    Book  MATH  Google Scholar 

  28. Méry, D.: Modelling by patterns for correct-by-construction process. In: Margaria, T., Steffen, B. (eds.) ISoLA 2018. LNCS, vol. 11244, pp. 399–423. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-03418-4_24

    Chapter  Google Scholar 

  29. Novikov, E., Zakharov, I.: Verification of operating system monolithic kernels without extensions. In: Margaria, T., Steffen, B. (eds.) ISoLA 2018. LNCS, vol. 11247, pp. 230–248. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-03427-6_19

    Chapter  Google Scholar 

  30. Pnueli, A.: The temporal logic of programs. In: 18th Annual Symposium on Foundations of Computer Science, SFCS 1977, pp. 46–57, October 1977. https://doi.org/10.1109/SFCS.1977.32

  31. Popp, M., Moreira, O., Yedema, W., Lindwer, M.: Automatic HAL generation for embedded multiprocessor systems. In: Proceedings of the 13th International Conference on Embedded Software, EMSOFT 2016, ACM, New York (2016). https://doi.org/10.1145/2968478.2968493

  32. RISC-V Foundation: RISC-V. https://riscv.org/

  33. Stoddart, B., Cansell, D., Zeyda, F.: Modelling and proof analysis of interrupt driven scheduling. In: Julliand, J., Kouchnarenko, O. (eds.) B 2007. LNCS, vol. 4355, pp. 155–170. Springer, Heidelberg (2006). https://doi.org/10.1007/11955757_14

    Chapter  Google Scholar 

  34. Su, W., Abrial, J.R., Pu, G., Fang, B.: Formal development of a real-time operating system memory manager. In: 2015 20th International Conference on Engineering of Complex Computer Systems (ICECCS). IEEE, December 2015. https://doi.org/10.1109/iceccs.2015.24

  35. Syeda, H.T., Klein, G.: Formal reasoning under cached address translation. J. Autom. Reason. 64, 911–945 (2020). https://doi.org/10.1007/s10817-019-09539-7

  36. Taivalsaari, A., Mikkonen, T.: A roadmap to the programmable world: software challenges in the IoT era. IEEE Softw. 34(1), 72–80 (2017). https://doi.org/10.1109/MS.2017.26

    Article  Google Scholar 

  37. Verhulst, E., Boute, R.T., Faria, J.M.S., Sputh, B., Mezhuyev, V.: Formal Development of a Network-Centric RTOS. Springer, Boston (2011). https://doi.org/10.1007/978-1-4419-9736-4

  38. Waterman, A., Asanović, K.: The RISC-V instruction set manual volume I: user-level ISA version 2.2, May 2017. https://riscv.org/specifications

  39. Waterman, A., Lee, Y., Avizienis, R., Patterson, D.A., Asanović, K.: The RISC-V instruction set manual volume II: privileged architecture version 1.7. Technical report UCB/EECS-2015-49, EECS Department, University of California, Berkeley, May 2015. http://www2.eecs.berkeley.edu/Pubs/TechRpts/2015/EECS-2015-49.html

  40. Wright, S.: Formal construction of instruction set architectures. Ph.D. thesis, University of Bristol (2009). http://www.cs.bris.ac.uk/Publications/Papers/2001121.pdf

  41. Wright, S.: Automatic generation of C from Event-B. In: Workshop on Integration of Model-Based Formal Methods and Tools, p. 14 (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Renata Martins Gomes .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Gomes, R.M., Aichernig, B., Baunach, M. (2020). A Formal Modeling Approach for Portable Low-Level OS Functionality. In: de Boer, F., Cerone, A. (eds) Software Engineering and Formal Methods. SEFM 2020. Lecture Notes in Computer Science(), vol 12310. Springer, Cham. https://doi.org/10.1007/978-3-030-58768-0_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-58768-0_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-58767-3

  • Online ISBN: 978-3-030-58768-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics