⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

calibrate_timer

Function calibrate_timer 

Source
pub fn calibrate_timer() -> KernelResult<u32>
Expand description

Calibrate the APIC timer frequency using the PIT (8254) as a reference.

Method: Configure the APIC timer in one-shot mode with a large initial count, then use the PIT to measure how many APIC ticks elapse in a known time period (10ms). From this, compute ticks-per-millisecond.

Must be called after init() and before start_timer().