APIC Timer: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m is
Brendan (talk | contribs)
Line 26: Line 26:


== Enabling APIC Timer ==
== Enabling APIC Timer ==

* First you have to enable the [[APIC#Local_APIC_configuration|Local APIC]] hardware by writing it's MSR.
Before enabling the local APIC timer, you should setup the rest of the local APIC. This includes:
* After that, you have to specify a spurious interrupt and software enable the APIC (this step is necessary).

* Finally, you specify APIC timer interrupt number and operation mode.
* Determine the local APIC's physical address (via. ACPI tables or MultiProcessor Specification tables)
You can find more detailed information in Intel manual vol3A Chapter 9.
* Specify a spurious interrupt and software enable the APIC
* Make sure the TPR (Task Priority Register) is set (so it won't block/postpone lower priority IRQs)

Once that's done:

* Set the local APIC timer's divide configuration register
* Configure the local APIC timer's interrupt vector and unmask the timer's IRQ
* Set the local APIC timer's initial count

Note: It's recommended to follow the order given above (especially setting the local APIC timer's initial count last). Doing things in a different order (e.g. setting the initial count, then enabling the timer) can lead to problems on some (real or virtual) machines (e.g. everything seems right and counter is decreasing, but IRQ is never sent).


== Initializing ==
== Initializing ==