next up previous contents index
Next: 6.17.1 osenv_timer_init: Initialize the Up: 6 OSKit Device Driver Previous: 6.16.3 osenv_wakeup: wake up

6.17 Driver-Kernel Interface: Timing

The device support code relies on the OS to provide timers to control events. Unfortunately, timers are in a state of flux, and there are currently too many ways to do almost the same thing. We will be cleaning this up.

Meanwhile... the interface provided by the host OS is currently at the osenv_timer layer. However, we plan on moving the abstraction layer down to a simple ``PIT'' interface. (The existing osenv_timer_pit code is similar to the planned interface).

When we move to an osenv_pit interface, the driver glue code will use an intermediate timer `device driver' which will provide the higher-level functionality currently in the osenv_timer interface. The motivation for this is to make the OS-provided interface as simple as possible and to build extra functionality on top.

dev/clock.c is an example device driver built on the osenv_timer interface. It could be implemented on top of an osenv_pit interface as easily as on the osenv_timer interface.

The current implementation of the default osenv_timer code is based on the osenv_timer_pit interface. osenv_timer_pit is not currently defined as part of the osenv API, but merely exists for implementation convenience. However, over-riding the osenv_timer_pit implementation is probably the easiest way to provide a different implementation of the osenv_timer interface.

The default osenv_timer implementation also provides an osenv_timer_shutdown hook for use by the host operating system. osenv_timer_shutdown disables the osenv_timer.





University of Utah Flux Research Group