From f838a751cf0bb3f6edd03fec2b7c275fcdf1ab8a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 15 May 2016 07:48:30 +0200 Subject: [PATCH] clear the DF flag to adhere the x86_64 ABI --- hermit/arch/x86/kernel/entry.asm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hermit/arch/x86/kernel/entry.asm b/hermit/arch/x86/kernel/entry.asm index 57cb2f4c2..a2bfc7897 100644 --- a/hermit/arch/x86/kernel/entry.asm +++ b/hermit/arch/x86/kernel/entry.asm @@ -114,6 +114,10 @@ start64: mov fs, eax mov gs, eax + ; clear DF flag => default value by entering a function + ; => see ABI + cld + ; determine full image size mov rax, kernel_end sub rax, kernel_start @@ -464,6 +468,8 @@ isrsyscall: global switch_context align 16 switch_context: + ; by entering a function the DF flag has to be cleared => see ABI + cld ; create on the stack a pseudo interrupt ; afterwards, we switch to the task with iret push QWORD 0x10 ; SS