[nos-bbs] Update - Timer issues in JNOS

Barry k2mf at ptd.net
Wed Aug 4 15:15:30 EDT 2010


On Wed, 4 Aug 2010 13:45:08 -0500 (CDT), Maiko Langelaar <maiko at pcs.mb.ca>
wrote:

> Skip,
> 
> > it seems to me that DOS users have not chimed in ...
> 
> Funny you mention DOS, the code (pc.c) CLEARLY talks about 24.85 days
> before the timer stuff goes 'negative'. The repair for it was to use
> the longmul() and longdiv() functions for DOS only.
> 
>       /* old way: return Clock * MSPTICK / 1000L; */
>       /* new way: We use longmul() and longdiv() routines since
>        * Clock * MSPTICK exceeds 2^31 in about 24.85 days and
>        * becomes negative. And, we also get better accuracy.  (Selcuk)
>        */
> 
> BUT, I think they would have found that the timers would have gone
haywire
> anyways even with that fix, but perhaps sometime after 50 days or so.
> 
>          /* old way: return Clock * MSPTICK / 1000L; */
>          /* new way: We use longmul() and longdiv() routines since
>           * Clock * MSPTICK exceeds 2^31 in about 24.85 days and
>           * becomes negative. And, we also get better accuracy.  (Selcuk)
> 
> 
> Would be interesting if any DOS users (or Barry) can comment on that.
> 
> Maiko Langelaar / VE4KLM

I have been out of the NOS game for over a year now, however, my
recollection is that at one point I went through the entire code
set and changed every 16- and 32-bit integer to unsigned wherever
possible, including in the timer routines.  I remember there was one
working variable that I could NOT change because when I did, it broke
the timer functions.  Doing this *seemed* to improve many things in
NOS, including in the timers, but I couldn't swear by it.

I'm sorry I can't be of any further help.

-- 
73, de Barry, K2MF >>
k2mf at ptd.net




More information about the nos-bbs mailing list