CS3013 Practice Final Exam

  1. Consider a paging system with the page table stored in memory:

    1. If a memory reference takes 175 nanoseconds, how long does a paged memory reference take?
    2. If we add associative registers, and we have a 95 percent hit-ratio what is the effective memory access time? Assume access to the associative registers takes 5 nanoseconds.

  2. Fragmentation:

    1. What kind of fragmentation do we have with paging? Given N processes in memory, how much fragmentation do we have?
    2. What kind of fragmentation do we have with fixed partitions? Given N processes each in size M memory partitions how much fragmentation do we have?

  3. Explain how the OPT page replacement algorithm is similar to the SJF process scheduling algorithm. In particular, what are the uses for OPT and SJF?

  4. Consider a system with 1024 bytes (words) of physical memory divided into 16 frames. The logical address space for each process also has 32 pages:

  5. Consider the following pseudo-program with a fork() call that starts a process running in the indicated function. The process then terminates after the function is over:

      /* global variable */
      int x
    
      int main() {
        fork(doIt)
        x = 0
        print(x)
      }
    
      void doIt() {
        x = 1
        print(x)
      }
      
    1. What are the possible outputs? Assume no errors in the system calls.
    2. Then, assume we replace the fork() call with a create_thread() call that makes a new thread instead of a process. Now, what are the possible outputs?
    3. Then, use mutex_lock() and mutex_unlock() to ensure that running the program prints "0" first and then "1".

  6. Consider a system with 32 bits for a memory access. Assume a 2 level paging scheme with 4 bits for the outer page table and 8 bits for the inner page table. How big is each page?

  7. What is a relocation register? Give an example and describe how it is used. What additional hardware can you add to the relocation register to enable memory protection? Give an example.

  8. Using only the following pseudo-system calls and statements:

    Implement a client and a server that has the client connect to the server, send a login name (from the keyboard) to the server, receive an "ok" from the server and close the connection. You may use the above statements more than once, as needed.


Return to the CS3013 Home Page