- Uint8 val;
-
- Log_Log("Timer", "RTC Timer firing at %iHz (%i divisor), %i.0x%08x",
- TIMER_FREQ, TIMER_RATE, MS_PER_TICK_WHOLE, MS_PER_TICK_FRACT);
-
- outb(0x70, inb(0x70)&0x7F); // Disable NMIs
- __asm__ __volatile__ ("cli"); // Disable normal interrupts
-
- // Set IRQ8 firing rate
- outb(0x70, 0x0A); // Set the index to register A
- val = inb(0x71); // Get the current value of register A
- outb(0x70, 0x0A); // Reset index to A
- val &= 0xF0;
- val |= TIMER_RATE;
- outb(0x71, val); // Update the timer rate
-
- // Enable IRQ8
- outb(0x70, 0x0B); // Set the index to register B
- val = inb(0x71); // Read the current value of register B
- outb(0x70, 0x0B); // Set the index again (a read will reset the index to register D)
- outb(0x71, val | 0x40); // Write the previous value or'd with 0x40. This turns on bit 6 of register D
-
- __asm__ __volatile__ ("sti"); // Re-enable normal interrupts
- outb(0x70, inb(0x70)|0x80); // Re-enable NMIs
-
- // Install IRQ Handler
- IRQ_AddHandler(8, Time_Interrupt);
-
- // Make sure the RTC actually fires
- outb(0x70, 0x0C); // Select register C
- inb(0x71); // Just throw away contents.
+ Log_Log("Timer", "PIT Timer firing at %iHz, %i.0x%08x miliseconds per tick",
+ TIMER_FREQ, MS_PER_TICK_WHOLE, MS_PER_TICK_FRACT);
+
+ // TODO: Read time from RTC