Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Can we fix the clock in bochs? #256

Open
klange opened this issue Sep 1, 2022 · 1 comment
Open

Can we fix the clock in bochs? #256

klange opened this issue Sep 1, 2022 · 1 comment

Comments

@klange
Copy link
Owner

klange commented Sep 1, 2022

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.

@lovemeforareason
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants