什么是更好的" INT 0x80的"或QUOT;系统调用"? [英] What is better "int 0x80" or "syscall"?
问题描述
我研究了Linux内核,并发现了 x86_64的
架构中断 0x80的INT
不为工作要求系统调用。
I study the Linux Kernel and found out that for x86_64
architecture the interrupt int 0x80
doesn't work as calling for system call.
现在的问题是:在 86
架构更重要的是preferable 系统调用
或<$ C的情况下, $ C> 0x80的INT 为什么?
The question is: in case of x86
architecture what is more preferable syscall
or int 0x80
and why?
修改:我用的是3.4的内核
EDIT: I use the kernel 3.4
推荐答案
-
系统调用
是X86-64
进入内核模式的默认方式。该指令是不可操作的的Intel处理器的32位模式的 -
SYSENTER
是使用最频繁的调用系统在运行32位模式下调用的指令。它类似于系统调用
,更难有点虽然使用,但是这是内核的关注。 -
0x80的INT
是一个传统的方式来调用系统调用,应该避免。
syscall
is default way of entering kernel mode onx86-64
. This instruction is not available in 32 bit modes of operation on Intel processors.sysenter
is an instruction most frequently used to invoke system calls in 32 bit modes of operation. It is similar tosyscall
, a bit more difficult to use though, but that is kernel's concern.int 0x80
is a legacy way to invoke a system call and should be avoided.
preferable方式来调用系统调用是使用VDSO,存储器中的每个进程的地址空间,允许使用系统调用更有效地(例如,通过在某些情况下,不进入内核模式在所有映射的一部分)。 VDSO也需要照顾比较困难,相较于传统的 INT 0x80的
的方式,处理系统调用
或<$ C的$ C> SYSENTER 的说明。
Preferable way to invoke a system call is to use VDSO, a part of memory mapped in each process address space that allow to use system calls more efficiently (for example, by not entering kernel mode in some cases at all). VDSO also takes care of more difficult, in comparison to the legacy int 0x80
way, handling of syscall
or sysenter
instructions.
这篇关于什么是更好的&QUOT; INT 0x80的&QUOT;或QUOT;系统调用&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!