Project 2 Roadmap - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Project 2 Roadmap

Description:

Kill(B, SIGUSR1) Process B. function handler() { Print 'HANDLING' main ... KILL. SIGUSR2. SIGUSR1. SIGCHILD. libc. A. B. RegDeliver. RegDeliver. Signal(SIGCHILD) ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 31
Provided by: csU101
Category:
Tags: kill | project | roadmap

less

Transcript and Presenter's Notes

Title: Project 2 Roadmap


1
Project 2 Roadmap
2
Review
Process B function handler() Print
HANDLING main() Signal(handler,
SIGUSR1) for() Print B
  • Process A
  • main()
  • for(1000)
  • Print A
  • Kill(B, SIGUSR1)

Output
HANDLING
BBBBBBBBBBBBBB..
AABBAABBAABB
3
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

4
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
5
Review
Process B function handler() Print
HANDLING main() Signal(handler,
SIGUSR1) for() Print B
  • Process A
  • main()
  • for(1000)
  • Print A
  • Kill(B, SIGUSR1)

Output
HANDLING
BBBBBBBBBBBBBB..
AABBAABBAABB
6
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

7
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

8
Helper Functions
  • Send_Signal
  • Set_Handler
  • Check_Pending_Signal
  • Setup_Frame
  • Complete_Handler

9
Review
Process B function handler() Print
HANDLING main() Signal(handler,
SIGUSR1) for() Print B
  • Process A
  • main()
  • for(1000)
  • Print A
  • Kill(B, SIGUSR1)

10
Overview
A
B
11
Overview
A
B
RegDeliver
RegDeliver
Signal(SIGCHILD)
Signal(SIGCHILD, .)
12
Overview
libc
A
B
RegDeliver
RegDeliver
Signal(SIGCHILD)
Signal(SIGCHILD, .)
13
Overview
libc
A
B
RegDeliver
RegDeliver
Signal(SIGCHILD)
Signal(SIGCHILD, .)
Set_handler
flag pointer
SIGCHILD
SIGUSR1
SIGUSR2
KILL

14
Overview
libc
A
B
RegDeliver
RegDeliver
Signal(SIGCHILD)
Signal(SIGCHILD, .)
Set_handler
flag pointer
SIGCHILD
SIGUSR1
SIGUSR2
KILL

15
Overview
flag pointer
SIGCHILD
SIGUSR1
SIGUSR2
KILL

Send_signal
16
Overview
flag pointer
SIGCHILD
SIGUSR1 X
SIGUSR2
KILL

Send_signal
17
Overview
flag pointer
SIGCHILD
SIGUSR1 X
SIGUSR2
KILL

18
Helper Functions
  • Send_Signal
  • Set_Handler
  • Check_Pending_Signal
  • Setup_Frame
  • Complete_Handler
  • Look at Scheduler

19
Scheduler w/o signals
scheduler
A
B
src/geekos/lowlevel.asm
20
Scheduler w/ signals
scheduler
Bs user level sig. hand.
B
21
Scheduler w/ signals
Check Pending Signal
scheduler
Bs user level sig. hand.
B
22
Check Pending Signal
  • Boolean output
  • Determines whether to proceed with signal handling

23
Scheduler w/ signals
Check Pending Signal
scheduler
Bs user level sig. hand.
B
24
Scheduler w/ signals
Check Pending Signal
Setup Frame
scheduler
Bs user level sig. hand.
B
25
Setup Frame
  • Sets up state to enable user-level handling code
    execution

26
Scheduler w/ signals
Check Pending Signal
Setup Frame
scheduler
Bs user level sig. hand.
B
27
Setup Frame
  • Sets up state to enable user-level handling code
    execution
  • How are function called?

28
Function Calls
  • Parameter of return address is stored on the
    stack so when finished
  • Pop off stack
  • Continue execution
  • Setup Frame
  • Enables user stack to keep
  • Interrupt_State Vector
  • Return address

29
Storing Return Address
  • Want complete_handler to execute once user level
    handling done.
  • Hack
  • Place address of return_signal as return address
    on stack
  • Now return_signal stred as function

30
Scheduler w/ signals
Check Pending Signal
Setup Frame
scheduler
CompleteHandler
Bs user level sig. hand.
B
Write a Comment
User Comments (0)
About PowerShow.com