High Precision Event Timer Driver

The High Precision Event Timer is a hardware timer used in personal computers. It was developed jointly by Intel and Microsoft and has been incorporated in PC chipsets since circa 2005. Formerly referred to by Intel as a Multimedia Timer, the term HPET was selected to avoid confusion with the multimedia timers software feature introduced in the MultiMedia Extensions to Windows 3.0.

Older operating systems do not support HPET and can only use older timing facilities, such as the programmable interval timer or the real-time clock.

An HPET chip consists of a 10 MHz 64-bit up-counter and 3 independent 64-bit comparators as in the programmable interval timer and Intel 8253. The HPET chip also includes 29 additional 32-bit comparators/timers for random interrupt generation for user software. However, some operating systems fail to configure these interrupts on user software interrupt routines even on systems with multicore CPUs.

The HPET 32/64-bit extended parts can only be reached through memory mapped I/O that is set up by the BIOS via ACPI. There can be at most 8 HPET chips on a motherboard. PCs with FSB and DDR-RAM need 2 HPET chips. That means modern PCs have 6 8253-compatible counters/comparators and 58 of the 32-bit HPETs/comparators, for 64 interrupt-capable timers in all.

Each comparator/timer can generate an interrupt when the least significant bits are equal to the corresponding bits of the 64-bit counter value. The comparators/timers can be put into one-shot mode or periodic mode. In one-shot mode the timer fires an interrupt once when the main counter reaches the value stored in the comparator's register, while in the periodic mode the interrupts are generated at specified intervals.

The HPET circuit in modern PCs is integrated into the northbridge chip. On these systems the HPET is running much more quickly, at 100 MHz or above.

HPET is meant to supplement and replace the 8254 programmable interval timer and the RTC's periodic interrupt function. Compared to these older timer circuits, the HPET has higher frequency (at least 10 MHz) and wider 64-bit counters (although they can be driven in 32-bit mode).

While 8254 and RTC can, similarly to HPET, be put in one-shot mode, the set-up process is so slow that their one-shot mode is not used in practice for tasks requiring precise scheduling. Instead, 8254 and RTC are typically used in periodic mode with very small time interval. For example, if an application needs to perform several short (some milliseconds, perhaps) waits, it is better to have a periodic timer running constantly with 1 ms period because of the high setup cost of an 8254 or RTC one-shot timer. This causes an interrupt on every millisecond even if the application needs to do actual work less frequently. With HPET, the extra interrupts can be avoided, because the set-up cost of a HPET one-shot timer is considerably smaller.

Operating systems designed before HPET existed cannot use HPET, so work only on hardware that has other timer facilities. Newer operating systems tend to be able to use either. Some hardware has both.

The following operating systems are known not to be able to use HPET: Windows XP, Windows Server 2003, and earlier Windows versions, Linux kernels prior to 2.6.

The following operating systems are known to be able to use HPET: Windows Vista, Windows 2008, Windows 7, x86 based versions of Mac OS X, Linux operating systems using the 2.6 kernel, FreeBSD and OpenSolaris.

Download: