toaruos
toaruos copied to clipboard
Can we fix the clock in bochs?
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.
Bochs has support for the CMOS RTC and PIT clocks. Is it possible to maybe harness those?