I am directly reading/writing the RTC through the port 0x70 and 0x71. As per the manual the weekday byte will hold the day of the week with Sunday=1 and values range from 1 to 7. When I read the byte I get today 4, that is Wednesday. Whereas when i read the RTC information with hwclock -r
the day is Thursday, which is correct.
Setting the date using hwclock
to other date and reading it with my code doesn't reflect the change in the weekday byte.
This problem persists in all systems. What can be the problem?