RTC: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m →‎IRQ Danger: repair one more link
Line 86: Line 86:
The RTC is capable of producing a periodic interrupt (what this article describes), an update ended interrupt, and an alarm interrupt. If you are only using the RTC as a simple timer this is not important.
The RTC is capable of producing a periodic interrupt (what this article describes), an update ended interrupt, and an alarm interrupt. If you are only using the RTC as a simple timer this is not important.
'''What is important is that if register C is not read after an IRQ 8, then the interrupt will not happen again.''' So, even if you don't care about what type of interrupt
'''What is important is that if register C is not read after an IRQ 8, then the interrupt will not happen again.''' So, even if you don't care about what type of interrupt
it is, just attach this code to the bottom of your IRQ handler to be sure you get another interrupt. If you're using Bochs, it is also recommended to read Status Register C after initialising the RTC, to make sure any RTC interrupts that were pending before/while the RTC was initialised are acknowledged (not doing this has lead to the RTC timer not sending any interrupts after rebooting in at least one case, observed on Bochs 2.6.6, [http://forum.osdev.org/viewtopic.php?f=1&t=30091 see this thread]).
it is, just attach this code to the bottom of your IRQ handler to be sure you get another interrupt.


<pre>
<pre>
Line 92: Line 92:
inportb(0x71); // just throw away contents
inportb(0x71); // just throw away contents
</pre>
</pre>



==Possible Uses==
==Possible Uses==