lkml.org 
[lkml]   [2013]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectadjusting the monotonic system time (from inside the kernel)
Hello,

I'm looking at how to adjust the (monotonic) system time from inside the
kernel.

Use case is that I have a hw-clock which (not necessarily) regulary
sends a timestamp with millisecond precision which I want to use to
adjust the system time.

It seems the usual solution to do such, is to use NTP which uses it's
own driver (which usually seems to be based on some serial connection):

hw-clock --serial--> kernel --serial-device--> ntpd -> kernel -> system-time

So one solution would be to emulate such a serial device:

hw-clock --> kernel --emulated-serial-device--> ntpd -> kernel ->
system-time

Another solution would be to "invent" a ntp-device and write a driver
for ntpd to use it:

hw-clock --> kernel --ntp-device--> ntpd -> kernel -> system-time

But I would prefer the following:

hw-clock --> kernel -> system-time

Problem is that the hw-clock in question doesn't offer something like a
tick. It just might send a timestamp with millisecond precision whenever
it wants.

Because I don't want to reinvent the wheel and because I think there are
some people which already have spend some thoughts on similiar things,
I'm asking here before I try to implement something which then never
might find it's way into the mainline kernel.

Any hints, suggestions, whatever?

Regards,

Alexander Holler


\
 
 \ /
  Last update: 2013-05-06 16:42    [W:0.039 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site