CECS 326 – Operating Systems
Review for Final
The final is scheduled on Thursday, 12/15/05 at 10:15am – 12:15pm, in VEC-419. The final is a closed-
book and closed-notes exam, and is cumulative and covers Chapters 1-4, 6-10 and parts of 11 and 12 of the
text by Gary Nutt, and all the lab projects on Linux. To study for the final, you should review materials for
all the listed chapters, and concepts and techniques covered in the lab exercises and assignments that we
have done in the class. I have included below review questions for Chapters 10-12, along with those for
Office hours during the final exam week: Tuesday 11:00am – 12:00pm
Wednesday 4:30pm – 5:30pm
Thursday 4:00pm – 5:00pm
Chapter 10: Deadlock
Exercise problems 1-4, 6, 7, 9, 11, and 13 on pp. 410-413.
Chapter 11 & part of Chapter 12: Memory Management
1. Name two differences between logical and physical addresses.
2. Explain the difference between internal and external fragmentation.
3. Describe the following allocation algorithms:
4. A memory manager can sort the free list according to any criteria it chooses.
a. How would the free list be organized for the best-fit policy?
b. How would the free list be organized for the worst-fit policy?
c. How would the free list be organized for the first-fit policy?
d. How would the free list be organized for the next-fit policy?
5. Given memory partitions of 100KB, 500KB, 200KB, 300KB, and 600KB (in order), how would each of the first-
fit, best-fit, and worst-fit algorithms place processes of 212KB, 417KB, 112KB, and 426KB (in order)? Which
algorithm makes the most efficient use of memory?
6. A memory manager for a variable-sized partition strategy has a free list of blocks of size 600, 1000, 2200, 1600,
and 1050 bytes.
a. What block will be selected to honor a request for 1603 bytes using the best-fit policy?
b. What block will be selected to honor a request for 949 bytes using the best-fit policy?
c. What block will be selected to honor a request for 1603 bytes using the worst-fit policy?
d. What block will be selected to honor a request for 349 bytes using the worst-fit policy?
e. Assume the free list is ordered as the blocks are listed in the problem statement. What block will be selected
to honor a request for 1603 bytes using the first-fit policy?
f. Assume the free list is ordered as the blocks are listed in the problem statement. What block will be selected
to honor a request for 1049 bytes using the first-fit policy?
7. Consider a system where a program can be separated into two parts: code and data. The CPU knows whether it
wants an instruction (instruction fetch) or data (data fetch or store). Therefore, two base-limit register pairs are
provided: one for instructions and one for data. The instruction base-limit pair is automatically set to read-only,
so programs can be shared among different users. Discuss the advantages and disadvantages of this scheme.
CECS 326 – Operating Systems
8. A certain OS supports four different address spaces for each process, called Sa, Sb, Sc, and Sd. Suppose the
memory manager loads the four address spaces into physical memory as follows:
Space Physical Memory Location
What is the physical address of each of the following process addresses?
a. 0x00456789 in Sa
b. 0x0000089a in Sd
c. 0x00043210 in Sb
d. 0x00010234 in Sc
e. 0x000bcdef in Sa
f. 0x01010000 in Sd
9. Why are page sizes always powers of 2?
10. Consider a logical-address space of eight pages of 1024 words each, mapped onto a physical memory of 32
a. How many bits are in the logical address?
b. How many bits are in the physical address?
11. Consider a paging system with the page table stored in memory. What is the effect of allowing two page-table
entries to point to the same page frame in memory?
12. Consider a paging system with the page table stored in memory.
a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?
b. If we add associate registers, and 75% of all page-table references are found in the associate registers, what is
the effective memory reference time? (Assume that finding a page-table entry in the associate registers take
zero time, if the entry is there.)
Chapter 1 : Introduction
13. What are the three main purposes of an operating system?
14. What is multiprogramming, and what is its main advantage?
15. What is resource sharing? How is it usually achieved?
16. What is the contribution of timesharing technology to contemporary operating systems?
17. What is the contribution of embedded systems technology to contemporary operating systems?
18. Define the essential properties of each of the following types of operating systems:
19. Identify which of the following are examples of space-multiplexed sharing, and which are time-
multiplexed sharing. If there is a sense that it could be either strategy, explain:
The land in a residential subdivision
A personal computer
CECS 326 – Operating Systems
A whiteboard in a classroom
A bench seat on a bus
A single-user file in UNIX
A printer on a time-sharing system
The heap in the C?C++ runtime system
20. Suppose that a multiprogrammed system has a load of N processes with individual total execution times
of t1, t2, …, tN. How would it be possible that the execution time could be as small as maximum (t1,
t2, …, tN)?
21. Suppose that a multiprogrammed system has a load of N processes with individual total execution times
of t1, t2, …, tN. How would it be possible that T > t1+t2+…+tN, where T represents the time it takes to
complete all N processes?
22. UNIX shell, argc, argv, fork, sleep, exec.
Chapter 2 : Using the Operating System
Chapter 3 : Operating System Organization
1. In the context of operating systems, what is in an abstract machine?
2. What is in a process abstraction, and how is it implemented?
3. What basic system calls are provided on UNIX/Linux for process creation and execution?
4. What is a thread, and how is it different from a process?
5. Name all major requirements of an operating system, and explain each.
6. Name all major operating system design constraints and explain each.
7. What is the significance of processor modes?
8. What happens when a system call is executed?
9. What is a kernel?
10. Show a basic operating system organization.
11. Show a UNIX architecture.
Chapter 4 : Computer Organization
1. What is the von Neumann architecture? What are the functions in each component?
2. What is DMA and what is it for?
3. What is the advantage of memory-mapped I/O?
4. How do device interrupts help eliminate busy wait situations? Why is busy wait undesirable? How
does the fetch-execute cycle work with interrupts?
5. What is a race condition in the context of interrupt handler execution, and why should a race condition
6. How does bootstrapping work?
7. What is a pipelined function unit?
8. What is a SIMD machine?
9. Exercise problems 1, 3, 4, 5, 6, 8, 9, 15, and 17 in Chapter 4 (pp. 148-151).
Chapter 6 : Implementing Processes, Threads, and Resources
1. What are the responsibilities of a process manager?
2. What is the difference between a classic process and a modern process?
3. What are user space threads, and what are kernel threads? Why would the entire process block when
one of its threads blocks in a user space thread implementation? Why is this not true in a kernel thread
4. What is a process descriptor (a.k.a. PCB for process control block), and what does it contain?
5. What is a thread descriptor and what does it contain?
CECS 326 – Operating Systems
6. Understand the basic process/thread state transition, as well as UNIX state transition.
7. What is the process context? When do context switches occur? What does a kernel have to do when it
performs a context switch?
8. Show a pseudo code segment to load a new process onto a CPU for a processor that contains
arithmetic-logical registers R0-R3, processor status PSR, condition code register CC, program counter
PC, and instruction register IR. You may make your own assumption on the PCB organization.
Chapter 7 : Scheduling
1. Show a model of process execution.
2. What does the scheduler in an operating system consist of, and what does each component in the
3. What is required for implementing involuntary CPU sharing? Show pseudo code for the
4. What is the difference between a scheduling policy and a scheduling mechanism?
5. What are the important considerations for developing/choosing a scheduling policy?
6. Understand these terms in scheduling: service time, wait time, response time, turnaround time,
throughput rate, arrival rate, service rate, nonpreemptive scheduling, preemptive scheduling, time
7. Understand the following scheduling policies: first come first served, shortest job next, priority
scheduling, deadline scheduling, round robin scheduling, round robin scheduling with overhead,
8. Exercise problems 2-11 in Chapter 7 (pp. 280-282).
Chapter 8 : Basic Synchronization Principles
1. What are critical sections, and what are their relevance in the presence of concurrent processes and
2. Requirements for an accepted solution to the critical section problem.
3. Assumptions of software solutions to the critical section problem.
4. Possible solutions for the critical section problem:
a) Disabling interrupts (How? Does it work? Any shortcomings?)
b) Using a lock variable (How? Does it work? What are the problems?)
c) Using multiple lock variables for multiple shared variables (Potential problems: inconsistent results,
d) Semaphore (Definition. P and V operations. Why must these operations be atomic?)
5. Example applications of the semaphore mechanism:
a) The shared account balance problem
b) Synchronizing two processes
c) The bounded buffer problem
d) The readers-writers problem (reader preference solution and writer preference solution)
e) The sleepy barber problem
Lab exercises 9/1/05, 9/6/05, 9/8/05, 9/22/05, 10/11/05, 10/18/05, and 11/22/05; as well as assignments on