From b163fa4521c4ee1c37de53fb1ad30bc48890ff33 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 20 Aug 2017 10:19:25 +0200 Subject: [PATCH] reload the segment descriptors after loading GDT --- arch/x86/kernel/entry.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/entry.asm b/arch/x86/kernel/entry.asm index fadc21c3d..28d49943b 100644 --- a/arch/x86/kernel/entry.asm +++ b/arch/x86/kernel/entry.asm @@ -264,6 +264,16 @@ extern gp ; C as 'extern void gdt_flush();' gdt_flush: lgdt [gp] + ; reload the segment descriptors + mov eax, 0x10 + mov ds, eax + mov es, eax + mov ss, eax + xor eax, eax + mov fs, eax + mov gs, eax + jmp 0x08:flush2 +flush2: ret ; The first 32 interrupt service routines (ISR) entries correspond to exceptions.