diff options
| -rw-r--r-- | arch/x86_64/src/boot/boot.s | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s index 5a49d48..139fd1a 100644 --- a/arch/x86_64/src/boot/boot.s +++ b/arch/x86_64/src/boot/boot.s @@ -352,6 +352,10 @@ prepare_page_maps: .section .boot_text, "ax", @progbits .code64 +test_function: + cli + ret + .global context_switch context_switch: // ring 3 data with bottom 2 bits set for ring 3 @@ -366,21 +370,18 @@ context_switch: mov %rsp, %rax // user data selector push $((4 * 16) | 3) - // current exp + // current rsp push %rax // push eflags pushf // push code selector (ring 3 code with bottom 2 bits set for ring 3) push $((3 * 16) | 3) - // instruction address to return to - push test_function + // push instruction address to return to + lea [test_function], %rax + push %rax iretq -test_function: - cli - ret - _transition_to_long_mode: xor %rax, %rax mov %rax, %ss |
