If a user application makes a system call , a software interrupt/exception is triggered. How can I see the source code for generating a software interrupt ?
long long ago, there is an int 0x80 trap to enter into the kernel, but nowadays sysenter is preferred.
you can get the code by dumping vsyscall section which mapped into every process automatically by kernel.
$ cat /proc/self/maps
blah blah blah
...
blah blah blah
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
for more information check this article