On Fri, Aug 26, 2011 at 1:21 AM, विदुर <[email protected]> wrote: > Hi Manish jee, > I am looking how the function in the software clock reads the clock > tick and transfers it to seconds or hh:mm:ss information. > Actually its a part in my academic project where a part of my problem > is to fit time information ( just 24 hours time But not the unique > timestamp with all year, month, day, ... ) and a random number > value(ranging up to 100) within 2 bytes of storage. The time_t > requires 32 bits or longer space so I cannot use this. And since I am > dealing with just 24 hours time I hope that it will not require all > the 32 bits for storing it. Therefore, I am interested in how the > clock ticks (clock_t) are read and transferred to seconds by the > system clock, so that i can understand how actually the information in > time_t is organized.
Hi Bidur, from what i know, there are two sources of time, one is the legacy chips in system's chipset (like rtc cmos) or the NTP server. historically, the rtc chip holds information like seconnds, minutes,hours, dayofweek,dayofmonth, month year. so at bootup linux kernel reads those chips (arch dependent) and converts and stores them in a structure similar to timeval. (seconds since epoch). for more details see kernel/time/timekeeping.c time_t is just an integer (32 or 64 bit). counting no of seconds since EPOCH. --------------------------------------------------------------- regards Manish Regmi http://manish-cs.blogspot.com http://ext2read.sf.net -- FOSS Nepal mailing list: [email protected] http://groups.google.com/group/foss-nepal To unsubscribe, e-mail: [email protected] Mailing List Guidelines: http://wiki.fossnepal.org/index.php?title=Mailing_List_Guidelines Community website: http://www.fossnepal.org/
