Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.killfile.org!.POSTED!not-for-mail From: c28f62@TheWorld.com (Mark Kramer) Newsgroups: comp.os.linux.misc,comp.sys.raspberry-pi Subject: Re: Keeping 'order' without RTC. Date: Tue, 12 May 2015 17:45:19 +0000 (UTC) Organization: The World : www.TheWorld.com : Since 1989 Lines: 63 Message-ID: References: NNTP-Posting-Host: shell01.theworld.com X-Trace: flea.killfile.org 1431452719 17943 192.74.137.71 (12 May 2015 17:45:19 GMT) X-Complaints-To: news@usenet.killfile.org X-Newsreader: trn 4.0-test72 (19 April 1999) Xref: csiph.com comp.os.linux.misc:14773 In article , William Unruh wrote: >On 2015-05-12, Mark Kramer wrote: >> In article , >> William Unruh wrote: >>>On 2015-05-04, Mark Kramer wrote: >>>> The software clock is not an RTC. It counts interrupts. Yes, you can >>>> decode that count to a wallclock time, but that extra step is an extra >>>> step for a true RTC. >>> >>>Agreed. It counts "seconds" (well after it has been calibrated) >> >> No, it counts interrupts. The frequency of interrupts depends on the >> hardware. For old DOS on a PC, it was 18.2Hz. For some linuxes I've used, >> it is 1kHz. Some were, as I recall, 100Hz. > >Sheesh. You cannot read? ("well after it has been calibrated") You can "calibrate" it all you want, and you can look at it immediately after this "calibration" or well after it has been, but it still counts interrupts, not seconds. If your system clock has a 1Hz interrupt feeding it, you have a very odd and very unusual system. You agreed when I said it counted interrupts, and then claimed it counts seconds (after some nebulous "calibration" step that you didn't define.) The only "calibration" of the interrupt source I know of is when NTP determines the drift of that clock and attempts to correct for it. >> Since that counter can be set to any value, and is set by the time-setting >> commands, no, it isn't "at best" a simple counter of power-on ticks, it is >> "at best" a counter of some multiple of seconds since 1 Jan 1970 0000 GMT. > >The counter counts interrupts as you say ( or seconds ) Pick one and stay with it. The correct answer is it counts interrupts, which are NOT "seconds". >but unless you tell it what time it started You don't have to tell it what time it started. >it cannot do anything but count seconds >since the computer was turned on. That's not true. The old DOS "clock", for example, counted interrupts at a rate of 18.2Hz until that counter reached a predetermined value and then it was reset to 0. And the clocks on many of the linux systems I manage count milliseconds. The SGIs I have count nanoseconds in hardware as well as whatever the system clock interrupts are. >> Which the Pi does not have unless you've added that hardware. Otherwise, >> it is the job of the user, or of the NTP demon. > >Precisely. Then stop saying that the Pi has an RTC, and please stop pretending that the system clock it has counts "seconds" and not interrupts. >Since you know epoch you know what the real time is. No, I have a number that represents the number of seconds since a specified time. I still must convert that to a real time.