Realtime clock issue [SOLVED]
Posted: Fri Jun 18, 2010 5:50 pm
Hi guys,
I'm adding calendar-date/time tracking to my clock driver (rather than just counting ticks). I'm working on grabbing the current date and time from the RTC. It mostly works, except for one odd thing. Note (in case it's relevant) that I'm testing with Bochs 2.4.5.
The one thing that's not working is this: If I read "Status Register B" by doing an outb 11 (address for this register) on port 0x70 and an inb on port 0x71, bit 2 is not set, indicating that the numbers returned if I read the time will not be in BCD. However they are, in fact, in BCD. For example at 37 minutes past the hour, I got 0x37 (55) rather than 0x25 (37). Why is the status register lying to me?
The info I got on this status register comes from my copy of "The Indepensible PC Hardware Book", which is somewhat out of date, but I don't imagine this has changed. The only thing I found in the wiki was that it may be in BCD, but it doesn't say how to check whether it's in BCD or not.
Any help would be appreciated!
Thanks,
Tyrel
I'm adding calendar-date/time tracking to my clock driver (rather than just counting ticks). I'm working on grabbing the current date and time from the RTC. It mostly works, except for one odd thing. Note (in case it's relevant) that I'm testing with Bochs 2.4.5.
The one thing that's not working is this: If I read "Status Register B" by doing an outb 11 (address for this register) on port 0x70 and an inb on port 0x71, bit 2 is not set, indicating that the numbers returned if I read the time will not be in BCD. However they are, in fact, in BCD. For example at 37 minutes past the hour, I got 0x37 (55) rather than 0x25 (37). Why is the status register lying to me?
The info I got on this status register comes from my copy of "The Indepensible PC Hardware Book", which is somewhat out of date, but I don't imagine this has changed. The only thing I found in the wiki was that it may be in BCD, but it doesn't say how to check whether it's in BCD or not.
Any help would be appreciated!
Thanks,
Tyrel