Professional Documents
Culture Documents
INTERRUPTS SUBSYSTEM
● ABSTRACTION:
aspects to be separated
Interrupt Class
Implementation
Vectors:
● Example Exceptions
10
Signal Transmission
● Sending
– Kernel updates descriptor of destination
process
● Receiving
– Kernel asks a target process to handle the
signal
● Pending signals
– Sent, but not received.
11
Data Structures
● sigaction
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
__sigrestore_t sa_restorer;
sigset_t sa_mask;
};
12
Data Structures
● sa_handler
– Signal handler
● sa_mask
– Specifies signals that are blocked
● sa_flags
– Flags to modify handler behavior –
SA_RESETHAND, SA_NODEFER
● sa_restorer
– Obsolete – Can be removed
13
Data Structures
● siginfo datastructure
– si_signo
– si_errno
– si_code
● sigqueue, sigpending
14
Signals
● Sending
– send_sig_info (int sig, struct siginfo *info,
struct task_struct *t)
● Sig – signal number
● Siginfo - Address of signal structure, 0, 1
● Receiving
– do_signal () / dequeue_signal () till all
unblocked pending signals are handled
– Signal should be caught or ignored,
otherwise, default action will be performed
● Catching
– handle_signal ()
15
Signals
● From a higher level, generated and
handled like interrupts
16
Thank you!
17