From: acevest Date: Sat, 27 May 2023 04:02:32 +0000 (+0800) Subject: 解决在delay_tasks列表中出现READY状态任务的问题 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=955a95f7adb190146e732084921760276a90d30c;p=kernel.git 解决在delay_tasks列表中出现READY状态任务的问题 --- diff --git a/drivers/keyboard.c b/drivers/keyboard.c index 0bc1458..b248dae 100644 --- a/drivers/keyboard.c +++ b/drivers/keyboard.c @@ -76,7 +76,7 @@ void kbd_debug(unsigned char scan_code) { printl(MPL_KEYBOARD, "keyboard irq: %d scan code %02x", kbd_cnt++, scan_code); if (scan_code == 0x01) { // Esc - reboot(); + // reboot(); } printd("[%02x]", scan_code); diff --git a/kernel/sched.c b/kernel/sched.c index 82c272d..8849bda 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -196,6 +196,9 @@ void schedule() { if (0 == current->ticks) { current->turn++; current->ticks = current->priority; + } + + if (current->state == TASK_RUNNING) { current->state = TASK_READY; } diff --git a/kernel/setup.c b/kernel/setup.c index aff660d..4d2e7f5 100644 --- a/kernel/setup.c +++ b/kernel/setup.c @@ -82,7 +82,7 @@ void setup_kernel() { cnsl_init(); - printl(MPL_TITLE, " SYSTEM MONITOR"); + printl(MPL_TITLE, " KERNEL MONITOR"); printl(MPL_ROOTDEV, "root device %08x", system.root_dev); setup_tasks();