Hello Tom,

> >> +    if ((unsigned)(GetBiosTime() - startTime) >= timeout * 18u)
> >> +      return 0xffff;
> >>    }
> >> +  while (r.flags & FLG_ZERO);
>
> >      This is not good way to calculate delays - around midnight (when system
> > timer will be reset) above expression will be calculated wrongly (because
> > GetBiosTime() will be lesser than startTime).
>
> bla. blubber. blabla.
>
> the original code reads:
>     if (GetBiosTime() - startTime > (unsigned)timeout * 18)
>        break;
>
> and now I want to get an example when this breaks.

Menu timeout set at 10 seconds. Boot kernel with menu at 23:59:55.
Timer expires at 00:00:00 (0-1.5M = very large number) instead of
00:00:05.

The (unsigned) cast for (GetBiosTime() - startTime) makes
absolutely no difference in this respect. Signed numbers won't help
either.

Bart



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to