CMSC 412 Final (Spring 2002)

1.)                  (20 points) Define (or explain) the following terms:

a)       Mutual Authentication

b)       Remote Procedure Call

c)       Item Potent Message

d)       Mutual Exclusion

e)       Inverted Page Table

2.)                  (30 points) Page Replacement

a)       Consider three page replacement policies FIFO, LRU, LIFO.  Given the following reference string (starting from no pages in memory), How many page faults would occur if you had 3, 4, and 5 physical page frames. (Use the back of the previous page as scratch space if needed). Reference String: 1 3 2 5 1 3 4 1 3 2 5 4

Page Frames

FIFO

LRU

3

 

 

4

 

 

5

 

 

b)       For processes in your project, why can’t you page out the page for the kernel stack?

3.)                  (15points) List the four conditions necessary for deadlock.

4.)                  (25 points) Consider the problem of providing synchronization for a barbershop with N barbers. In addition to the N barber chairs there are also waiting chairs (a constant CHAIRS).  When a customer arrives, if a barber is free they should be served, if there is a free waiting chair they should wait, and if there are no waiting chairs free, they leave.  When a barber cuts hair, they should run the subroutine cutHair(), when a customer is getting their hair cut they should run getHairCut(). Using semaphores, provide a solution to this problem that does not use busy waiting.  Make sure to show the initial values for any variables or semaphores.

Declarations

Barber Code:

            Customer Code:

 

5.)                  (20 points) In the project, currently your initial user program (a.exe) provides a command prompt.  To provide better security, you would like to make this program prompt for a user name and password.  Once the program has verified the user name and password, it would start the shell program (shell.exe) running with the uid of the user who had just logged in.  When the user logs out (shell.exe terminates), a new user name prompt should appear. Given the function validateUser(char *username, char *password) which returns the uid of the user if the name and password are valid, and –1 otherwise, write the login program.  You may also assume that calling setEffectiveUID(-1) allows a process to return to it’s original uid.

6.)                  (20 Points) Currently your project lacks a heap (malloc/free) for user space processes.  Describe how you would add this to your project (assuming a completed project 3 as a starting point).  Make sure to indicate what changes would be made to the kernel, system call interface, and user libraries.

7.)                  (20 Points) I/O and Filesystems

a)       List two advantages of having an intergraded virtual memory system and file buffer cache

b)       If a fixed geometry 2GB (2 x 230) disk has 512 bytes/sector, 1024 cylinders, and 32 heads, how many sectors/track does it have? Write your answer as an integer, not an expression.

c)       Explain the difference between a stateless and statefull distributed file system.  Give one advantage of each.

 

Web Accessibility