From 003ee08ea763f0a89f8804df266dfbacb32d36dd Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 27 Jun 2015 20:14:18 +0200 Subject: [PATCH] fix bug in the creation of a pseudo interrupt by using the 64bit mode, an interrupt pushs always SS and RSP on the stack --- hermit/arch/x86/kernel/entry.asm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hermit/arch/x86/kernel/entry.asm b/hermit/arch/x86/kernel/entry.asm index 8b28eb62b..6e50c98bf 100644 --- a/hermit/arch/x86/kernel/entry.asm +++ b/hermit/arch/x86/kernel/entry.asm @@ -566,7 +566,10 @@ switch_context: ; create on the stack a pseudo interrupt ; afterwards, we switch to the task with iret mov rax, rdi ; rdi contains the address to store the old rsp - pushf ; RFLAGS + 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 push QWORD 0x00 ; Interrupt number