mercredi 28 décembre 2016

Unit testing embedded driver without modifying it's code

What is the best approach under linux to compile natively and unit test a device driver that for example writes to arbitrary memory locations when it talks to the hardware?

The approach I have tried so far is to just mmap the memory (even address 0x0 works) and just monitor it using a separate thread for changes. This works as far as building the driver natively and having it write to what it thinks is io memory. However I'm not quite sure how to go about doing synchronization between my hardware simulator thread that responds to the memory changes and the device driver. My approach so far is kindof nondeterministic.

I would prefer a solution that runs natively and enables me to test how the driver interacts with hardware by using another thread that can simulate various hardware faults.

What other options do I have?

Aucun commentaire:

Enregistrer un commentaire