Homework #6 Solution

Assignment: Problems 11.6, 11.12, 12.9, and 12.11

Problem 11.6

Could you simulate a multi-level directory structure with a single-level directory structure using arbitrarily long names?

Yes, using a some symbol to simulate a directory in the name, like ".", then you can do it.

For example, the name "bill.class.csc420.hw06.txt" could be used to simulate a directory structure of directory "bill/class/csc420/" and file "hw06.txt".

If you are limited to 7 characters in the name, then a more sophisticated technique must be used. For example, is you used a lookup table for 7 character symbols into, that would translate into some simulated directory structure.

For example, maybe the symbol "a43mx0s" would be found in the lookup table to map to directory "bill/class/csc420" and file "hw06.txt". Of course, this scheme would quite awkward and inefficient to implement.

 

Problem 11.12

Consider a system that supports 5000 users. Suppose that you want to allow 4990 of these users to be able to access one file.

a) How would you specify this protection scheme in Unix?

You can add each of the 4,990 users to a group, and then use the allow access to the file by that group.

Alternately, on some Unix systems, you can create an Access Control List (ACL) and assign access according to that list.

 

b) Could you suggest another protection scheme that would be more effective?

In this case, it would be easier to be able to specify a group of users that can not access the file and allow any user not on the list to have access.

Another alternative is to password the file and give the password to users that you deem need access to the file.

 

Problem 12.9

How do caches improve performance? Why don't systems just use larger caches?

Caches improve system performance by copying data into a faster memory location, thus speeding up read and/or write access to that data.

The size of the cache is limited because it is generally an expensive part of a computer system. Also, caches tend to be a volatile, rather than nonvolatile, storage medium.

 

Problem 12.11

Why is it advantageous to the user for an operating system to dynamically allocate its internal tables? What are the penalties for doing so?

If the OS uses dynamically allocated tables, then the OS will never run into an artificial limit on the number of "things" in an array. With dynamic allocation, the system will grow until its resources, like virtual memory, are exhausted.

A system built with dynamic allocation may be more complex and therefore more prone to having bugs. Also, it may be slightly slower in its execution. These are generally smaller concerns than the disadvantages of using fixed-size arrays, however.