diff --git a/VKernel/Kernel/intr/idt.vp b/VKernel/Kernel/intr/idt.vp index 31b4ea2..ba571f0 100644 --- a/VKernel/Kernel/intr/idt.vp +++ b/VKernel/Kernel/intr/idt.vp @@ -201,8 +201,6 @@ def isr29_handler() -> t.CExport | t.CVoid: isrCommonhandler(29) def isr30_handler() -> t.CExport | t.CVoid: isrCommonhandler(30) def isr31_handler() -> t.CExport | t.CVoid: isrCommonhandler(31) def isr32_handler() -> t.CExport | t.CVoid: - # [DBG] 中断入口诊断:若打印 'T' 说明 IRQ0 到达 isr32(用后移除) - serial.puts("T") timer.timer_handler() def isr33_handler() -> t.CExport | t.CVoid: diff --git a/VKernel/Kernel/intr/isr.s b/VKernel/Kernel/intr/isr.s index 152a9f5..c03757f 100644 --- a/VKernel/Kernel/intr/isr.s +++ b/VKernel/Kernel/intr/isr.s @@ -16,9 +16,6 @@ isr_default: push rax push rdx - mov dx, 0x3F8 - mov al, 0x44 # [DBG] 'D' = 中断向量到默认处理(用后移除) - out dx, al mov al, 0x20 out 0xA0, al out 0x20, al diff --git a/VKernel/Kernel/main.vp b/VKernel/Kernel/main.vp index c74600d..7d17b4e 100644 --- a/VKernel/Kernel/main.vp +++ b/VKernel/Kernel/main.vp @@ -81,11 +81,6 @@ class ViperKernel: asm.sti() serial.puts("[main] sti done\n") - # [DBG] 软件触发向量 32:验证 IDT gate 是否生效(用后移除) - # 有 "T" → IDT 正常,问题在 PIT/PIC 硬件送达;无 "T" → IDT/lidt 问题 - c.Asm("int 0x20", op=[t.ASM_DESCR.CLOBBER_MEMORY]) - serial.puts("[main] int20 test done\n") - timer.timer_msleep(100) serial.puts("[main] msleep done\n") rtc.rtc_init() diff --git a/VKernel/Kernel/platform/pch/timer.vp b/VKernel/Kernel/platform/pch/timer.vp index ec7cac9..9b45895 100644 --- a/VKernel/Kernel/platform/pch/timer.vp +++ b/VKernel/Kernel/platform/pch/timer.vp @@ -1,7 +1,6 @@ import platform.pch.pic as pic import platform.pch.pit as pit import sched.sched as sched -import drivers.serial.uart.serial as serial import asm import t, c @@ -13,7 +12,6 @@ ticks: t.CStatic | t.CVolatile | t.CUInt64T = 0 seconds: t.CStatic | t.CVolatile | t.CUInt32T = 0 milliseconds: t.CStatic | t.CVolatile | t.CUInt32T = 0 timer_running: t.CStatic | t.CVolatile | bool = False -_dbg_last: t.CUInt64T = 0 def timer_init(): global ticks, seconds, milliseconds, timer_running @@ -26,7 +24,7 @@ def timer_init(): pit.pit_init(TIMER_FREQUENCY) def timer_handler(): - global ticks, seconds, milliseconds, timer_running, _dbg_last + global ticks, seconds, milliseconds, timer_running if not timer_running: pic.eoi(0) return @@ -37,10 +35,6 @@ def timer_handler(): seconds = seconds + 1 milliseconds = milliseconds - 1000 c.Asm("mfence", op=[t.ASM_DESCR.CLOBBER_MEMORY]) - # [DBG] 每 250 拍打印一次,验证定时器中断是否触发(排查 sti 后挂起,用后移除) - if ticks - _dbg_last >= 250: - _dbg_last = ticks - serial.puts("[T]") sched.Scheduler.sched_tick() pic.eoi(0)