aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/boot
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2025-04-10 10:28:46 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2025-04-10 10:28:46 +0000
commit62d7fa83e831e84ea851d97b5c957146880ad69a (patch)
tree5a7cc57a83fa6471620b837d4fbf6e65b6edfe3f /arch/x86_64/src/boot
parentbecafcadcea919b84029338983a453d06ef210a1 (diff)
downloadteachos-62d7fa83e831e84ea851d97b5c957146880ad69a.tar.xz
teachos-62d7fa83e831e84ea851d97b5c957146880ad69a.zip
move context_switch function into cpp code
Diffstat (limited to 'arch/x86_64/src/boot')
-rw-r--r--arch/x86_64/src/boot/boot.s30
1 files changed, 0 insertions, 30 deletions
diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s
index 139fd1a..7932045 100644
--- a/arch/x86_64/src/boot/boot.s
+++ b/arch/x86_64/src/boot/boot.s
@@ -352,36 +352,6 @@ 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
- mov $((4 * 16) | 3), %rax
- mov %rax, %ds
- mov %rax, %es
- mov %rax, %fs
- mov %rax, %gs
- // SS is handled by iret https://wiki.osdev.org/Getting_to_Ring_3
-
- // set up the stack frame iret expects
- mov %rsp, %rax
- // user data selector
- push $((4 * 16) | 3)
- // 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)
- // push instruction address to return to
- lea [test_function], %rax
- push %rax
-
- iretq
-
_transition_to_long_mode:
xor %rax, %rax
mov %rax, %ss