First Hello world syscall
All checks were successful
Build documentation / build-and-deploy (push) Successful in 26s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 26s
This commit is contained in:
40
kernel/amd64/syscallentry.S
Normal file
40
kernel/amd64/syscallentry.S
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <amd64/regsasm.h>
|
||||
|
||||
.extern amd64_syscall_dispatch
|
||||
|
||||
dupa:
|
||||
jmp dupa
|
||||
|
||||
.global amd64_syscall_entry
|
||||
amd64_syscall_entry:
|
||||
cli
|
||||
swapgs
|
||||
|
||||
movq %rsp, %gs:0
|
||||
movq %gs:8, %rsp
|
||||
|
||||
pushq $0x23
|
||||
pushq %gs:0
|
||||
pushq %r11
|
||||
pushq $0x1b
|
||||
pushq %rcx
|
||||
pushq $0
|
||||
pushq $0
|
||||
push_regs
|
||||
cld
|
||||
movq %rsp, %rdi
|
||||
movq %rsp, %rbp
|
||||
subq $8, %rsp
|
||||
andq $~0xF, %rsp
|
||||
callq amd64_syscall_dispatch
|
||||
movq %rbp, %rsp
|
||||
pop_regs
|
||||
cli
|
||||
addq $16, %rsp
|
||||
popq %rcx
|
||||
addq $8, %rsp
|
||||
popq %r11
|
||||
addq $16, %rsp
|
||||
movq %gs:0, %rsp
|
||||
swapgs
|
||||
sysretq
|
||||
Reference in New Issue
Block a user