Clear the direction flag upon entry to the kernel.

This commit is contained in:
Pedro Falcato 2017-06-10 01:18:07 +01:00
parent f32baac73f
commit c0a44e72a6
No known key found for this signature in database
GPG Key ID: 66A1258056225EE4
6 changed files with 11 additions and 0 deletions

View File

@ -73,6 +73,9 @@ nullpage: .global nullpage
.code32 .code32
_start: _start:
__start: __start:
# Clear the direction flag.
cld
# Initialize the stack pointer. The magic value is from kernel.cpp. # Initialize the stack pointer. The magic value is from kernel.cpp.
movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp (See below also) movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp (See below also)

View File

@ -339,6 +339,7 @@ thread_exit_handler:
jmp interrupt_handler_prepare jmp interrupt_handler_prepare
interrupt_handler_prepare: interrupt_handler_prepare:
cld
movq $1, asm_is_cpu_interrupted movq $1, asm_is_cpu_interrupted
pushq %r15 pushq %r15

View File

@ -24,6 +24,7 @@
.section .text .section .text
.type syscall_handler, @function .type syscall_handler, @function
syscall_handler: syscall_handler:
cld
movl $0, errno movl $0, errno
pushq %rbp pushq %rbp

View File

@ -54,6 +54,9 @@ nullpage: .global nullpage
.type __start, @function .type __start, @function
_start: _start:
__start: __start:
# Clear the direction flag.
cld
# Initialize the stack pointer. The magic value is from kernel.cpp. # Initialize the stack pointer. The magic value is from kernel.cpp.
movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp

View File

@ -339,6 +339,7 @@ thread_exit_handler:
jmp interrupt_handler_prepare jmp interrupt_handler_prepare
interrupt_handler_prepare: interrupt_handler_prepare:
cld
movl $1, asm_is_cpu_interrupted movl $1, asm_is_cpu_interrupted
# Check if an interrupt happened while having kernel permissions. # Check if an interrupt happened while having kernel permissions.

View File

@ -25,6 +25,8 @@
.type syscall_handler, @function .type syscall_handler, @function
syscall_handler: syscall_handler:
/* -- stack is 12 bytes from being 16-byte aligned -- */ /* -- stack is 12 bytes from being 16-byte aligned -- */
cld
movl $0, errno movl $0, errno
pushl %ebp pushl %ebp