Kernel processes / multitasking
This commit is contained in:
19
kernel/hal/x86_64/switch.S
Normal file
19
kernel/hal/x86_64/switch.S
Normal file
@ -0,0 +1,19 @@
|
||||
#include "regs.S"
|
||||
|
||||
siema:
|
||||
jmp siema
|
||||
|
||||
.global hal_switchproc
|
||||
hal_switchproc:
|
||||
mov %cr3, %rcx
|
||||
cmp %rsi, %rcx
|
||||
je .done
|
||||
mov %rsi, %cr3
|
||||
.done:
|
||||
mov %rdi, %rsp
|
||||
|
||||
_pop_regs
|
||||
add $0x10, %rsp
|
||||
|
||||
iretq
|
||||
|
Reference in New Issue
Block a user