Difference between Syscall and Traps

ⅰ亾dé卋堺 提交于 2020-07-18 08:09:30

问题


I am wondering if there is any difference between the MIPS syscall and trap instructions. I can't find anything involving this, so I am not sure if there is a difference. Traps seem to just be a conditional syscall, but some clarifying can be helpful.


回答1:


The SYSCALL and TRAP instructions both trigger exceptions, but the resulting exception is of a different type (SystemCall versus Trap), and the operating system will likely handle them differently.




回答2:


A Trap is an exception switches to kernel mode by invoking a kernel sub-routine (any system call). Usually trap creates any kind of control transfer to operating system. Where as SYSCALL is synchronous and planned user process to kernel mode.



来源:https://stackoverflow.com/questions/14004766/difference-between-syscall-and-traps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!