On Wed, Jan 10, 2018 at 6:50 PM, Mike Larkin <mlar...@azathoth.net> wrote:
>> > My question is: Can OpenBSD be told initialize the software from the
>> > hardware clock again after the system is booted?

> This does occur on occasion; for example, when running an OpenBSD vmm(4)
> guest, vmd(8) will notify the guest to resynch the clock from the RTC
> after the host resumes from suspend/hibernate (actually, "any time
> the host clock varies from more than 5s since it was last read by vmd(8"),
> but that practically means "only during suspend/hibernate resumes").
>
> If the OP was looking for code to do this for whatever reason, it's done
> via vmmci(4).

In fact this is precisely the use case I had in mind, except for that
instead of inside vmm OpenBSD is running in Virtualbox on Mac OS. The
clock seems to drift randomly and is off significantly after
suspend/hibernate.

Following your hint at vmmci and looking at
https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pv/vmmci.c.diff?r1=1.2&r2=1.3&f=h
it looks like inittodr(9) would reinitialize the software clock.
However it seems to be available inside the kernel only. Is there no
way to do this from userland?

Thanks!

Reply via email to