The Linux Kernel Signals amp; Interrupts.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
TheLinuxKernelSignalsamp;amp;Interrupts.ppt

The Linux Kernel: Signals Interrupts Signals Introduced in UNIX systems to simplify IPC. Used by the kernel to notify processes of system events. A signal is a short message sent to a process, or group of processes, containing the number identifying the signal. No data is delivered with traditional signals. POSIX.4 defines i/f for queueing ordering RT signals w/ arguments. Example Signals Linux supports 31 non-real-time signals. POSIX standard defines a range of values for RT signals: SIGRTMIN 32 … SIGRTMAX (_NSIG-1) in asm-*/signal.h Signal Transmission Signal sending: Kernel updates descriptor of destination process. Signal receiving: Kernel forces target process to “handle” signal. Pending signals are sent but not yet received. Up to one pending signal per type for each process, except for POSIX.4 signals. Subsequent signals are discarded. Signals can be blocked, i.e., prevented from being received. Signal-Related Data Structures sigset_t stores array of signals sent to a process. The process descriptor (struct task_struct in linux/sched.h) has several fields for tracking sent, blocked and pending signals. Sending Signals A signal is sent due to occurrence of corresponding event (see kernel/signal.c). e.g., send_sig_info(int sig, struct siginfo *info, struct task_struct *t); sig is signal number. info is either: address of RT signal structure. 0, if user mode process is signal sender. 1, if kernel is signal sender. e.g., kill_proc_info(int sig, struct siginfo *info, pid_t pid); Receiving Signals Before process p resumes execution in user mode, kernel checks for pending non-blocked signals for p. Done in entry.S by call to ret_from_intr(), which is invoked after handling an interrupt or exception. do_signal() repeatedly invokes dequeue_signal() until no more non-blocked pending signals are left. If the signal is not ignored, or the default action is not performed, the signal must be caught. Catching Signals handle_signal() is invoked by do_signal() to execut

文档评论(0)

shengyp + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档