Message board for the users of flat assembler.
> Examples and Tutorials > [Linux32] vDSO, auxv, vsyscall, int 0x80, calling the kernel
[Linux32] vDSO, auxv, vsyscall, int 0x80, calling the kernel
In 32-bit Linux calling the kernel can be done using int 0x80. There are also other, more efficient ways to call kernel services and functions.
Linux maps into every process a kernel interface page called the virtual dynamic shared object (vDSO).
What this gives us is a function to call the kernel using either the syscall or the sysenter instruction. This is called the vsyscall entry. So depending upon which instruction the CPU supports Linux figures it out and makes it available to us in the vDSO.
There are at least three ways to find the entry point of vsyscall
The first and easiest is the AT_SYSINFO value available from the auxv table.
format ELF executable 0 at 1 shl 16 entry main AT_NULL = 0 AT_SYSINFO = 32 SYS_EXIT = 1 SYS_WRITE = 4 STD_OUTPUT = 1 struc Elf32_auxv_t .a_type rd 1 .a_val rd 1 virtual at 0 Elf32_auxv_t Elf32_auxv_t sizeof.Elf32_auxv_t = $ end virtual segment executable default_sys_call ;if the search fails we use this to call the kernel int 0x80 retn main mov eax,