Unverified Commit c0a44e72 authored by heat's avatar heat

Clear the direction flag upon entry to the kernel.

parent f32baac7
......@@ -73,6 +73,9 @@ nullpage: .global nullpage
.code32
_start:
__start:
# Clear the direction flag.
cld
# Initialize the stack pointer. The magic value is from kernel.cpp.
movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp (See below also)
......
......@@ -339,6 +339,7 @@ thread_exit_handler:
jmp interrupt_handler_prepare
interrupt_handler_prepare:
cld
movq $1, asm_is_cpu_interrupted
pushq %r15
......
......@@ -24,6 +24,7 @@
.section .text
.type syscall_handler, @function
syscall_handler:
cld
movl $0, errno
pushq %rbp
......
......@@ -54,6 +54,9 @@ nullpage: .global nullpage
.type __start, @function
_start:
__start:
# Clear the direction flag.
cld
# Initialize the stack pointer. The magic value is from kernel.cpp.
movl $(stack + 65536), %esp # 64 KiB, see kernel.cpp
......
......@@ -339,6 +339,7 @@ thread_exit_handler:
jmp interrupt_handler_prepare
interrupt_handler_prepare:
cld
movl $1, asm_is_cpu_interrupted
# Check if an interrupt happened while having kernel permissions.
......
......@@ -25,6 +25,8 @@
.type syscall_handler, @function
syscall_handler:
/* -- stack is 12 bytes from being 16-byte aligned -- */
cld
movl $0, errno
pushl %ebp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment