Re: Device driver scheduling time

Richard Gooch (rgooch@atnf.csiro.au)
Tue, 3 Nov 1998 22:39:24 +1100


Andre M. Hedrick writes:
> On 2 Nov 1998, Claude Gamache wrote:
>
> >
> > Hi,
> >
> > I need to write a device driver that must send data to a device
> > every 8 milliseconds.
> >
> > Unless something changes, the device will not send me any interrupt to
> > wake my driver. With a timer (add_timer) the driver can only be
> > executed every 10 ms (Linux-i386). With Linux-Alpha, add_timer would
> > allowed the driver to be executed every 1 ms.
> >
> > For the moment, I re-schedule the driver with the scheduler
> > queue. This allows the driver to run approximatively 2 times per clock
> > tick, so every 5 ms. But this is rather coarse and yet not sufficient.
> >
> > So I was considering using the Real Time Clock to get interrupts at a
> > rate of 128 Hz (8 ms is 125 Hz, but the difference is acceptable).
> >
> > Is there any other way to achieve this ?
> > And are there any "dangers" for the system if I use the RTC ? (I'm
> > thinking about system time and others)
>
> Yep, but you have to let your mind run wild.........at least I found
> it to be a requirement........to achieve 33 micro-second stable
> interrupt servicing under SMP. The first problem is to see that the
> PC clock as a 56 millisecond granularity limit. After many wasted
> attempts.....I settled on the concept of a symbiotic device driver,
> but that required me to design and build a millisecond precision
> time-base (oh yeah, I am an astronomer) that was Y2(or nth)K stable.
> Then cascade a off with programable timer-counters that could extend
> the precision of the time-base to a 10 micro-second granularity.
> Ten (10) was a result of using 16-bit counters and stable ovenized
> OSCs with a base greater than 1MHz but less than 10MHz. Next design
> the ISA card to have decoupled address decoding and preferred would
> be a dual addressable card.

You may be interested in the clock distribution and event generation
hardware that the ATNF has designed. The clock generator is an ISA
card that can be synchronised to an external source (like a MASER or
GPS) and sends out time frame packets over a serial line every
millisecond.

The event generator cards contain a PLL and a 1 MHz clock. The time
frame from the clock generator is fed into these cards (one clock
generator services the entire observatory), and ensures
synchronisation of different event generators to within a
us. Propagation effects can also be compensated for. The event
generator contains a FIFO of timestamped events (written by the device
driver). This can be used (for example) to create a waveform with an
arbitrary mark-space ratio. When an event triggers you can get an
interrupt.

> You are now asking what is this idiot babbling about........
>
> The above mentioned card can be found at ::
> http://www.dyer.vanderbilt.edu/server/pcs/

Looks like fun.

I had a look at m3.gif. Looks like you suffer from light
pollution. Buy a gun, drive into town and shoot out all the
streetlights ;-)
What is your magnitude limit?

BTW: what are all the black spots over the image? Cosmic ants?
Artefact of the compression process?

> Those who need more than by word, I will be happy to send them a 2M+
> FITS file to tear appart.

Does it have a co-ordinate system in the header?

BTW: for the best tools to look at astronomical images, check out:
http://www.atnf.csiro.au/karma/

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/