POK(kernelpart)
pit.h File Reference

Go to the source code of this file.

Functions

pok_ret_t pok_x86_qemu_timer_init ()

Function Documentation

pok_ret_t pok_x86_qemu_timer_init ( )

Definition at line 40 of file pit.c.

{
uint16_t pit_freq;
pit_freq = POK_TIMER_FREQUENCY;
outb (PIT_BASE + 3, 0x34); /* Channel0, rate generator, Set LSB then MSB */
outb (PIT_BASE, (OSCILLATOR_RATE / pit_freq) & 0xff);
outb (PIT_BASE, ((OSCILLATOR_RATE / pit_freq) >> 8) & 0xff);
pok_bsp_irq_register (PIT_IRQ, pit_interrupt);
return (POK_ERRNO_OK);
}