From 3b8e6791ee47d6210870515de58b95ca87e700d5 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 20 Aug 2017 10:51:52 +0200 Subject: [PATCH] create valid pseudo interrupt to set cs --- arch/x86/kernel/entry.asm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/entry.asm b/arch/x86/kernel/entry.asm index 022f0209c..5775dfbcc 100644 --- a/arch/x86/kernel/entry.asm +++ b/arch/x86/kernel/entry.asm @@ -273,11 +273,13 @@ gdt_flush: mov fs, eax mov gs, eax ; create pseudo interrupt to set cs - push 0x08 - push flush2 + push QWORD 0x10 ; SS + push rsp ; RSP + add QWORD [rsp], 0x08 ; => value of rsp before the creation of a pseudo interrupt + pushfq ; RFLAGS + push QWORD 0x08 ; CS + push QWORD rollback ; RIP iretq -flush2: - ret ; The first 32 interrupt service routines (ISR) entries correspond to exceptions. ; Some exceptions will push an error code onto the stack which is specific to