summaryrefslogtreecommitdiff
path: root/kernel/src/arch/i686/idt.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/arch/i686/idt.c')
-rw-r--r--kernel/src/arch/i686/idt.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/kernel/src/arch/i686/idt.c b/kernel/src/arch/i686/idt.c
index 04fd5f8..3ec32b0 100644
--- a/kernel/src/arch/i686/idt.c
+++ b/kernel/src/arch/i686/idt.c
@@ -2,7 +2,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <sys.h>
+#include <arch.h>
#include <print.h>
#include <panic.h>
#include <arch/i686/pic.h>
@@ -10,8 +10,7 @@
#include <time.h>
#include <drivers/ps2kb.h>
#include <drivers/ps2mouse.h>
-
-#include "tty/term.h"
+#include <arch/i686/asm.h>
struct IdtEntry {
uint16_t isr_low;
@@ -41,31 +40,18 @@ enum IDTFlags {
IDT_FLAG_PRESENT = 0x80,
};
-#define WIDTH 30
-static char buf[WIDTH];
-static int timer = -1;
+static size_t timer = 0;
void idt_pic_eoi(uint8_t exception) {
pic_eoi(exception - PIC_REMAP_OFFSET);
}
void idt_pic_timer(void) {
-
timer += 1;
- if (timer % 20 != 0) return;
-
- uint32_t state = term_save();
-
- term_setfg(VGA_LIGHT_GREEN);
- term_setpos(TERM_W - WIDTH - 1, 0);
- for (size_t i = 0; i < WIDTH; i++) putchar(' ');
- term_setpos(TERM_W - WIDTH - 1, 0);
-
- struct Time t = get_localtime();
- timetostr(&t, "%a %b %d %Y %H:%M:%S", buf, WIDTH);
- printk("%s", buf);
+}
- term_load(state);
+size_t get_systemtime(void) {
+ return timer;
}
void idt_pic_keyboard(void) {