From eb67b612c4bb0235d871b5b65134c816e8959728 Mon Sep 17 00:00:00 2001 From: fslongjin Date: Mon, 11 Jul 2022 10:56:24 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E6=9B=B4=E6=94=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B0=86=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将定时器独立出来 --- .vscode/settings.json | 3 +- kernel/Makefile | 6 +-- kernel/driver/timers/HPET/HPET.c | 12 +++-- kernel/driver/video/video.c | 2 +- kernel/main.c | 73 +------------------------- kernel/time/Makefile | 10 ++++ kernel/{driver/timers => time}/timer.c | 0 kernel/{driver/timers => time}/timer.h | 4 +- 8 files changed, 27 insertions(+), 83 deletions(-) create mode 100644 kernel/time/Makefile rename kernel/{driver/timers => time}/timer.c (100%) rename kernel/{driver/timers => time}/timer.h (94%) diff --git a/.vscode/settings.json b/.vscode/settings.json index ac1b53cc..eb3723e9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -102,7 +102,8 @@ "wait_queue.h": "c", "stddef.h": "c", "spinlock.h": "c", - "stat.h": "c" + "stat.h": "c", + "video.h": "c" }, "C_Cpp.errorSquiggles": "Enabled", "esbonio.sphinx.confDir": "" diff --git a/kernel/Makefile b/kernel/Makefile index 653e2e6d..b06ebed3 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -18,7 +18,7 @@ LD_LIST := head.o OBJ_LIST := head.o -kernel_subdirs := common driver process debug filesystem +kernel_subdirs := common driver process debug filesystem time @@ -125,8 +125,6 @@ rtc.o: driver/timers/rtc/rtc.c HPET.o: driver/timers/HPET/HPET.c gcc $(CFLAGS) -c driver/timers/HPET/HPET.c -o driver/timers/HPET/HPET.o -timer.o: driver/timers/timer.c - gcc $(CFLAGS) -c driver/timers/timer.c -o driver/timers/timer.o OBJ_LIST += uart.o LD_LIST += driver/uart/uart.o @@ -156,7 +154,7 @@ all: kernel echo "Done." -kernel: head.o entry.o main.o printk.o trap.o mm.o slab.o irq.o pic.o sched.o syscall.o multiboot2.o cpu.o acpi.o ps2_keyboard.o ps2_mouse.o ata.o pci.o ahci.o smp.o apu_boot.o rtc.o HPET.o softirq.o timer.o $(OBJ_LIST) +kernel: head.o entry.o main.o printk.o trap.o mm.o slab.o irq.o pic.o sched.o syscall.o multiboot2.o cpu.o acpi.o ps2_keyboard.o ps2_mouse.o ata.o pci.o ahci.o smp.o apu_boot.o rtc.o HPET.o softirq.o $(OBJ_LIST) @list='$(kernel_subdirs)'; for subdir in $$list; do \ echo "make all in $$subdir";\ diff --git a/kernel/driver/timers/HPET/HPET.c b/kernel/driver/timers/HPET/HPET.c index 6ab3fb48..118b3c89 100644 --- a/kernel/driver/timers/HPET/HPET.c +++ b/kernel/driver/timers/HPET/HPET.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include