gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 11:13:04 25 4
gpt4 key购买 nike

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。

最佳答案

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

我应该指出,这些在实践中通常不被称为“硬件门”,而是类似“系统调用指令”的东西。

关于linux - 在 linux 内核的上下文中,硬件 "gates"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33606672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com