linux 内核上下文中的硬件 "gates" 是什么?

What are hardware "gates" in the context of the linux kernel?

In user space, the ioctl system call has the following prototype:

int ioctl(int fd, unsigned long cmd, ...);

The prototype stands out in the list of Unix system calls because of the dots, which usually mark the function as having a variable number ofarguments. In a real system, however, a system call cannot actually have a variable number of arguments. System calls must have a well-defined prototype, because user programs can access them only through hardware "gates".

那么这些硬件门是什么?页码为 135 和 136。

硬件"gates" 是允许切换到内核上下文的特定指令,通常是让程序向内核请求某些东西。这可能是 syscallsysenterint 0x80 之类的指令,具体取决于您的系统。

我应该注意,这些在实践中通常不称为 "hardware gates",而是类似于 "system calls instructions."