Hi Henrique,

> ...well, I have a Linux workstation here...I am trying to develop a real
> mode and real time prog that deals directly with the sound card...If was
> using DOS or Win95 I would not have any problems to just go coding right
> away and make my prog work fine...but since Linux has a HAL and its RTC
> provides at most 50-100Hz for the root user (AFAIK) I am pushed to hack
> into Linux (develop a kernel mode prog) or try to use DOSEMU....

 AFAIK the Enhanced RTC (compiletime option) gives you up to 8192Hz -

>From Documentation/Configure.help: <BLOCKQOUTE>
Enhanced Real Time Clock Support
CONFIG_RTC
Every PC has such a clock built in. It can be used to generate
signals from as low as 1Hz up to 8192Hz, and can also be used as a
24 hour alarm. It reports status information via the file /proc/rtc
</BLOCKQOUTE>

 If you're willing to recompile your kernel you can change the HZ #define to
increase the number of jiffies per second and use add_timer(). Lots of
caveats. Alessandro Rubini discusses this in his "Linux Device Drivers" just
to show it's possibly to increase the number of jiffies >= 50kHz, somewhere
around page 145. (I don't have it handy right now; today's midsummer, _the_
major pagan festival here.)

 Even kernel mode interrupt handlers get pretty high interrupt latencies
<insert handy reference which I can't find right now> (1k-3k clocks) so you
might want to look at one of them RT kernel variant or go with polling code.
If you do decide to use interrupts you'll better time your samples using
either gettimeofday() or the RDTSC ins. and resample to your wanted HZ
(easy).

 Running dosemu doesn't change any of this nor can it take away the HAL.


//Bj�rnen.

Reply via email to