Skip to content

Commit

Permalink
Kernel: Fix APIC timer frequency
Browse files Browse the repository at this point in the history
The APIC current count register decrements on each clock tick.
Fixes the APIC timer firing much less frequently than it should be.
  • Loading branch information
tomuta authored and awesomekling committed Oct 29, 2020
1 parent 3fa0b88 commit d076b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Time/APICTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bool APICTimer::calibrate(HardwareTimerBase& calibration_source)

disable_local_timer();

auto delta_apic_count = end_apic_count - start_apic_count;
auto delta_apic_count = start_apic_count - end_apic_count; // The APIC current count register decrements!
m_timer_period = (delta_apic_count * apic.get_timer_divisor()) / ticks_in_100ms;

auto apic_freq = (delta_apic_count * apic.get_timer_divisor()) / apic.get_timer_divisor();
Expand Down

0 comments on commit d076b00

Please sign in to comment.