Quantcast
Viewing all articles
Browse latest Browse all 22148

How to invoke a system call via sysenter in inline assembly?

How can we implement the system call using sysenter/syscall directly in x86 Linux? Can anybody provide help? It would be even better if you can also show the code for amd64 platform.

I know in x86, we can use

__asm__(
"               movl $1, %eax  \n""               movl $0, %ebx \n""               call *%gs:0x10 \n"
);

to route to sysenter indirectly.

But how can we code using sysenter/syscall directly to issue a system call?

I find some material http://damocles.blogbus.com/tag/sysenter/ . But still find it difficult to figure out.


Viewing all articles
Browse latest Browse all 22148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>