Operating Systems

  1. What are the 5 main tasks of an operating system?
  2. There are 3 programs running on the computer:
    1. foo, which has just moved onto the CPU, and needs a total of 210ms of CPU time.
    2. blah, which is on the ready queue, and needs a total of 190ms of CPU time.
    3. hink, which is on the ready queue, and needs a total of 70ms of CPU time.
    4. murg, which is blocked waiting for an IO service that will be completed in another 60ms. Once the IO service is completed murg needs another 140ms of CPU time.
    Using round-robin scheduling, with a quantum of 50ms, show each change to which process is using the CPU and the state of the ready queue, until all processes are completed. Assume that the time taken for the OS to respond to interrupts is 0. Here's the start of things ...
    Time 0           50
    CPU: foo         blah
    RQ : blah<-hink  hink<-foo
    IOQ: murg        murg
    
  3. Suppose we have 4MB of memory. Assume that the OS requires 1MB, and device drivers & library routines require 1MB. Draw diagrams showing:
    1. the initial state of memory
    2. after 2 programs start: xtetris (1.2MB) and xbiff (0.5MB)
    3. if xtetris stops and xtank (1MB) starts
  4. Imagine a disk which has 32 sectors, spins at 7200rpm, and takes 10ms to move the disk head from one track to another. What is the longest time it could take to read a file which is stored on a disk in three separate blocks, all on separate tracks?