Operating Systems (8 cr), separate exam 14.8.2015   suomeksiToisella puolella suomeksi  

Write in each answer sheet course name, date, your name, signature and student id.
For each question, it is sufficient to give a 1 page answer.
This is an ordinary separate exam, it covers the whole course, and the grade is based solely on this exam.

  1. [6 p] Critical Section
    1. [3 p] Give a pseudocode example on a situation where critical section is composed of two separate code segments. Give a multihreaded scenario for your example where the final result is erroneous because the critical section was not protected properly?
    2. [3 p] Show (with pseudocode) how the critical section in your example should be protected with semaphores. Remember to define all used semaphores with their initial values. Explain why the erroneus scenario (in part a) can not occur now.

  2. [6 p] Producer-Consumer Problem
    1. [3 p] Explain, what is the Producer-Consumer Problem and what specific synchronization and communication problems it involves.
    2. [3 p] Give a pseudocode solution to the Producer-Consumer Problem, based on monitors. Remember to define all condition variables and other monitor data structures.
      If you do not remember monitors, mention about it and give a semaphore solution (max 2p).
      
  3. [6 p] Virtual memory
    1. [3 p] How does the address translation for 1-level paged virtual memory occur at hardware and software level? How long will the address translation take in different cases?
    2. [3 p] What memory management (operating system) components are there in relating (paged) virtual memory and which problem does each component solve?

  4. [6 p] Real time processor scheduling
    1. [3 p] How does the scheduling for real-time systems differ from that for normal systems?
      Why are FIFO (FCFS) or Round-Robin usually not good for real-time systems scheduling?
    2. [3 p] A real-time system needs to handle concurrently two (voice) phone calls and one video stream. Each phone call runs every 5 msec and consumes 1 msec of CPU time per burst. The video stream has 25 frames/sec, with each frame requiring 15 msec of CPU time. These three processes are schedulable with RMS (rate monotonic scheduling).
      Explain why the processes are schedulable with RMS and what is the resulting schedule.

  5. [6 p] File managment
    1. [4 p] What is an indexed file (IF) and how does it differ from indexed sequential file (ISF)?
      When should IF be used? In which case is IF slower than ISF?
      How many indexes are there with IF and how large are they?
    2. [2 p] Why would it be useful to implement the index with a B-tree? What advantage does a B-tree implementation has as compared to an ordinary (multi-level) index?

  6. [6 p] System security. Process P wants to read file FileX.
    1. [2 p] How do you define in the system, who can read FileX?
      How are FileX access rights implemented in operating system structures?
    2. [2 p] How does P get the rights to read FileX? Who gives them and when?
      When is the check done whether P is allowed to read FileX?
    3. [2 p] How do fingerprint matching and password salt relate to the problem that process P wants to read FileX?