Following the interrupt, the process can read a long On read(2)Īnd select(2) the calling process is blocked until the next interrupt from that RTC is received. The /dev/rtc (or /dev/rtc0, /dev/rtc1, etc.) device can be opened only once (until it is closed) and it is read-only. On some systems, the battery backed RTC can't issue interrupts, but another one can. Which can resume the system from a low power state such as Suspend-to-RAM (STR, called S3 in ACPI systems), Hibernation (called S4 in ACPI systems), or even On many systems, the alarm interrupt can be configured as a system wakeup event, On reaching a previously specified alarm time.Įach of those interrupt sources can be enabled or disabled separately. On every clock update (i.e., once per second) Īt periodic intervals with a frequency that can be set to any power-of-2 multiple in the range 2 Hz to 8192 Hz RTC functionality RTCs can be read and written with hwclock(8), or directly with the ioctl requests listed below.īesides tracking the date and time, many RTCs can also generate interrupts Using another clock, maybe across the network or by entering that data manually. Systems without an RTC need to set the system clock So at boot time, and after resuming fromĪ system low power state, the system clock will often be set to the current wall clock time using an RTC. Until it is initialized, the system clock can only report time since system boot. It is supposed to report wall clock time, which RTCs also do.Ī key difference between an RTC and the system clock is that RTCs run even when the system is in a low power state (including "off"), and the system clockĬan't. (One common implementation counts timer interrupts, once per "jiffy", at a frequency of 100, 250, or 1000 Hz.) That is, The system clock reports seconds and microseconds since a start point, defined to be the POSIXĮpoch: 00:00:00 +0000 (UTC). Time(2), as well as setting timestamps on files, etc. RTC vs system clock RTCs should not be confused with the system clock, which is a software clock maintained by the kernel and used to implement gettimeofday(2) and They usually won't offer the same functionality Non-PC systems, such as embedded systems built around system-on-chip processors, use other implementations. Integrated into the mainboard's chipset (south bridge), and uses a replaceable coin-sized backup battery. RTCs often provide alarms and other interrupts.Īll i386 PCs, and ACPI-based systems, have an RTC that is compatible with the Motorola MC146818 chip on the original PC/AT. Has battery backup power so that it tracks the time even while the computer is turned off. These are called "Real Time Clocks" (RTCs). Most computers have one or more hardware clocks which record the current "wall clock" time. This is the interface to drivers for real-time clocks (RTCs).
0 Comments
Leave a Reply. |