RTC day of week

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
xenos

RTC day of week

Post by xenos »

Many CMOS maps say that 06h contains day of week, valued from 1 to 7 where 1 means sunday. However, _my_ computer does not work this way and even bochs does something different. Has anyone else encountered this problem, or even solved it?
Stefan

RE:RTC day of week

Post by Stefan »

It is true, CMOS 06h contains the day of week, but since the weekday is updated independently of the time, it is bound to be inaccurate. Any other value in the register (besides 1-7) tells the RTC "don't keep track of the day of week". On most computers, CMOS 06h is set to 0. It would definitly be wise to compute the weekday yourself... I seem to recall John Horton Conway (of Game of Life fame) created a good weekday algorithim, (begin (google-search "Conway" "Doomsday Algorithm") (exit 0)).
Just curious: Why did Intel/IBM of all people use a Motorola RTC chip on their PC/AT+ motherboards?
Post Reply