-
Notifications
You must be signed in to change notification settings - Fork 3
/
lab2.txt
32 lines (20 loc) · 1.47 KB
/
lab2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Student: Shawn Hsiao
Student: Jazmine Redmond
Question #1
Describe the relationship between scheduler, sched, swtch in kernel/proc.c.
Scheduler loops through and finds a process to run, then it calls swtch to give control to that process. When the process needs to return control to the scheduler it calls sched. Then this cycle repeats
Each CPU has a separate scheduler that manages the scheduling routine including picking which process to run, running it, and returning control to the scheduler.
Sched saves and retores intena then calls swtch to return control to scheduler.
Swtch is inside the scheduler function and switches from process to process.
Question #2
Describe why the child process is able to return to user-level application where fork is called.
Fork copies the parent's file descriptor table along with its memory. This way the child starts with exactly the same open files as the parent and is able to return to the user level application.
Question #3
How does process kill work in xk? What is its relationship with exit?
exit allows a process to terminate itself, kill lets one process request that another be terminated.
Kill indirectly calls exit. Kill sets the victim's p->killed and if wakes it up if it's sleeping. Eventually the victim wil enter/leave the kernel at which point code in trap will call exit if p->killed is set.
Question #4
For each member of the project team, how many hours did you
spend on this lab?
Jazmine: 15-20 hours
Shawn: 20-25 hours