Kernel: Make sure we load DS/ES/FS/GS/SS immediately after making the GDT.

This commit is contained in:
Andreas Kling 2019-05-17 18:23:08 +02:00
commit e0ff07bb57
Notes: sideshowbarker 2024-07-19 14:03:23 +09:00

View file

@ -366,6 +366,16 @@ void gdt_init()
write_raw_gdt_entry(0x0020, 0x0000ffff, 0x00cff200);
flush_gdt();
asm volatile(
"mov %%ax, %%ds\n"
"mov %%ax, %%es\n"
"mov %%ax, %%fs\n"
"mov %%ax, %%gs\n"
"mov %%ax, %%ss\n"
:: "a"(0x10)
: "memory"
);
}
static void unimp_trap()