REMINDER ON UNITS
Below, 1K equals 1,024 bytes, 1M equals 1,024 * 1,024 bytes.
  1. A user has a computer with a 50M hard disk containing a single FAT-16 partition. The system is using 1K blocks, and there are blocks numbered 0 to 51,199.
    1. How big is the FAT table in bytes, and therefore, how many disk blocks will the FAT table occupy?
    2. Currently, there are only two files on the disk, and both are in the root directory. The directory contents and the relevant portion of the FAT table are shown below. All other FAT entries are marked `FREE'.
      Figs/053q1.png
      Describe any errors shown in the directory or FAT table. Explain why they are errors, and how they can be corrected.
    3. The user creates a new file called index.htm which is 12,500 bytes long. Write out a suitable directory entry, and a list of disk blocks (separated by commas), that can be used to allocate space in the filesystem for this file.
    4. How much internal fragmentation occurs when index.htm is created? Explain your answer.
  2. Discuss why a computer with a 2K page size running LRU will have a more accurate concept of the working set of its processes than a computer with a 16K page size running LRU. Are there any advantages to using a 16K page size instead of a 2K page size? Why/why not?
  3. A process performs the operation x=x+1; and in doing so, it is blocked by the operating system. Why would the operating system block the process, if it has not performed a system call? How does the operating system know when to unblock the process, and where is this knowledge recorded?
  4. The following pseudo-code shows a function that has to work on a linked list that is shared by several threads.
    // Function to unlink the head node of a shared linked list
    // and return a pointer to the node. If the list is empty,
    // then a null pointer is returned.
    
    Nodepointer getNode(Linkedlist L)
    {
      // Lock the list
      acquire(L.semaphore);
    
      // See if the list is empty and return if it is
      if (L.headnode == null)
        return(null);
    
      // Find the first node from the list
      Nodepointer n = L.headnode;
    
      // Point the list's head at the node after n,
      // and return the node n
      L.headnode = n.next;
      release(L.semaphore);
      return(n);
    }
    
    1. Why must the line release(L.semaphore); occur after the line L.headnode= n.next; What problems might occur if the lines were reversed?
    2. Given the function as it is written, how is it possible for the threads using this function to suffer starvation?
  5. What does it mean to have root/administrator/superuser access? Outline the difference between having root/administrator/superuser access, and kernel mode. What is accessible in kernel mode that is not accessible with root access? Explain.
  6. On a Unix system, CPU-bound processes have their priority lowered each time they are pre-empted. A programmer modifies her CPU-bound process, so that it occasionally does some I/O; the idea is that the process will not reach the lowest priority, and thus get more CPU time.
    Explain the flaw in the programmer's idea. Why won't the process receive more CPU time, if it occasionally does some I/O?
  7. "The operating system provides a set of abstract services to application processes".
    Explain the mechanism that is used to provide an abstract service to a process. What prevents the process from accessing the actual resources behind the abstract service?
  8. Interrupts on a computer are prioritised. User processes run at interrupt level 0, i.e. below the level of the lowest priority interrupt. Why is this necessary?
  9. Five GUI processes are blocked waiting for some user input (a mouse movement, a keyboard event etc.). The user returns to the PC and hits the Enter key. Why is only one process returned to the ready queue, if all are waiting for a keyboard event?
  10. You write a C program that does nothing but sleep() for 5 seconds, and prints out a message. When you run your program, it takes 8 seconds for the message to appear. Explain some possible reasons why the message appeared 3 seconds late.
  11. After a Unix process fork()s, there is a new child process. How does each process know which is which? In what part of the program does the child begin execution? Will there be any problems if the child exit()s before the parent process wait()s for it? Explain.
  12. Name three abstract services/concepts provided by operating systems. Explain what makes them abstract services. For each abstract service, describe what hardware devices is used to perform the abstract service.
  13. What is multiprogramming?
  14. Peripheral controllers each have a memory address decoder and generate a specific interrupt. What problems would occur if a) the address ranges of two controllers overlapped, and b) two controllers used the same interrupt line?
  15. Which of the following instructions should be allowed only in kernel mode? Why?
    1. Disable all the interrupts
    2. Read the time-of-day clock
    3. Set the time-of-day clock
    4. Change the memory map
  16. If application programs can call both library calls and system calls, what distinguishes a system call from a library call? Explain why an ordinary Unix user can write their own library calls, but cannot write their own system calls.
  17. Why is the process table needed in a time-sharing system? Is it also needed in embedded systems in which only one process exists, that process taking over the entire machine until it is finished?
  18. "The internal design of an operating system does not influence the API set of system calls that the operating system provides". Explain why you agree or disagree with this statement, and give supporting evidence to justify your answer.
  19. What is the difference between a program and a process? What characteristics does a process have that a program does not?
  20. Round robin schedulers normally maintain a list of all runnable processes, with each process occuring exactly once in the list. What would happen if a process occurred twice in the list? Can you think of any reason for allowing this? Can you think of any problems in allowing this?
  21. What process scheduling policy does the Unix long-term scheduler attempt to achieve? Explain how this scheduler implements this policy.
  22. Disk requests come in to the disk driver for cylinders 12, 42, 106, 3, 55, 14 and 92, in that order. A seek takes 10 msec per cylinder moved. How much seek time is needed for
    1. First-come, first-served
    2. Shortest seek first
    3. SCAN
    4. C-SCAN
    In all cases, the arm is initially at cylinder 20, and for SCAN & C-SCAN, the initial arm direction is ascending.
  23. Explain why DMA is normally the preferred way of doing I/O transfers. Suggest any I/O situations where DMA cannot be used, and explain why not. Would DMA have any advantage for the input provided by the mouse? Explain why/why not.
  24. The top-half of the operating system is usually the place where processes are blocked when they request an I/O operation. Does the top-half block all processes that have performed system calls? Why/why not? Explain why the bottom-half of the operating system cannot block processes, but can only unblock processes.
  25. A process asks the operating system to put it to sleep for 5 seconds. How does the process make this request? How does the operating system achieve this? Give a step by step explanation, from the point where the process asks, to the point where the process is awoken. Why can't the operating system guarantee that the process will be woken up exactly 5 seconds later?
  26. Some intelligent disks have `spare' cylinders. For example, there may be an extra cylinder every 100 cylinders. If a sector becomes physically bad on the disk, the drive will borrow a sector from the closest spare cylinder, and use this instead.
    What effect would this sector remapping have on queue reordering algorithms like SCAN and C-SCAN?
  27. Using a paged architecture system, show how it is possible that two processes can read and write to location 15,000 but not be accessing the same RAM location.
  28. In what situations would you use message passing instead of pipes/streams for interprocess communications? In what situations would you use pipes/streams?
  29. Synchronisation mechanisms are generally associated with large multi-user server systems like Unix and NT. Explain why synchronisation is also an issue on desktop systems like Windows 98. Give an example situation to illuminate your answer.
  30. One touted advantage of threads is that they can reduce the cost of context switching, because the operating system doesn't have to unmap so many pages and then remap new ones.
    Is this a real advantage? When can such a saving occur, and give your opinion as to how often this situation will arise.
  31. The FAT filesystem layout limit performance by having the table at one end of the disk, and forcing a linear search to find an arbitrary block within a file.
    Suggest some alternative filesystem designs that would preserve the overall FAT concept, but could help improve the speed of the filesystem. Keep your answer short and succinct. Just some simple changes.
  32. Is it possible for an operating system that uses one filesystem layout (e.g FAT) to switch to another layout (e.g tree structured i-nodes) without affecting the API for file operations? Justify your answer, with examples if possible.



File translated from TEX by TTH, version 3.85.
On 23 Mar 2012, 06:35.