Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw: Implement timekeeping #30

Closed
mato opened this issue Jun 15, 2015 · 2 comments
Closed

hw: Implement timekeeping #30

mato opened this issue Jun 15, 2015 · 2 comments
Labels

Comments

@mato
Copy link
Member

mato commented Jun 15, 2015

As reported by @talex5 while testing mirage-console on rumprun:

I also tested mirage-skeleton/console, which worked but ran rather fast (it's supposed to wait 1s between each print). Calling gettimeofday showed the clock running fast for some reason.

@anttikantee notes:

That's because when I wrote the platform, I didn't bother writing a clock driver, and just used "rtdsc" as an approximation.

@mato mato added the bug label Jun 15, 2015
@anttikantee
Copy link
Member

Well, hw clock can run slow too, depending on the speed of the CPU ;-)

The code is in platform/hw/arch/{i386,amd64}/machdep.c::bmk_cpu_clock_now()
(if someone looks at this at a later date, both have probably migrated to arch/x86)

mato added a commit that referenced this issue Jun 30, 2015
This is the first phase of addressing issue #30. We calibrate the TSC at
boot against the i8254 timer and calculate a scaleing factor for
monotonic time.
mato added a commit that referenced this issue Jul 3, 2015
This is the first phase of addressing issue #30. We calibrate the TSC at
boot against the i8254 timer and calculate a scaleing factor for
monotonic time.
@mato mato changed the title hw: Clock runs fast hw: Implement timekeeping Jul 3, 2015
@mato
Copy link
Member Author

mato commented Jul 3, 2015

Fixes for this have now been changed to master. Please test, and file issues for any problems encountered. See also full discussion at http://www.freelists.org/post/rumpkernel-users/Implement-timekeeping-for-rumprunhw-x86.

@mato mato closed this as completed Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants