Re: [NTLK] It is the Fix

From: Andrei Chichak <newton_at_chichak.ca>
Date: Sat Jan 03 2009 - 17:48:47 EST

At 12:39 PM 1/3/2009, you wrote:
>Just caught this on MacObserver:
>"Previously, TMO and others reported on the Leap Year bug that caused
>Microsoft Zune's to freeze up on December 31. At first, one would
>think to blame Microsoft programmers, but Graham Cluley dug deeper and
>found that the problem can be traced to the clock chip from
>Freescale."

I took a look at Freescale's documentation:
http://www.freescale.com/files/rf_if/doc/ref_manual/MC13783IGPLDRM.pdf?fpsp=1&WT_TYPE=Reference%20Manuals&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation.

The clock chip is fed by a 32767 hertz crystal (very common, most of
you digital watch people have one attached to your arm). They divide
down the crystal to get a 1 hertz timing signal. A counter counts up
that timing signal to 86,399 ( there are 86400 seconds in a day) then
increments the day counter.

microsoft assumes the day counter counts so that 0 is January 1st
1980, which was a Tuesday (right from their own code http://pastie.org/349916).

When accessing the clock, you can ask for the value of the day counter. DUH!!!

They then calculate todays date from how many days we are from
January 1, 1980. (Why they didn't use 2000 I have no clue). All
inferences to months, days, dates, and years are done in software.

So, Freescale hardware problem? I don't bloody think so. The clock
chip handles each day is the same, it doesn't know about months,
years, leapyears and the sort. It just knows how to increment.

As a software professional, the blame goes to microsoft.

Andrei

------------------------------
Andrei Chichak

Systems Developer
CBF Systems
Suite 4-038
11421 Saskatchewan Drive
Edmonton, Alberta
Canada T6G 2M9
V: (780) 628-2072
F: (780) 628-5542

====================================================================
The NewtonTalk Mailing List - http://www.newtontalk.net/
The Official Newton FAQ - http://www.splorp.com/newton/faq/
The Newton Glossary - http://www.splorp.com/newton/glossary/
WikiWikiNewt - http://tools.unna.org/wikiwikinewt/
====================================================================
Received on Sat Jan 3 17:49:38 2009

This archive was generated by hypermail 2.1.8 : Sat Jan 03 2009 - 18:30:00 EST