Behavioural Analysis of an I2C Linux Driver

  • Authors:
  • Dragan Bošnački;Aad Mathijssen;Yaroslav S. Usenko

  • Affiliations:
  • Technische Universiteit Eindhoven, The Netherlands;Technische Universiteit Eindhoven, The Netherlands;Centrum Wiskunde en Informatica, Amsterdam, The Netherlands

  • Venue:
  • FMICS '09 Proceedings of the 14th International Workshop on Formal Methods for Industrial Critical Systems
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Introduction . Formal methods for the analysis of system behaviour offer solutions to problems with concurrency, such as race conditions and deadlocks.We employ two such methods that are presently most applied in industry: model checking and static analysis on a common case study to analyse the behaviour of a Linux driver for I2C (Inter-Integrated Circuit). An industrial client provided us with the source code of the driver for which it was known that it contained defects. Based on the code, some documentation, and feedback by the developers we extracted a model of the device driver. The model was checked using the mCRL2 toolset [3] and some potential defects were revealed which were later confirmed by the developers. The errors were caused by inconsistent use of routines for interrupt enabling and disabling, resulting in unprotected references to shared memory and calls to lower-level functions. In addition, we performed checks with UNO [4], a static analysis tool that works directly with the source code. We employed UNO to statically detect the errors that were found by the dynamic analysis in the model checking phase. Based on our findings, we modified the source code to avoid the discovered potential defects. Although some errors remained unsolved, an improvement was observed in the standard tests that were carried out with our fixed version.