Understanding Signal Handling in Operating Systems: A Deep Dive into Processes A and B - P, Study Guides, Projects, Research of Operating Systems

An in-depth analysis of signal handling in operating systems through a review of processes a and b. It covers the registration and delivery of signals, system calls, and helper functions. The document also discusses the scheduler and its behavior with and without signals.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 07/30/2009

koofers-user-hyi
koofers-user-hyi 🇺🇸

5

(1)

9 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Project 2 Roadmap++
Awwww! ugly slides.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Understanding Signal Handling in Operating Systems: A Deep Dive into Processes A and B - P and more Study Guides, Projects, Research Operating Systems in PDF only on Docsity!

Project 2 Roadmap++

Awwww! ugly slides.

HANDLING BBBBBBBBBBBBBB…..

Review

Process A main() { for(1000) Print “A” Kill(B, SIGUSR1) } Process B function handler() { Print “HANDLING” } main() { Signal(&handler, SIGUSR1) for(;;) Print “B” } AABBAABBAABB……… 1000 A’S

Output

System Calls

 Sys_Signal: register a signal handler  Sys_Kill: send a signal  Sys_RegDeliver: initialize signal handling for a

process

 Sys_WaitNoPID: wait for any child process to die  Sys_ReturnSignal: indicate completion of signal

handler

Referenced in user code

HANDLING BBBBBBBBBBBBBB…..

Review

Process A main() { for(1000) Print “A” Kill(B, SIGUSR1) } Process B function handler() { Print “HANDLING” } main() { Signal(&handler, SIGUSR1) for(;;) Print “B” } AABBAABBAABB……… 1000 A’S Output

System Calls

 Sys_Signal: register a signal handler  Sys_Kill: send a signal  Sys_RegDeliver: initialize signal handling for a

process

 Sys_WaitNoPID: wait for any child process to die  Sys_ReturnSignal: indicate completion of signal

handler

Executed by stub code once a signal has been handled

Helper Functions

 Send_Signal

 Set_Handler

 Check_Pending_Signal

 Setup_Frame

 Complete_Handler

Overview

A B

Overview

A B

RegDeliver RegDeliver Signal(SIGCHILD) Signal(SIGCHILD, ….)

Scheduler: w/o signals

A

scheduler B

B

src/geekos/lowlevel.asm

Scheduler: w/ signals

A

B’s user level sig. hand.

B

scheduler B

Check Pending Signal

 Boolean output  Determines whether to proceed with signal handling

Scheduler: w/ signals

A

B’s user level sig. hand.

B

scheduler B Check Pending Signal true false

Setup Frame

 Sets up state to enable user-level handling code execution

Scheduler: w/ signals

A

B’s user level sig. hand.

B

scheduler B Check Pending Signal Setup Frame