CS 4513 Operating Systems II WPI, D Term 2000
Craig E. Wills Midterm Exam (100 pts)
Given: Friday, April 7, 2000








NAME: $\underline{\hspace*{3in}}$










This is a closed book (and notes) examination. Answer all questions on the exam itself. Take the number of points assigned to each problem and the amount of space provided for your answer as a measure of the length and difficulty of the expected solution. The exam totals 100 points.

SCORE: $\underline{\hspace*{3in}}$




1.
(14 points) Consider the following set of files with the first nine characters on each line showing read, write and execute permissions for the file owner, a group member and all other users. The permissions are followed by the file name, its owner and its group. The user bob is the only member of bobgroup. The user grover is the only member of grovergroup. Users bob and jane are members of fungroup.

rwxrwx---   foo         bob    fungroup
rw-rw----   foo.c       bob    fungroup
rwxrwxr-x   bar         bob    fungroup
rw-rw-r--   bar.c       bob    fungroup
rw-------   proj.doc    bob    bobgroup
rwxr-xr-x   func        jane   fungroup
rw-r--r--   func.c      jane   fungroup
rw-------   report.doc  grover grovergroup

Circle the correct answer for each of the following:

(a)
Is bob allowed to read the file foo.c? YES NO
(b)
Is jane allowed to write the file foo.c? YES NO
(c)
Is grover allowed to execute the file foo? YES NO
(d)
Is jane allowed to read the file proj.doc? YES NO
(e)
Is bob allowed to write the file func.c? YES NO

If bob wanted to give read and write access to grover for the file proj.doc, what could bob do in the Unix file system? What could bob do in the Windows NT file system?


2.
(5 points) The Unix operating system allows for only one root file system, but many file systems can be available. How does the Unix file system allow for file systems other than the root file system to be accessed?


3.
(10 points) Shared memory multiprocessors.
(a)
Explain (or draw a picture) a multiprocessor with four processors and memory on a shared bus is organized using a Uniform Memory Access (UMA) model. How is good memory access performance achieved?


(b)
Explain (or draw a picture) a multiprocessor with four processors and memory on a shared bus is organized using a Non-Uniform Memory Access (NUMA) model. How is good memory access performance achieved?


4.
(8 points) What does it mean to marshall the parameters in a Remote Procedure Call mechanism?


5.
(10 points) These questions relate to Project 1.
(a)
Consider a series of block allocations and deallocations using your linked list implementation. Among all unallocated blocks, which blocks were most likely to be allocated?





(b)
Consider the bitmap implementation where the allocation of a block b (1 <= b <= NUMBLOCKS) is marked by setting a bit in a bitmap array. Show how your bitmap array was declared. Show the code to determine which array location to use for the block b. Show the code to determine which bit within this array element to use for the block b.


6.
(8 points) What are cylinder groups and why were they added to the Berkeley Unix Fast File System? Give an example of how they are used.


7.
(27 points)
(a)
A directory is a special file with entries for each file contained within the directory. Listing out the files in a directory is a common file system operation. In addition to listing each file, another operation is to also list the size and time stamp of each file. Where is this information stored for each file in each of the following file systems?
i.
FAT-16
ii.
NTFS
iii.
Unix

(b)
It has been observed that the contents of many files are relatively small. What must the file system software do to access the first byte of a small file in each of the following file systems?
i.
FAT-16
ii.
NTFS
iii.
Unix

(c)
Some files can also be large. What must the file system software do to access the last byte of a large file in each of the following file systems?
i.
FAT-16
ii.
NTFS
iii.
Unix

8.
(8 points) What is the difference between a file alias (hard link) and an indirect file (soft link)?


9.
(10 points) Consider a modified Unix file system where inodes are not only used to store file information, but can also be used to store file data. This approach allows the contents of small files to be stored in inode space rather than in data blocks. Discuss needed changes in the inode structure to implement this approach. What are its advantages? What are its disadvantages?