系统调用实现 [英] System calls Implementation

查看:73
本文介绍了系统调用实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户应用程序进行系统调用,则会触发软件中断/异常.如何查看用于生成软件中断的源代码?

If a user application makes a system call , a software interrupt/exception is triggered. How can I see the source code for generating a software interrupt ?

推荐答案

Linux汇编中进行了解释如何操作.并且您应该阅读Wikipedia 系统调用页(以及有关 syscalls(2)手册页.另请参见答案和一.还要查看 Gnu Libc & musl-libc 源代码.还学习使用strace找出由给定命令或进程进行的系统调用.

It is explained in Linux Assembly Howto. And you should read wikipedia syscall page (and also about VDSO), and also intro(2) & syscalls(2) man pages. See also this answer and this one. Look also inside Gnu Libc & musl-libc source code. Learn also to use strace to find out which syscalls are made by a given command or process.

另请参阅与系统相关的调用约定和应用程序二进制接口规范.对于x86-64,它是此处.

See also the calling conventions and Application Binary Interface specification relevant to your system. For x86-64 it is here.

这篇关于系统调用实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆