MonkOS  v0.1
A simple 64-bit operating system (x86_64)
timer.h File Reference

Programmable interval timer (8253/8254) controller. More...

#include <core.h>

Go to the source code of this file.

Functions

void timer_init (uint32_t frequency)
 Initialize the timer controller so that it interrupts the kernel at the requested frequency. More...
 
void timer_enable ()
 Enable timer interrupts. More...
 
void timer_disable ()
 Disable timer interrupts. More...
 

Detailed Description

Programmable interval timer (8253/8254) controller.

Definition in file timer.h.

Function Documentation

void timer_init ( uint32_t  frequency)

Initialize the timer controller so that it interrupts the kernel at the requested frequency.

Interrupts are enabled at the end of the function, so timer_enable does not need to be called after timer_init.

Due to the clock granularity (1193181Hz), the requested frequency may not be perfectly met.

Parameters
[in]frequencyThe interrupt frequency in Hz. Clamped to the range [19:1193181].

Definition at line 37 of file timer.c.

Referenced by kmain().

void timer_enable ( )

Enable timer interrupts.

Definition at line 65 of file timer.c.

void timer_disable ( )

Disable timer interrupts.

Definition at line 72 of file timer.c.