diff options
Diffstat (limited to 'kernel/src/sys/userspace_asm.S')
| -rw-r--r-- | kernel/src/sys/userspace_asm.S | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/kernel/src/sys/userspace_asm.S b/kernel/src/sys/userspace_asm.S index 5838051..c722df0 100644 --- a/kernel/src/sys/userspace_asm.S +++ b/kernel/src/sys/userspace_asm.S @@ -4,17 +4,23 @@ .global jump_userspace jump_userspace: - mov $0x23, %ax + mov $0x1b, %ax mov %ax, %ds mov %ax, %es mov %ax, %fs mov %ax, %gs - mov %esp, %eax - push $0x23 - push %rax - pushf - push $0x1b - sub $8, %rsp - movabs $begin_userspace, %rsp - iretq + mov $0xc0000082, %rcx + wrmsr + mov $0xc0000080, %rcx + rdmsr + or $1, %eax + wrmsr + mov $0xc0000081, %rcx + rdmsr + mov $0x00100008, %edx + wrmsr + + mov $begin_userspace, %ecx + mov $0x202, %r11 + sysretq |
