Since MS‑DOS, I know system invocation using interrupts. In old papers, I saw reference to int 80h
to invoke system functions on Linux. Since a rather long time now
The Intel manual says that syscall
is invalid in compatibility (32-bit) mode, so it should not be used by the kernel.
This seems to be an Intel-only restriction however: https://stackoverflow.com/a/29784932/895245 that AMD does not have, but certainly Linux has to support Intel :-)
sysenter
appears to be the best way to do it today as it is faster than int 0x80
, but it should be used indirectly through VDSO as explained at How to invoke a system call via sysenter in inline assembly (x86/amd64 linux)?