CS 354 EXAM STUDY GUIDE QUESTIONS WITH CORRECTLY
SOLVED ANSWERS: GUARANTEED PASS
1) Name the sections of memory -- Answer ✔✔ Stack, Shared Libs, Heap, Bss, Data,
t t t t t t t t t t t t t t
Text
2) What goes in the text section of memory? -- Answer ✔✔ Instructions that the
t t t t t t t t t t t t t t
program runs t
3) Name the four features of a 3rd generation machine -- Answer ✔✔ Processor,
t t t t t t t t t t t t t
memory system, I/O devices, interrupts t t t t
4) Are virtual or physical addresses cached? -- Answer ✔✔ Virtual addresses
t t t t t t t t t t
5) What is the purpose of the interrupt mask? -- Answer ✔✔ It is a bitmask kept in the
t t t t t t t t t t t t t t t t t t
CPU status register to determine which interrupts are permitted
t t t t t t t t
6) In XINU, how are processes implemented? -- Answer ✔✔ Each process is a thread of
t t t t t t t t t t t t t t t
the main program
t t
7) In XINU, is the stack or heap shared? -- Answer ✔✔ The heap is shared, but each
t t t t t t t t t t t t t t t t t
process has its own stack t t t t
8) Threads within a process share these three things (and a 4th in XINU)... -- Answer
t t t t t t t t t t t t t t t
✔✔ text, data, and bss (and heap)
t t t t t t
9) Where is information about each process stored? -- Answer ✔✔ In the process table
t t t t t t t t t t t t t t
(or thread table)
t t
10) A process that is delayed for a specified time is in what state? -- Answer ✔✔ Sleeping
t t t t t t t t t t t t t t t t
, 11) A process that is not permitted to execute is in what state? -- Answer ✔✔ Suspended
t t t t t t t t t t t t t t t
12) Where are processes that are ready to execute stored? -- Answer ✔✔ In the
t t t t t t t t t t t t t t
readylist
13) What is XINU's scheduling policy? -- Answer ✔✔ Highest priority process gets the
t t t t t t t t t t t t t
CPU
14) When is the scheduling invariant enforced? -- Answer ✔✔ When the set of eligible
t t t t t t t t t t t t t t
processes changes, or the priority of any eligible process changes
t t t t t t t t t
15) What function swaps the currently running process? -- Answer ✔✔ ctxsw
t t t t t t t t t t
16) Why must ctxsw be written in assembly? -- Answer ✔✔ ctxsw has to save registers,
t t t t t t t t t t t t t t t
which is not possible in C
t t t t t
17) Which process executes the context switch code? -- Answer ✔✔ The old process
t t t t t t t t t t t t t
executes the first half of the context switch, then the new process continues
t t t t t t t t t t t t t
executing where previously suspended t t t
18) Which program executes if all user processes are idle? -- Answer ✔✔ The null
t t t t t t t t t t t t t t
process
19) How does a process end? -- Answer ✔✔ kill
t t t t t t t t
20) Name an advantage of a mutex implementation over test-and-set -- Answer ✔✔
t t t t t t t t t t t t
Mutex implementations avoid busy waiting
t t t t
21) No operating system function should contain code to explicitly ____ interrupts --
t t t t t t t t t t t t
Answer ✔✔ enable t t
22) How can blocking interrupts break the scheduling invariant? -- Answer ✔✔ A high-
t t t t t t t t t t t t
priority process may finish its I/O and be ready to run, but disabling interrupts
t t t t t t t t t t t t t t
prevents a context switch t t t
SOLVED ANSWERS: GUARANTEED PASS
1) Name the sections of memory -- Answer ✔✔ Stack, Shared Libs, Heap, Bss, Data,
t t t t t t t t t t t t t t
Text
2) What goes in the text section of memory? -- Answer ✔✔ Instructions that the
t t t t t t t t t t t t t t
program runs t
3) Name the four features of a 3rd generation machine -- Answer ✔✔ Processor,
t t t t t t t t t t t t t
memory system, I/O devices, interrupts t t t t
4) Are virtual or physical addresses cached? -- Answer ✔✔ Virtual addresses
t t t t t t t t t t
5) What is the purpose of the interrupt mask? -- Answer ✔✔ It is a bitmask kept in the
t t t t t t t t t t t t t t t t t t
CPU status register to determine which interrupts are permitted
t t t t t t t t
6) In XINU, how are processes implemented? -- Answer ✔✔ Each process is a thread of
t t t t t t t t t t t t t t t
the main program
t t
7) In XINU, is the stack or heap shared? -- Answer ✔✔ The heap is shared, but each
t t t t t t t t t t t t t t t t t
process has its own stack t t t t
8) Threads within a process share these three things (and a 4th in XINU)... -- Answer
t t t t t t t t t t t t t t t
✔✔ text, data, and bss (and heap)
t t t t t t
9) Where is information about each process stored? -- Answer ✔✔ In the process table
t t t t t t t t t t t t t t
(or thread table)
t t
10) A process that is delayed for a specified time is in what state? -- Answer ✔✔ Sleeping
t t t t t t t t t t t t t t t t
, 11) A process that is not permitted to execute is in what state? -- Answer ✔✔ Suspended
t t t t t t t t t t t t t t t
12) Where are processes that are ready to execute stored? -- Answer ✔✔ In the
t t t t t t t t t t t t t t
readylist
13) What is XINU's scheduling policy? -- Answer ✔✔ Highest priority process gets the
t t t t t t t t t t t t t
CPU
14) When is the scheduling invariant enforced? -- Answer ✔✔ When the set of eligible
t t t t t t t t t t t t t t
processes changes, or the priority of any eligible process changes
t t t t t t t t t
15) What function swaps the currently running process? -- Answer ✔✔ ctxsw
t t t t t t t t t t
16) Why must ctxsw be written in assembly? -- Answer ✔✔ ctxsw has to save registers,
t t t t t t t t t t t t t t t
which is not possible in C
t t t t t
17) Which process executes the context switch code? -- Answer ✔✔ The old process
t t t t t t t t t t t t t
executes the first half of the context switch, then the new process continues
t t t t t t t t t t t t t
executing where previously suspended t t t
18) Which program executes if all user processes are idle? -- Answer ✔✔ The null
t t t t t t t t t t t t t t
process
19) How does a process end? -- Answer ✔✔ kill
t t t t t t t t
20) Name an advantage of a mutex implementation over test-and-set -- Answer ✔✔
t t t t t t t t t t t t
Mutex implementations avoid busy waiting
t t t t
21) No operating system function should contain code to explicitly ____ interrupts --
t t t t t t t t t t t t
Answer ✔✔ enable t t
22) How can blocking interrupts break the scheduling invariant? -- Answer ✔✔ A high-
t t t t t t t t t t t t
priority process may finish its I/O and be ready to run, but disabling interrupts
t t t t t t t t t t t t t t
prevents a context switch t t t