I am reading about VM handling on Linux. Apparently to perform a syscall there's a page at 0xFFFFF000 on x86. called vsyscall page. In the past, the strategy to call a syscall was to use int 0x80. Is this vsyscall page strategy still using int 0x80 under the hood, or is it using a different call strategy (e.g. syscall opcode?). Collateral question: is the int 0x80 method outdated?
-
2Check this answer: http://stackoverflow.com/a/19942352/795910 – Ottavio Campana May 21 '14 at 14:29
1 Answers
If you run ldd
on a modern Linux binary, you'll see that it's linked to a dynamic library called linux-vdso.1
(on amd64) or linux-gate.so.1
(on x86), which is located in that vsyscall page. This is a shared library provided by the kernel, mapped into every process's address space, which contains C functions that encapsulate the specifics of how to perform a system call.
The reason for this encapsulation is that the "preferred" way to perform a system call can differ from one machine to another. The interrupt 0x80 method should always work on x86, but recent processors support the sysenter
(Intel) or syscall
(AMD) instructions, which are much more efficient. You want your programs to use those when available, but you also want the same compiled binary to run on both Intel and AMD (and other) processors, so it shouldn't contain vendor-specific opcodes. The linux-vdso
/linux-gate
library hides these processor-specific decisions behind a consistent interface.
For more information, see this article.

- 33,849
- 3
- 67
- 87