Operating Systems Sample Exam Questions1. Describe the two general roles of an operating system, and elaborate why these roles are important.
Using a simple system call as an example (e.g. getpid, or uptime),
describe what is generally involved in providing the result, from the
point of calling the function in the C library to the point where that
3. Why must the operating system be
more careful when accessing input to a system call (or producing the
result) when the data is in memory instead of registers?
4. Is putting security checks in the C library a good or a bad idea? Why?
5. Describe the three state process model, describe what transitions are valid between the three states, and describe an event that might cause such a transition.
Multi-programming (or multi-tasking) enables more than a single process
to apparently execute simultaneously. How is this achieved on a
7. What is a process? What are attributes of a process?
8. What is the function of the ready queue?
9. What is the relationship between threads and processes?
10. Describe how a multi-threaded application can be supported by a user-level threads package. It may be helpful to consider (and draw) the components of such a package, and the function they perform.
11. Name some advantages and disadvantages of user-level threads.
12. Why are user-level threads packages generally cooperatively scheduled?
13. Enumerate the advantages and disadvantages of supporting multi-threaded applications with kernel-level threads.
Describe a sequence the sequence of step that occur when a timer
interrupt occurs that eventually results in a context switch to another
15. Context switching between two threads of
execution within the operating system is usually performed by a small
assembly language function. In general terms, what does this small
function do internally?
16. What is a race condition? Give an example.
17. What is a critical region? How do they relate to controlling access to shared resources?
18. What are three requirements of any solution to the critical sections problem? Why are the requirements needed?
19. Why is turn passing a porr solution to the critical sections problem?
Interrupt disabling and enabling is a common approach to implementing
mutual exclusion, what are its advantages and disadvantages?
What is a test-and-set instruction? How can it be used to implement
mutual exclusion? Consider using a fragment of psuedo-assembly language
aid you explanation.
22. What is the producer consumer problem? Give an example of its occurence in operating systems.
23. A semaphore
is a blocking synchronisation primitive. Describe how they work with
the aid of pseudo-code. You can assume the existance of a
thread_block() and a thread_wakeup() function.
24. Describe how to implement a lock using semaphores.
25. What are monitors and condition variables?
26. What is deadlock? What is startvation? How do they differ from each other?
27. What are the four condtions required for deadlock to occur?