Still I don't get how to use SYSENTER. Can I use it in my code (in 32 bit Linux)?
I tried to use SYSENTER and the programm segfaults. I guess it is because CPU doesn't know where to return. Linux needs to set EDX and ECX before returning (via SYSEXIT), but what does it put in these registers ?
I can't set EDX and ECX myself because it would conflict with , for example, write file syscall.
mov eax,4
mov ebx,1
mov ecx,msgAddress
mov edx,msgLen
int 80h ; SYSENTER here segfaults