1

Initial commit

This commit is contained in:
2023-02-26 21:12:51 +01:00
commit d2ec37332f
69 changed files with 58831 additions and 0 deletions

View File

@ -0,0 +1,11 @@
// Excerpt from the ApicTimer::calibrate function
uint32_t ApicTimer::calibrate() {
// Start the timer with a large counter
LocalApic::writeDoubleWord(LocalApic::TIMER_INITIAL, 0xFFFFFFFF);
// Wait a little
Pit::earlyDelay(10'000);
// Calculate how often the timer ticked in one millisecond
return (0xFFFFFFFF - LocalApic::readDoubleWord(LocalApic::TIMER_CURRENT)) / 10;
}