Syscall or sysenter on 32 bits Linux?

后端 未结 2 1962
礼貌的吻别
礼貌的吻别 2021-02-15 18:28

Since MS‑DOS, I know system invocation using interrupts. In old papers, I saw reference to int 80h to invoke system functions on Linux. Since a rather long time now

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-15 18:52

    The Intel manual says that syscall is invalid in compatibility (32-bit) mode, so it should not be used by the kernel.

    This seems to be an Intel-only restriction however: https://stackoverflow.com/a/29784932/895245 that AMD does not have, but certainly Linux has to support Intel :-)

    sysenter appears to be the best way to do it today as it is faster than int 0x80, but it should be used indirectly through VDSO as explained at How to invoke a system call via sysenter in inline assembly (x86/amd64 linux)?

提交回复
热议问题