System calls Implementation

前端 未结 3 1948
滥情空心
滥情空心 2020-12-15 14:34

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 ?

3条回答
  •  鱼传尺愫
    2020-12-15 14:55

    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

提交回复
热议问题