From ebabd049c46f76b26c1f5ae87adea1284b5db2eb Mon Sep 17 00:00:00 2001 From: acevest Date: Mon, 23 Sep 2024 16:55:28 +0800 Subject: [PATCH] =?utf8?q?=E5=86=85=E6=A0=B8=E5=88=9B=E5=BB=BA=E8=BF=9B?= =?utf8?q?=E7=A8=8B=E9=BB=98=E8=AE=A4=E5=BC=80=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- kernel/task_init.c | 3 --- kernel/task_root.c | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/task_init.c b/kernel/task_init.c index 141f98c..dace90f 100644 --- a/kernel/task_init.c +++ b/kernel/task_init.c @@ -13,7 +13,6 @@ int sysc_wait(int ticks); void kernel_task(char *name, void *entry, void *arg); - // 测试用的代码 // 这里存的是下标对应的每个扇区的最后2个字节 // hexdump -C HD.IMG | less 看的,如果镜像文件有变动需要更新这里 @@ -125,7 +124,6 @@ void taskC_entry() { } } - void init_task_entry() { current->priority = 10; @@ -139,7 +137,6 @@ void init_task_entry() { inb(0x60); #endif - #if 1 extern __attribute__((regparm(0))) long sysc_mkdir(const char *path, int mode); sysc_mkdir("/root", 0777); diff --git a/kernel/task_root.c b/kernel/task_root.c index 63572b2..95d5477 100644 --- a/kernel/task_root.c +++ b/kernel/task_root.c @@ -49,7 +49,11 @@ void kernel_task(char *name, void *entry, void *arg) { regs.ss = SELECTOR_KRNL_DS; regs.fs = SELECTOR_KRNL_DS; regs.gs = SELECTOR_KRNL_DS; +#if 0 get_eflags(regs.eflags); +#else + regs.eflags = 0x200; +#endif int pid = do_fork(®s, FORK_KRNL); @@ -70,12 +74,11 @@ void root_task_entry() { } #endif - - sti(); + // sti(); kernel_task("init", init_task_entry, NULL); - schedule(); + sti(); current->priority = 1; while (1) { -- 2.44.0