I have a very basic assembly program that runs in Linux userland:
section .text
global _start
_start:
mov edx, 14
mov ecx, msg
mov ebx, 1
mov eax, 4
syscall
mov eax, 1
syscall
section .data
msg db "Hello, World!", 0xA
However, this doesn't work as it is, but only if I replace the syscalls with int 0x80. Don't these do the same thing? I know that syscall was designed to be lower-latency, but other than that, I didn't think there was a difference. Why doesn't it work?
sysenter? Linux maps a page with the user-spacesysenterwrapper into the virtual address space of 32bit processes. This is the VDSO.syscall,syscallsand the syscalls you want to call. you find everything you had to know about there.