Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!gitpyr!roy From: roy@gitpyr.gatech.EDU (Roy Mongiovi) Newsgroups: comp.sys.ibm.pc Subject: Re: Date does not change when PC is left on Message-ID: <2763@gitpyr.gatech.EDU> Date: Wed, 3-Dec-86 22:58:23 EST Article-I.D.: gitpyr.2763 Posted: Wed Dec 3 22:58:23 1986 Date-Received: Fri, 5-Dec-86 01:21:54 EST References: <289@rocky2.UUCP> <708@watmum.UUCP> Organization: Georgia Institute of Technology, Atlanta Lines: 32 Summary: A clear example of the sorts of bozos writing micro software The reason for the date not changing may be twofold. If you are using DOS 2.0, there is a bug, but first let me describe how it can happen on all PC's. When IBM designed the timer tick interrupt that keeps track of the time of day on the original PC (and hence, when they set the standard for everyone else), they did it in a really shoddy way. The BIOS keeps a count of the number of timer ticks since midnight. When the PC sees that the tick count has gone past the number of ticks in a day, it resets it to zero and sets a byte to one. This byte is a flag that says "the tick count has rolled over," not a count of the number of times it has rolled over. Now, in normal practice DOS reads the time from the BIOS, which return and clears the rollover flag, and notes that the date has changed. But if you leave your PC on for more than a day without causing DOS to access the date, the rollover count gets set to one twice (which of course doesn't help much), and a day is lost. Leave it on over the weekend, and two days are lost. The bug in 2.0 was that DOS would get the date and time whenever disk I/O occurred so that it could record the modification date/time of the file, and it would neglect to record the rollover flag. So if you happened to be accessing disk at midnight, the BIOS would clear the flag but DOS would ignore it, and a day would be immediately lost. Now ask me why IBM allocated an entire byte but didn't have the brains to increment it rather than just setting it to one.... Roy -- Roy J. Mongiovi Systems Analyst Office of Computing Services Georgia Institute of Technology Atlanta GA 30332. (404) 894-4660 ...!{akgua, allegra, amd, hplabs, ihnp4, masscomp, ut-ngp}!gatech!gitpyr!roy