mirror of https://github.com/tailix/kernel.git
Use PIT driver from libkernaux
This commit is contained in:
parent
67fec262e9
commit
758554dd88
|
@ -2,19 +2,12 @@
|
|||
|
||||
#include <kernaux/asm/i386.h>
|
||||
#include <kernaux/drivers/console.h>
|
||||
#include <kernaux/drivers/intel_8253_pit.h>
|
||||
|
||||
void timer_initialize(unsigned int frequency)
|
||||
{
|
||||
kernaux_drivers_console_print("[INFO] timer: Initialize timer.\n");
|
||||
|
||||
const unsigned int divisor = 1193180 / frequency;
|
||||
|
||||
const unsigned char l = divisor & 0xFF;
|
||||
const unsigned char h = (divisor >> 8) & 0xFF;
|
||||
|
||||
kernaux_asm_i386_outportb(0x43, 0x36);
|
||||
kernaux_asm_i386_outportb(0x40, l);
|
||||
kernaux_asm_i386_outportb(0x40, h);
|
||||
kernaux_drivers_intel_8253_pit_initialize(frequency);
|
||||
}
|
||||
|
||||
void timer_register_handler(timer_handler_t handler)
|
||||
|
|
Loading…
Reference in New Issue