]> Zhao Yanbai Git Server - kernel.git/commitdiff
task的state字段添加volatile关键字修饰
authoracevest <zhaoyanbai@126.com>
Sun, 14 Nov 2021 15:05:04 +0000 (23:05 +0800)
committeracevest <zhaoyanbai@126.com>
Sun, 14 Nov 2021 15:05:04 +0000 (23:05 +0800)
include/task.h
kernel/init.c
kernel/setup.c

index ff6559a7d826459dff1e343ba236594d3597c187..2e698dda7aa00e6cbde28b08c543f30d11824820 100644 (file)
@@ -55,7 +55,7 @@ typedef union task_union {
 
         pid_t pid;
         pid_t ppid;
-        unsigned int state;
+        volatile unsigned int state;
         long exit_code;
         unsigned long cr3;
 
index 073c542359540fbc870233b4cc001746f0f835c4..4d0707c6835d3007d37a295eaf4c88455cd91e67 100644 (file)
@@ -155,6 +155,11 @@ void root_task_entry() {
     // 所以得先清空一下键盘
     inb(0x60);
 
+    // 继续内核未完成的初始化
+    // 这些初始化在开中断的情况下完成
+    void setup_under_irq();
+    setup_under_irq();
+
     kernel_task("init", init_task_entry);
     kernel_task("test", init_task_entry);
     kernel_task("user", user_task_entry);
index bffaa0f23f421b08c46d46b8ecc1da9d0a25e76c..f951102eadfa884e02f4b44133e2a3a40f7703e6 100644 (file)
@@ -83,9 +83,6 @@ void setup_kernel() {
 
     setup_pci();
 
-    void ide_init();
-    ide_init();
-
     detect_cpu();
 
     printk(version);
@@ -97,3 +94,9 @@ void setup_kernel() {
 
     setup_fs();
 }
+
+// 在开中断的情况下继续初始化的内容
+void setup_under_irq() {
+    void ide_init();
+    ide_init();
+}
\ No newline at end of file