Search code examples
linuxassemblyx86-64system-calls

Linux syscall documentation


I am working on a program that requires a lot of work in x86_64 assembly. Where is the official documentation on the available syscalls for 64-bit Linux? Most of the documentation I can find is either incomplete, for C system calls or is for 32-bit Linux (using int 0x80 rather than syscall).

Where might I find the documentation that will list the syscall numbers, as well as what values need to be in which registers in order to make the call work?


Solution

  • With regards to syscalls, I found the x86-64 Linux system calls on google - it even has what registers to put the arguments in (you'll notice they're exactly as described above). Here you go: https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/

    As @fuz pointed out, the calling convention for syscalls (all syscalls that is) is not the same as regular function calls. Essentially, arguments get loaded into registers rdi, rsi, rdx, r10, r8 and r9 in that specific order.