Is there any method to obtain real-world date and time in Genode?

Stefan Kalkowski stefan.kalkowski at ...1...
Thu Oct 23 11:31:21 CEST 2014


Hello,

On 10/21/2014 07:33 PM, 王硕 wrote:
> Dear Norman and all Genodians,

the Genode OS framework is neither Norman's exclusive project, nor
limited to the team working at Genode Labs, but at least meant as an
open source community project. Although, Norman and the team at Genode
Labs have the greatest influence on the project, and are mostly
competent contacts, with this mailing list you address *all* Genode
developers and enthusiasts. So _please_: avoid addressing people
personally in the first place.

> 
> I want to obtain‍ real-world date and time in Genode (base-foc), so
> would you like to tell me how to achieve it. Rtc is too slow, and Rdtsc‍
> can't obtain real time.

When you say RTC is too slow, what drift did you perceived?

Joking apart, your problem is a basic problem in computer science not
limited, or special with respect to Genode. I assume with "RTC is too
slow" you meant that reading the RTC every time you need a timestamp is
to expensive. If you look at existent systems like for instance Linux,
the problem is solved in the following way: Calendar time is read
exactly once while booting, and stored in a variable. From that on
another less expensive system timer is used to add periodically
wall-clock time to the initial time-stamp.

To break it down to your problem:

* Initially read the RTC time, as well as the RDTSC
* Whenever you want to read the current time, read the RDTSC, and add
the difference between the actual and the last RDTSC value to your
stored calendar time, and you are done

Regards
Stefan

> 
> ------------------
> 
> Shuo Wang,
> University of Chinese Academy of Sciences.
>  
> 
> 
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://p.sf.net/sfu/Zoho
> 
> 
> 
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

-- 
Stefan Kalkowski
Genode Labs

http://www.genode-labs.com/ · http://genode.org/




More information about the users mailing list