[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Usinger high resolution timers in simulated device

From: Weiss, Howard
Subject: Usinger high resolution timers in simulated device
Date: Tue, 9 Feb 2021 21:23:09 +0000

I am created a simulated device to test a Windows device driver.  The simulated device runs under Linux. I use QEMU to create a Windows 10 virtual machine in which I run the device driver


In the simulated device, I need a timer which interrupts my device driver every 8.3 ms.  I have patterned my timer on the high resolution timer

to be found at https://www.softprayog.in/tutorials/alarm-sleep-and-high-resolution-timers.  This example sets up two timers – one timer which runs at a specific interval and a second timer which expires some number of seconds after it starts.  The program starts both timers and then performs a sigwait on the second timer.  The example ends after the second timer is signaled.


In my case, I created another task and which I started on a separate thread.  I removed the exit at the end of the thread.  I observed that my application terminated at the point where the second thread was signaled.   I observe that if I add a printf after the signal, it never happens.  I tried substituting SIGRTMAX for SIGRTMIN.  My application terminates regardless.


Why would this be. I theorize that QEMU is using the signalling mechanism and I am unknowningly setting a signal which causes QEMU to terminate. 

Is there a correct way to do this?


Howard Weiss

reply via email to

[Prev in Thread] Current Thread [Next in Thread]