Operating Systems and Computer Structures G2
Tutorial Exercises, Week 13, 1996

  1. Write a program in C isdir that takes one command line argument. It should have an exit code of 0 if the argument is a directory, or other values if it is not. Hint: use stat()

  2. An existing file can have extra bytes appended to the end of it, leaving the existing contents unaltered. Discus how this can be done using
    1. The MSDOS file system.
    2. The Unix file system.
  3. When a process attempts to delete a file, the Operating System must ensure that the process has delete access to that file.
    1. Using the Unix directory and inode structure, explain how Unix can determine if the file /student/os/file1 can be deleted by a process with a user id of 20 and a group id of 40.

    2. Using the MSDOS FAT table structure, explain how MSDOS can determine if the file c:\windows\win386.swp can be removed by del.
  4. The memory of a system is 128 blocks and is organised using the buddy system. Intitially all memory is free. Requests are received of obtain 6 blocks obtain 10 blocks obtain 16 blocks obtain 8 blocks Show the state of memory after each request.
  5. In a virtual memory system, describe in less than one page how a virtual address reference is translated into a physical address.

Creative Commons License Copyright © Jan Newmarch under the terms of the Creative Commons Attribution 2.1 Australia License.