mirror of
https://github.com/tailix/kernel.git
synced 2025-07-31 22:00:58 -04:00
SOme refactoring
This commit is contained in:
parent
4f336e6cca
commit
95f73cb84a
1 changed files with 7 additions and 2 deletions
|
@ -7,7 +7,12 @@ void timer_initialize(unsigned int frequency)
|
|||
{
|
||||
logger_info("Initialize timer.");
|
||||
|
||||
const unsigned int divisor = 1193180 / frequency;
|
||||
|
||||
const unsigned char l = divisor & 0xFF;
|
||||
const unsigned char h = (divisor >> 8) & 0xFF;
|
||||
|
||||
outportb(0x43, 0x36);
|
||||
outportb(0x40, (1193180 / frequency) & 0xFF);
|
||||
outportb(0x40, (1193180 / frequency) >> 8);
|
||||
outportb(0x40, l);
|
||||
outportb(0x40, h);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue