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.
@@ -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()