소스 검색

Kernel: After creating our GDT, make sure CS refers to the right descriptor.

This will allow us to boot from e.g GRUB which will have a different looking
GDT in effect before we start moving things around.
Andreas Kling 6 년 전
부모
커밋
a182ea8c60
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      Kernel/i386.cpp

+ 6 - 0
Kernel/i386.cpp

@@ -374,6 +374,12 @@ void gdt_init()
         :: "a"(0x10)
         : "memory"
     );
+
+    // Make sure CS points to the kernel code descriptor.
+    asm volatile(
+        "ljmpl $0x8, $sanity\n"
+        "sanity:\n"
+    );
 }
 
 static void unimp_trap()