WIP - pit timer
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <stdint.h>
|
||||
#include <apic.h>
|
||||
|
||||
struct int_gate_descriptor
|
||||
{
|
||||
@@ -88,7 +89,7 @@ struct idtr
|
||||
|
||||
void pic_init();
|
||||
extern unsigned int irq_map[24];
|
||||
#define IRQ_INT(irq) (INT_IRQ0 + irq)
|
||||
#define IRQ_INT(irq) (INT_IRQ0 + IRQ(irq))
|
||||
#define IRQ(irq) (irq_map[irq])
|
||||
#define IRQ_MASK(irq) ioapic_mask(IRQ(irq))
|
||||
#define IRQ_UNMASK(irq) ioapic_unmask(IRQ(irq))
|
||||
|
||||
5
kernel/include/pit.h
Normal file
5
kernel/include/pit.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
void pit_delay(uint32_t ms);
|
||||
void pit_init();
|
||||
7
kernel/include/timer.h
Normal file
7
kernel/include/timer.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#define TICK_FREQ 1000
|
||||
|
||||
void pit_init();
|
||||
uint64_t get_ticks();
|
||||
Reference in New Issue
Block a user