toaruos icon indicating copy to clipboard operation
toaruos copied to clipboard

Can we fix the clock in bochs?

Open klange opened this issue 1 year ago • 1 comments

On x86-64, Misaka uses use of the TSC as the sole clock source. Bochs, no matter how it's configured, does not provide the consistent TSC we need for this to make sense - the TSC remains tied to actual instruction cycles, so the passage of time can vary wildly depending on workload. Further, the initial timing of the TSC to wall clock is nearly random.

Linux, however, supports multiple clock sources, so if one is determined to be inaccurate or unusable, things can fall back to another. We could take a similar approach and provide alternative clock sources that are more likely to provide consistent timing information under Bochs, while still keeping the TSC for more normal circumstances.

klange avatar Sep 01 '22 01:09 klange

Bochs has support for the CMOS RTC and PIT clocks. Is it possible to maybe harness those?

lovemeforareason avatar Oct 14 '22 13:10 lovemeforareason