I'm learning how to implement the system call for my own x86_64 OS project. I know that syscall
instruction is used for system call, and the underlying operations from https://www.felixcloutier.com/x86/syscall.html.
I also noticed that in Linux, the system call number is specified in %rax
.
What I don't understand is, how does syscall
find the address of the system call via %rax
. I assume that the table of system call must be stored somewhere.
I'm looking for more detailed explanation on how syscall
knows the address of the called system calls.